Docs/Keys
API reference

Keys

Create, list and revoke API keys under /v1/account/keys.

API keys are managed in the portal at platform.simular.ai. The endpoints below are what the portal calls. They accept a Firebase session only: an API key cannot manage keys.

Limits

PlanLive keysCreation rate
Free15 per hour
Paid205 per hour

Free accounts must verify a phone number first.

Create a key

Create a keycURL
curl -s "$SAI_API_URL/v1/account/keys" \
  -H "Authorization: Bearer $FIREBASE_ID_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "ci" }'

name is optional, up to 100 characters.

201 Created · API keyJSON
{ "key": "sapi_...", "keyId": "k_8Hq", "name": "ci" }

key is returned once. It is not stored in plaintext and cannot be shown again.

StatusBody
403{ "error": "phone_verification_required", "message": "Verify a phone number before creating an API key on the free plan. If you just verified it, sign in again so your session carries it." }
403An API key was used instead of a Firebase session.
422{ "error": "API key limit reached. Maximum 20 keys per account. Revoke an existing key first." } The free plan says Maximum 1 keys per account.
429{ "error": "Key generation rate limit exceeded. Maximum 5 keys per hour." }

The phone check reads the phone claim on the sign-in token, so the number must be verified before the current sign-in. If you verified it during this session, sign out and back in, then create the key. It is the same verified number the free computer's claim checks.

List keys

List your keyscURL
curl -s "$SAI_API_URL/v1/account/keys" \
  -H "Authorization: Bearer $FIREBASE_ID_TOKEN"
200 OK · API keysJSON
{
  "keys": [
    {
      "keyId": "k_8Hq",
      "name": "ci",
      "last4": "AbCd",
      "createdAt": 1790000000000,
      "lastUsedAt": 1790003600000,
      "monthlySpendCapCents": 5000
    },
    {
      "keyId": "k_2Zp",
      "name": null,
      "last4": null,
      "createdAt": 1789000000000,
      "lastUsedAt": null,
      "monthlySpendCapCents": null
    }
  ]
}

Newest first. Secrets are never listed, and revoked keys are not listed.

FieldMeaning
last4The key's last four characters, to tell keys apart (sapi_…AbCd). null for older keys.
monthlySpendCapCentsThe key's monthly spend limit in US cents, or null when none is set. See Update a key.

Update a key

Rename a key and set its spend limitcURL
curl -s -X PATCH "$SAI_API_URL/v1/account/keys/$KEY_ID" \
  -H "Authorization: Bearer $FIREBASE_ID_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "ci-prod", "monthlySpendCapCents": 5000 }'

Send at least one field; unknown fields are rejected.

  • name: 1 to 100 characters.
  • monthlySpendCapCents: an integer from 1 ($0.01) to 100000000 ($1,000,000), or null to remove the limit. Keys have no limit by default.

The limit counts the key's model and tool spend in each calendar month in UTC and resets at 00:00 UTC on the 1st. Requests already running when the limit is reached can take spend slightly over it.

Spend limits are rolling out. Until they are available on your account, the key list omits monthlySpendCapCents and setting it returns 400.

204 No Content.

StatusBody
400The body is empty, has an unknown field or a bad value.
404{ "error": "API key not found." }

Revoke a key

Revoke a keycURL
curl -s -X DELETE "$SAI_API_URL/v1/account/keys/$KEY_ID" \
  -H "Authorization: Bearer $FIREBASE_ID_TOKEN"

204 No Content. A revoked key fails with 401 on its next use.

StatusBody
404{ "error": "API key not found." }

From the CLI

The sai CLI wraps the same endpoints:

Manage keys with the CLIShell
sai key generate --name ci
sai key list
sai key revoke <keyId>

Note

Free-account keys and the phone_verification_required answer are available from October 1.

© 2026 Simular Inc. All rights reserved.