API Keys
Create and manage the keys your applications use.

Your first key
The first time you open API Keys on an account that has never had a key, the console makes one for you, named default.
The Your first API key card shows it once: choose Copy key before you leave the page, because it cannot be shown again.
Run on the same card sends one short request with that key and shows the reply and what the request cost.
If you delete default later, the console does not make it again.
The list
| Column | Meaning |
|---|---|
| Key Alias | The name you gave it. Choosing it opens the key |
| Secret Key | A masked form of the key, for telling keys apart. The full key is never shown again |
| Created At / Last Active | When it was made and when it last made a request |
| Expires | The expiration you set, or Never. A key that no longer works shows Expired or Blocked here |
| Spend (USD) / Budget (USD) | What the key has spent against its credit limit. Unlimited means it has no limit |
| Budget Reset | When the key's spend counter next goes back to zero |
The box above the list filters by key alias. In an organization's session the list also has a Team column (teams).
A key that has hit its credit limit or passed its expiration stays in the list but stops working. When every key has expired, the page says so and offers Create a new key.
Create a key
Choose Create key. The form has four fields:

| Field | What it does |
|---|---|
| Name | A label so you recognise the key later, for example Chatbot key. Names are unique within your account. |
| Expiration | When the key stops working: 7 days, 30 days, 90 days, 1 year or Never. |
| Credit limit | The most this key may spend in total. It is taken from your credits, not added to them. Choose a preset, No limit, or Custom amount in whole dollars. |
| Reset limit every | How often the key's spend counter goes back to zero: Day, Week or Month. N/A makes the limit a one-time total. Your credit balance is not affected. |
The form opens with Never and No limit selected, so a name is all you have to enter. In an organization's session the form also asks for a Team, the team whose allocation the key's spend counts toward.
Choose Create, then copy the key immediately: for security it is shown once and cannot be retrieved again. If you lose it, create a new key and delete the old one. The same dialog has Try it now, a curl command that already carries the new key. When your balance is empty, it also says the key works once you add credits.
How many keys
A personal account that has not added credits yet can keep up to 2 API keys.
A third is refused with 400, and the param of the error is key_limit_unpaid.
Delete a key you no longer use, or add credits, to create more.
Blocked and expired keys count until you delete them.
Use your key
Below the list, Use your key has the base URL, a quickstart for any model and the endpoints your account can call. See API.
Typical use: give a new project its own key
Name the key after the project, set a Credit limit you are comfortable losing if the key leaks, and choose whether the limit resets monthly. One key per application means a leaked key can be deleted without touching anything else, and Logs and Activity show what each application spends.
Rotate a key
Rotating replaces the key's secret without touching anything else about it. Use it when a secret may have leaked, or on a schedule.
- Open the key from its name in the list and choose Rotate key.
- Read what will happen, then confirm. The new secret is shown once; copy it into your application.
- Update your application. The old secret keeps working for 24 hours, so you can switch over without downtime. After that it stops working and requests with it return
401.
Spend, credit limit, reset period, expiration and name stay exactly as they were: it is the same key with a new secret, so your logs and usage stay in one place.
Keys are created, edited, rotated and deleted only here in the console, signed in to your account. An API key cannot manage keys, not even itself: a key-management request made with an API key is refused with 403 forbidden. If a key is being misused, delete it rather than rotate it: a deleted key stops working at once, while a rotated key's old secret keeps working for 24 hours.
Edit and delete
Open a key from its name in the list and choose Edit Settings to rename it, change its limit or reset period, or set a new expiration. Choosing a new period restarts the countdown from today; you can also keep the current expiry.
A member of an organization can lower a key's credit limit but not raise it. An admin can stop any member's key from Organization.
Delete key is immediate: requests using the key return 401 from then on.