Skip to main content
An Admin key can manage all of your other API keys through the API. Give each app, environment, or customer its own Inference key, cap what each one can spend, track usage per key, and change or revoke keys without opening the dashboard.

Create

Issue a key with a spend cap

Track

See what each key spends

Change

Raise a cap or extend an expiry

Revoke

Shut a key off right away

How it works

Admin keyYour control keyCreates, changes, and revokes keysReads usage and billingStays on your server
Inferencecust:acme$50 / monthPrivate models only
Inferencecust:globex$5 / monthOnly from 11.22.33.0/24
Inferencestaging$10 / dayExpires Jun 30
Admin keys can call every endpoint, including the ones that manage keys and read billing. Inference keys can call models but can’t manage keys or read billing, so they’re the keys you hand out.
Create your first Admin key in the dashboard: follow Generating an API Key and choose Admin as the key type. Keep it in a server-side secret store, never in client code.
The examples on this page read the Admin key from VENICE_ADMIN_KEY:

Create a key

This creates an Inference key for one customer, capped at $50 a month and expiring on June 30, 2027:
Response
data.apiKey is the key’s secret, and this response is the only time you’ll see it. Store it right away. If it’s lost, revoke the key and create a new one. Keep data.id too: every other call on this page uses it.

Key settings

Set these when you create a key, or change them later with PATCH /api_keys. The request body is strict, so an unknown field returns 400. You can create up to 20 keys a minute and keep up to 500 active keys. Contact support if you need more.
Building an agent? A wallet holding staked VVV on Base can mint its own key without a Venice account. See Autonomous Agent API Key Creation.

Track usage

One key

Response (trimmed)
This key has used $12.50 of its $50 for the month. currentPeriodUsage only appears on keys with a USD or DIEM cap, and usage amounts are strings with four decimal places. Responses return consumptionLimits (plural), while requests send consumptionLimit (singular).

Spend per key over time

GET /billing/usage-analytics returns totals per key in byKey and one row per day in byKeyDaily, ready to chart. Pass lookback (7d by default, up to 90d) or a startDate and endDate pair that spans up to 90 days. Results are cached for 10 minutes.
cURL
Response (trimmed)

Every charge, per key

GET /billing/usage-history lists every charge, and each entry carries the apiKeyId it was billed to. Use it to reconcile spend or bill your own customers. Entries come back oldest first. Send nextCursor back as cursor, on its own, until it’s null. Send Accept: text/csv to get CSV instead.
Charges have a negative amount, so the loop subtracts it to get a positive total per key and currency. Entries without an apiKeyId come from the Venice web app, or are account entries such as credit purchases.

Whether a key can spend right now

GET /api_keys/rate_limits works with any key and reports on the key that calls it. accessPermitted says whether the key can spend right now, and balances shows what it has left to spend.
cURL
GET /api_keys/rate_limits/log, with an Admin key, returns your last 50 rate-limit hits, each with its apiKeyId and modelId.

Change limits and settings

Send the key’s id and only the fields you want to change. Everything else stays as it is. This raises the cap to $100 a month:
Send any of these fields instead to make other changes: A new limitPeriod applies right away, so switching to LIFETIME counts all of the key’s past spend against the cap. apiKeyType can’t be changed; create a new key instead.

Revoke or rotate a key

The response is { "success": true }. Revocation is immediate: the key’s next request gets 401 Authentication failed, and the key drops out of GET /api_keys. Its past charges stay in usage history. To rotate a key without downtime:
1

Create the replacement

Create a new key with the same settings and store its secret.
2

Deploy it

Switch your app over to the new secret.
3

Revoke the old key

Once the old key’s lastUsedAt in GET /api_keys stops moving, delete it.

Errors your callers may see

See Error Codes for the full list.

Best practices

  • Keep Admin keys on your server, and hand out only Inference keys.
  • Give every app, environment, and customer its own key, so each one can be tracked and revoked on its own.
  • Put your own identifier in description. Usage analytics labels keys with it.
  • Cap and expire every key you give to someone else, and lock server-to-server keys to your IPs with ipAllowlist.

API reference

Create API Key

All fields accepted on create.

Update API Key

Change limits, expiry, privacy, and IPs.

List API Keys

Every active key with its usage.

Delete API Key

Revoke a key.

Usage Analytics

Spend by key, model, and day.

Usage History

Every charge, with its API key.