Skip to content

Manage API Keys

API keys live on the API Keys page of the Developer Console. It lists every key in your account that hasn’t been deleted, with each key’s status, credits used this month, and when it was last used.

  1. Click Create API key in the top-right corner.

  2. Fill in:

    • Name: tells keys apart. Name it after an environment or project, such as “Production” or “Analytics dashboard”. Up to 128 characters.
    • Expiration: Never, 30 days, 90 days, 180 days, 1 year, or a custom date. Expiration can’t be changed after creation — to change it, roll the key or create a new one.
  3. Click Create. A dialog shows the full key. The full key is shown only this once: copy it into your secrets store right away — once you close the dialog, you can’t view it again.

  4. Optionally, use Try it in the dialog to list supported platforms with the new key and confirm it works (this costs no credits).

Each account can keep up to 10 keys that haven’t been deleted (disabled and expired keys count). Once you hit the limit, delete keys you no longer use. The current limit is shown at the top of the page.

Column Description
Name The name you set when creating or editing the key
API key The first 12 characters of the key, to tell keys apart; the full key is never shown again
Status Active, Disabled, or Expired; keys close to expiring show the number of days left
This month (credits) Credits charged for successful calls with this key in the current calendar month (China Standard Time)
Last used The last time this key passed authentication; keys that have never been used show “Never used”

View request logs in the actions menu jumps straight to this key’s requests.

Only the name can be changed. The key itself and its expiration can’t.

  • Disable: requests using the key are rejected immediately (ret 1030). You can re-enable it at any time. Useful when a key is temporarily unused, or to stop the bleeding while you investigate suspicious calls.
  • Enable: restores a disabled key. Expired keys can’t be enabled — create a new one instead.

Rolling generates a new key. Use it for scheduled rotation or when you suspect a key has leaked:

  1. Choose Roll key in the actions menu.

  2. Pick when the old key expires: Immediately, in 1 hour, in 24 hours (default), or in 7 days. During the grace period both keys work, so you can deploy the new key first and let the old one expire on its own.

  3. Confirm. A dialog shows the full new key — again, only this once.

Rules for rolling:

  • The new key keeps the old key’s name and expiration date and appears as a new row in the list. The old key stays in the list: it becomes Expired when the grace period ends (or Disabled right away if you chose Immediately).
  • The old key stops working at whichever comes first: now plus the grace period, or its original expiration date.
  • Only active, unexpired keys can be rolled. Enable a disabled key first; create a new key to replace an expired one.
  • You can still roll once when you’re at the key limit; beyond that, delete old keys before rolling again.
  • Tasks submitted with the old key before the roll don’t appear in the new key’s task list, but you can still retrieve them by task_id.

Deletion can’t be undone. Requests using the key are rejected immediately (ret 1030). To pause a key temporarily, disable it instead.

Tasks submitted with a deleted key are kept: Request Logs and Usage still show the key’s name and prefix, and you can retrieve those tasks by task_id with any other valid key.

After a key is disabled, deleted, expires, or reaches the end of its roll grace period:

  • Tasks submitted with that key that are still waiting (queued) and haven’t been dispatched fail at dispatch (error_code credential_invalid), and no credits are charged.
  • Tasks already dispatched to the platform finish normally.
  • Never put keys in browser code, mobile apps, mini-programs, or public repositories. Read them from environment variables on your server.
  • Create separate keys per environment and project, so if one leaks you can disable or roll it without affecting anything else.
  • Roll immediately if you suspect a leak; give the old key a grace period when you need a smooth handover.

More in Authentication.