Open API · Read-only

Query your API key usage & expiry programmatically

Generate a read-only access token in your dashboard and query every active API key's expiry, daily usage and quota with a single command — then wire it into your own scripts, dashboards and alerts.

Read-only, never touches balance One-click generate / reset JSON response, easy to integrate

What you can query

One token covers the key operational metrics of your API keys

Expiry date

The exact expiry of each active API key, so you can plan renewals ahead and avoid downtime.

Daily & monthly usage

Today's cost and request count, plus this month's quota used / limit and utilization at a glance.

Self-service token

Generate, reset or revoke the token in your dashboard; the server stores only a hash and shows the plaintext once.

Three steps to integrate

From generating a token to a working query in minutes

1

Generate a token in the dashboard

Sign in, open the Open API card, click generate, and get a qot_ access token (keep it safe).

2

Call the API with the token

Add Authorization: Bearer qot_... and GET /api/v1/openapi/keys returns your usage as JSON.

3

Integrate into your tools

Feed the response into scripts, monitoring dashboards, expiry alerts or CI pipelines for automated ops.

Start with one command

Plain HTTP + Bearer token — call it from any language

The endpoint returns structured JSON with each active key's name, expiry, today's usage and monthly quota — ready to parse.

  • Read-only: it can only query your own account's API keys — never create, modify or spend balance.
  • Built-in caching and rate limiting keep it fast and upstream-friendly.
# Request
curl -H "Authorization: Bearer qot_xxx" \
  https://qcode.cc/api/v1/openapi/keys

Example response

{
  "ok": true,
  "data": {
    "keys": [{
      "name": "Pro unlimited/day",
      "is_active": true,
      "expires_at_display": "2026/08/22 21:35",
      "current_daily_cost": 42.04,
      "current_requests": 115,
      "monthly_cost_used": 8837.56,
      "monthly_cost_limit": 13000.0
    }],
    "active_api_keys": 1
  }
}

Endpoints

All read-only GETs, authenticated with a Bearer token

Endpoint Description
GET /api/v1/openapi/keysList all your active API keys with expiry, today's usage, monthly quota and utilization.
GET /api/v1/openapi/meAccount-level summary: number of active keys and today's total cost.
GET /api/v1/openapiSelf-description: returns the endpoint list and usage, handy for liveness checks.

Common use cases

Plug usage data into your existing workflow

Expiry alerts

Check expiry on a schedule and auto-send email / IM / Telegram reminders before keys lapse.

Usage dashboard

Feed daily cost and quota utilization into Grafana, spreadsheets or your own panel.

Multi-key monitoring

When a team holds several keys, pull the health and quota status of all of them at once.

CI / automation

Verify a key is still valid and has quota in your pipeline before running expensive AI jobs.

Security by design

The token is a high-entropy random string; the server stores only an HMAC hash and reveals the plaintext once. It is strictly read-only — it cannot create or manage keys or touch your balance — with built-in per-minute / per-day rate limits. If leaked, reset it in one click and the old token dies immediately.

FAQ

How do I get an access token?

Sign in to QCode, open the Open API card in your dashboard and click generate. The plaintext token is shown only once, so copy it right away; you can reset it anytime if lost.

Is the token safe?

Yes. It is read-only and can only query your own account's API key usage and expiry — it cannot create or modify keys or spend balance. The server stores only a hash, and a one-click reset invalidates a leaked token.

Are there rate limits?

Yes. Each token has per-minute and per-day call limits, and results are cached for a few seconds — plenty for regular polling and monitoring. Contact support if you need a higher quota.

Start querying your usage now

Sign in, generate your read-only access token, and wire up expiry alerts and usage dashboards in minutes.