API Docs
Get Started

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

  1. Sign in to the console, go to Access → API Keys and click Create key.
  2. Enter a name and, if you like, a spend cap and an expiry (see below).
  3. Click Create, then Copy full key in the dialog and store it — the full key is shown only once.
Key created: copy the full key
public/docs/screenshots/console-key-created.png · 1600×1000

Spend cap and expiry

SettingWhat it doesWhen reached
Spend capThe total amount this key may use over its whole lifetime; empty means no capThe key is disabled; the OpenAI shape returns 402 insufficient_quota, the Anthropic shape 400. Raise the cap in the list to re-enable it
ExpiryWhen the key stops working; empty means neverRequests 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.