Models Hub
User GuideUser Console

API Key Management

Create and manage API keys, supplier routing strategies, quotas and expiry, model limits and IP whitelists.

Edit this page

An API key is your credential for calling the API. Every request to /v1/... must include:

Authorization: Bearer sk-xxxxxxxx

Menu location: General → API Keys in the left sidebar.

Creating a key

Click New at the top right of the list. The form has three sections: basic information, quota settings and advanced settings. Only the name is required — everything else works at its defaults.

Basic information

FieldDescription
NameFor identification. Name by "environment-workload", e.g. prod-order-service, local-dev
Supplier routingWhich route this key uses. Defaults to Smart routing → Smart automatic; see the next section
Expiration time1 hour / 1 day / 1 month / never, or a custom date. The key stops working after it
QuantityCreate several keys at once. Names are auto-numbered — useful for provisioning multiple colleagues or environments

Quota settings

FieldDescription
Unlimited quotaOn by default. The key has no cap of its own and can spend until the account balance runs out
QuotaSet after turning off unlimited — the spending cap for this key, in currency

A key's quota is not a separate pot of money. Money always comes from the account balance. The quota is a limit — for example, giving a contractor a $5 key means they can spend at most $5 even if the account holds $500.

When a key exhausts its quota its status becomes Exhausted and calls are rejected; edit the key and raise the quota to restore it.

Advanced settings

FieldDescription
Model limitsRestrict the key to the selected models. Leave empty for no restriction
IP whitelistRestrict which IPs may use the key. CIDR notation supported (e.g. 203.0.113.0/24). Empty means unrestricted
Image response formatWhether image endpoints return a URL or base64; see below
Image storage strategyWhether upstream images are archived by the platform; see below

After creation, copy and store the sk- key immediately.

A key carries spending authority over your account. Never commit it to a repository, embed it in frontend code, or paste it into group chats.

If you suspect a leak, delete the key from the list and create a new one — disabling only pauses a key, deleting is what truly revokes it.

Supplier routing

The same model is usually served by several upstream routes. The interface calls these suppliers. Supplier routing decides which route your request takes, which affects price, speed and success rate.

There are two modes.

The platform automatically picks the best available supplier, with a circuit breaker — failing routes are dropped automatically, with no action from you.

You can express a preference:

StrategyBest for
Smart automatic (default)Balances price, speed and success rate. Use this if unsure
Price firstCost-sensitive batch and offline workloads
Speed firstLatency-sensitive interactive use such as live chat
Success rate firstProduction paths where reliability outweighs speed

You can also set ignored suppliers to exclude specific routes while letting the system choose among the rest.

Specify suppliers

Manually define a supplier call order. Requests try each in the order you set.

Combine this with the cross-supplier retry switch: when enabled, if every channel in the current supplier fails, the next supplier in order is tried; when disabled, only the first is used and failure returns an error.

Unless you have a specific routing requirement (for example a compliance rule about which region serves your traffic), keep smart routing. Pinning an order means you take on the availability risk when that route has problems.

Image settings

These two settings only apply to image-generation models.

Image response format:

OptionBehaviour
Follow request or endpoint (default)Determined by your request parameters or the endpoint
Force URLAlways return an image link
Force base64Always return base64, useful where issuing a second HTTP request to fetch the image is awkward

Image storage strategy (available when the format is Force URL):

OptionBehaviour
Default storagePlatform default handling
Store base64 onlyKeep only the base64 data
Store URL and base64Keep both

Raw upstream image URLs typically expire quickly. To retain generated results, store them yourself or see Bring Your Own Storage to archive them automatically to your own object storage.

Managing existing keys

Each row in the key list supports:

  • View usage — cumulative spend and call count for that key;
  • Edit — change any field above (the key value itself never changes);
  • Disable / Enable — pause without altering configuration;
  • Delete — permanent and irreversible.

Select multiple rows to disable or delete in bulk.

Key statuses

StatusMeaningHow to restore
EnabledWorking normally
DisabledManually pausedRe-enable from the list
ExpiredPast its expiration timeEdit and extend, or set to never expire
ExhaustedThe key's own quota is used upEdit and raise the quota, or switch to unlimited

The platform emails you before a key expires (3 days ahead by default). You can turn these notifications off under Profile → Notifications.

Using keys in code

The platform is OpenAI-compatible; most SDKs need only two changes: base_url and api_key.

curl
curl https://<your-site-domain>/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-5.5", "messages": [{"role": "user", "content": "Hello"}]}'
Python (openai SDK)
from openai import OpenAI

client = OpenAI(
    api_key="sk-xxxxxxxx",
    base_url="https://<your-site-domain>/v1",
)

resp = client.chat.completions.create(
    model="gpt-5.5",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
Node.js (openai SDK)
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: process.env.API_KEY,
  baseURL: 'https://<your-site-domain>/v1',
})

const resp = await client.chat.completions.create({
  model: 'gpt-5.5',
  messages: [{ role: 'user', content: 'Hello' }],
})
console.log(resp.choices[0].message.content)

The base URL is simply the site domain you are using — no api. prefix. See the API Reference for full parameters and additional endpoints.

Security practices

  1. One key per purpose — separate keys for production, testing and each colleague. When something goes wrong you can pinpoint and revoke precisely.
  2. Use environment variables — keys should never appear in source code, config files, frontend bundles or screenshots.
  3. Cap external keys — for contractors and trials, turn off unlimited quota and set an amount you can afford to lose.
  4. Lock down IPs where you can — for server-side calls, an IP whitelist is the cheapest protection against leaks.
  5. Review logs regularly — filter usage logs by key; an unusual spike is the earliest signal of a leak.

On this page