跳转到主要内容
Use this endpoint to query the subscription details and spending limits associated with your API key. It is useful for monitoring remaining budget, checking account tier limits, and verifying the key’s expiry date. Endpoint: GET https://api.qhaigc.net/v1/dashboard/billing/subscription

Authentication

Include your API key in the Authorization header:
Authorization: Bearer sk-your-api-key-here

Response Fields

object
string
Always "billing_subscription".
has_payment_method
boolean
Whether a payment method is attached to the account.
canceled
boolean
Whether the subscription has been cancelled.
canceled_at
integer | null
Unix timestamp of cancellation, or null if not cancelled.
access_until
integer
Unix timestamp indicating when your current subscription period expires.
hard_limit_usd
number
The hard spending cap (USD) for your account. Requests are rejected once this limit is reached.
soft_limit_usd
number
The soft spending limit (USD). You may receive a warning or notification when usage approaches this threshold.
system_hard_limit_usd
number
The platform-enforced maximum spending cap, independent of your configured limit.

Code Examples

import requests

url = "https://api.qhaigc.net/v1/dashboard/billing/subscription"
headers = {
    "Authorization": "Bearer sk-your-api-key-here"
}

response = requests.get(url, headers=headers)
billing = response.json()

print(f"Hard limit: ${billing['hard_limit_usd']}")
print(f"Soft limit: ${billing['soft_limit_usd']}")
print(f"Access until: {billing['access_until']}")

Example Response

{
  "object": "billing_subscription",
  "has_payment_method": true,
  "canceled": false,
  "canceled_at": null,
  "delinquent": null,
  "access_until": 1761223754,
  "hard_limit_usd": 100.0,
  "soft_limit_usd": 80.0,
  "system_hard_limit_usd": 100.0
}
This endpoint follows the same path convention as the OpenAI billing API to maximize compatibility with existing tooling, such as usage dashboards and cost-monitoring scripts built for OpenAI.