Query the subscription information of the current API key, including the current API plan, the expiration time and whether it has expired. Useful for a self-check at program startup, or for renewal reminders before the subscription expires.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Available on all API plans: Hobbyist Startup Standard Professional Enterprise
Response Data
This endpoint has no request parameters; it queries the subscription information of the very API key sent in the CG-API-KEY header. data is an object containing the current API plan, the expiration time and whether it has expired.
Keep your API key on the server side onlyThis endpoint returns your account's subscription information. Call it from the server side and read the API key from an environment variable; do not put the key in front-end pages, logs or public repositories. If you suspect it has been leaked, reset it on the API key management page. For details, see Authentication.
200 · application/json · See the response example in the right panel.
| Field | Type | Always Returned | Description |
|---|---|---|---|
code | string | Yes | Business status code; "0" means success |
msg | string | No | Result message, e.g., the reason for the error when authentication fails; may not be returned on success |
data | object | Yes | Subscription information of the current API key |
data.level | string | Yes | English name of the current API plan; values: HOBBYIST (Hobbyist), STARTUP (Startup), STANDARD (Standard), PROFESSIONAL (Professional) |
data.expire_time | integer (int64) | Yes | Subscription expiration time, timestamp in milliseconds (UTC) |
data.expired | boolean | Yes | Whether the subscription has expired, determined by whether the current time at the time of the request is later than expire_time: true if it is later, otherwise false |
If the API key is missing or invalid, the HTTP status code is still 200, so check code in the returned JSON: when the CG-API-KEY header is missing, {"code": "401", "msg": "API key missing."} is returned; when the API key is invalid, {"code": "400", "msg": "Invalid API key provided"} is returned. For details, see Authentication and Error Codes and Rate Limits.
API Plans
All API plans can call this endpoint. This endpoint is not restricted by API plan; it validates the API key in the request header and its subscription information. For the price of each plan, see API Plans.
| API Plan | Access |
|---|---|
| Hobbyist | ✅ Yes |
| Startup | ✅ Yes |
| Standard | ✅ Yes |
| Professional | ✅ Yes |
| Enterprise | ✅ Yes |
For the endpoints each plan can call, the requests-per-minute limits and the historical data ranges, see API Plans and Permissions.
Use This Endpoint with AI
Pick a task and click Open in ChatGPT or Open in Claude: the AI reads this page first and then gives you the result. You can also click Copy and paste the full prompt into the AI tool you use.
This endpoint provides data through the REST API. Use the prompts above to have AI write the request code. For the tools available through MCP, see CoinGlass MCP.
Use Cases
| Scenario | Description |
|---|---|
| Startup self-check | Call it once when the service starts to confirm that the API key is valid and the plan is as expected, so you don't discover missing permissions only after going live. |
| Expiration reminders | Calculate the days remaining from expire_time and send a renewal reminder before the subscription expires. |
| Adjusting features by plan | Use level to decide which features to enable or how to adjust the request rate; for the differences between plans, see API Plans and Permissions. |
| Troubleshooting permission issues | When another endpoint reports no permission or returns no data, first check the current plan and whether it has expired. |
Related Endpoints
| Endpoint | How It Differs |
|---|---|
| Authentication | The CG-API-KEY header and the return codes for authentication failures |
| API Plans and Permissions | Endpoints available to each plan, requests-per-minute limits and historical data ranges |
| Error Codes and Rate Limits | Return code reference and handling 429 rate limiting |
| Quickstart | From getting an API key to sending your first request |
FAQ
How do I calculate how many days are left before expiration?
Subtract the current time's millisecond timestamp from expire_time, then divide by 86,400,000 to get the number of days remaining. expired is determined by whether the current time at the time of the request is later than expire_time; true means it has already expired.
Is expire_time in seconds or milliseconds?
It is a timestamp in milliseconds (UTC). For example, 1805943491000 corresponds to 2027-03-25 02:58:11 UTC.
Why do I get 401 or 400?
When the CG-API-KEY header is missing, code is "401" (API key missing.); when the API key is invalid, it is "400" (Invalid API key provided). In both cases the HTTP status code is 200; for troubleshooting, see Authentication.
Do I need to change my API key after upgrading my API plan?
No. After an upgrade, your existing API key can still be used, and the permissions of the new API plan take effect immediately. After upgrading, you can call this endpoint again to confirm that level has been updated.
Learn More: CoinGlass API Plans and API Keys
How Do I Check the Remaining Request Quota of My API Key?
The response headers include API-KEY-MAX-LIMIT (the maximum number of requests per minute) and API-KEY-USE-LIMIT (the number of requests already used in the current period); subtracting the second from the first gives the remaining quota. For details, see Authentication.
How Do the API Plans Differ?
The plan determines which endpoints you can call, how many requests you can make per minute (30, 80, 300 and 1,200 for Hobbyist, Startup, Standard and Professional respectively; custom for Enterprise), and how far back you can query historical data. For details, see API Plans and Permissions.
How Do I Keep My API Key Secure?
Store the key in an environment variable or a secrets management service and use it only on the server side; do not put it in front-end code, logs or code repositories, and do not share it with third parties. If you suspect it has been leaked, reset it immediately on the API key management page and update every service that uses it.
