Get an API Key
Create an API key in the console with a spend cap and expiry, the two equivalent authentication headers, and how to store and revoke keys.
Prerequisites
Your account has a balance; see Console & top-up.
Create a key
- Sign in to the console, go to Access → API Keys and click Create key.
- Enter a name and, if you like, a spend cap and an expiry (see below).
- Click Create, then Copy full key in the dialog and store it — the full key is shown only once.
public/docs/screenshots/console-key-created.png · 1600×1000Spend cap and expiry
| Setting | What it does | When reached |
|---|---|---|
| Spend cap | The total amount this key may use over its whole lifetime; empty means no cap | The key is disabled; the OpenAI shape returns 402 insufficient_quota, the Anthropic shape 400. Raise the cap in the list to re-enable it |
| Expiry | When the key stops working; empty means never | Requests return 401 — create a new key |
Spend caps are handy for test environments, contractors or a single app's budget. Request rate and concurrency are counted per account, so more keys don't raise your limits; see Rate limits.
Two authentication headers
All protected /v1 endpoints share the same extraction rule; these two styles are equivalent:
# Style 1: x-api-key (Anthropic convention)
curl https://api.unioapi.com/v1/models -H "x-api-key: $UNIO_API_KEY"
# Style 2: Authorization Bearer (OpenAI convention)
curl https://api.unioapi.com/v1/models -H "Authorization: Bearer $UNIO_API_KEY"When both headers are present, x-api-key wins. See Authentication.
Handling tips
Keys are not stored on the server
Lists and request logs only show the key prefix. If you lose a key, revoke it and create a new one.
- Inject keys via environment variables; never commit them in plain text.
- Split keys by purpose for easier auditing and rotation.
- Revoke leaked or unused keys in the console; revocation takes effect immediately.
5-Minute Quickstart
Make your first model API call with UnioAPI. Create an API key, choose an OpenAI-compatible or Anthropic-compatible endpoint, and run a request example.
Choose a Protocol
Choosing between OpenAI-compatible and Anthropic-compatible, how Chat Completions and Responses differ, and the Responses-only models.