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
Free accounts must verify a phone number first.
Create a key
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.
{ "key": "sapi_...", "keyId": "k_8Hq", "name": "ci" }key is returned once. It is not stored in plaintext and cannot be shown again.
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
curl -s "$SAI_API_URL/v1/account/keys" \
-H "Authorization: Bearer $FIREBASE_ID_TOKEN"{
"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.
Update a key
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 from1($0.01) to100000000($1,000,000), ornullto 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.
Revoke a key
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.
From the CLI
The sai CLI wraps the same endpoints:
sai key generate --name ci
sai key list
sai key revoke <keyId>Note
Free-account keys and the
phone_verification_requiredanswer are available from October 1.