/api/orgs/{org_id}/keysCreate a key with its group, budget and limits
One call creates the key, and optionally a new group (identity) and a new shared budget (budget), and sets its rate limits and IP rules. Give identity_id or identity, not both; neither puts the key in the default group. Give budget_id or budget, not both. The whole body is validated before anything is written; if a later step fails, everything the call created is removed and the key is revoked. The plaintext key is returned only here. Org admin or the provisioning key.
Authentication: Bearer API key in the Authorization header
Path parameters
org_idstringrequiredYour organization id (uuid).
GET /api/whoamireturns it.
Request body
namestringrequired1 to 80 characters after trimming.
provisioningbooleanCreate a provisioning key.
expires_in_daysinteger | nullOmitted, the key never expires.
identity_idstring | nullAn existing active group.
identityobject | nullOne of
object
display_namestringrequiredparent_identity_idstring | nullThe parent group; restrictions only tighten going down.
modelsarray | nullModel slugs or alias ids the group may call. Omitted, the group inherits its parent's models (every model for a top-level group).
budget_idstring | nullAn existing shared budget.
budgetobject | nullOne of
object
namestring | nullDefaults to the key's name.
limit_nano_usdintegerrequiredInteger nano-USD per window.
reset_periodenum
rate_limitsobject | nullOne of
object
requests_per_minuteinteger | nulltokens_per_minuteinteger | nulltokens_per_hourinteger | nulltokens_per_dayinteger | null
ip_rulesobject | nullOne of
object
modeenumrequiredallowserves the key only from these ranges;denynever from them.cidrsarray<string>requiredIPv4 or IPv6 ranges in CIDR notation.
Responses
201The key and its one-time plaintext.
Response
keystringrequiredThe plaintext key, returned only here.
dataobjectrequireddata
idstringrequirednamestringrequiredlabelstringrequiredKey prefix and last characters.
identity_idstring | nullrequiredThe key's group.
budgetobject | nullrequiredThe shared budget the key draws from.
One of
object
budget_idstringrequiredperiodstringrequiredYYYY-MM, or*for recurring.scope_kindenumrequiredkeysis a shared budget;keyis an older per-key budget.api_key_idstring | nullrequiredidentity_idstring | nullrequiredalias_idstring | nullrequiredpool_idstring | nullrequireddeployment_idstring | nullrequiredlimit_nano_usdintegerrequiredThe cap, integer nano-USD. 0 is a hard zero cap.
reserved_nano_usdintegerrequiredIn flight, integer nano-USD.
settled_nano_usdintegerrequiredSpent this month, integer nano-USD.
remaining_nano_usdintegerrequiredInteger nano-USD.
created_by_kindenumrequiredcreated_by_api_key_idstring | nullrequiredThe authoring key, when a key wrote the row.
namestring | nullShared budgets only.
reset_periodenumShared budgets only.
api_key_idsarray | nullShared budgets only: the keys drawing from it.
rate_limitsobject | nullrequiredNull when the key uses its tier's windows.
One of
object
requests_per_minuteinteger | nullrequiredtokens_per_minuteinteger | nullrequiredtokens_per_hourinteger | nullrequiredtokens_per_dayinteger | nullrequired
ip_rulesobject | nullThe key's IP rules; null when it serves from any address.
One of
object
modeenumrequiredallowserves the key only from these ranges;denynever from them.cidrsarray<string>requiredIPv4 or IPv6 ranges in CIDR notation.
legacy_spend_capsarray<object>requiredlegacy_spend_caps
limit_nano_usdintegerrequiredperiodstringrequired
is_provisioningbooleanrequiredexpires_atstring | nullrequiredcreated_atstringrequiredrevoked_atstring | nullrequired
401Missing, unknown or revoked API key.
Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
403Not a provisioning key, or the mint is refused for this group.
Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
404Unknown organization, group, parent group, shared budget or model.
Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
409A disabled group, or a budget name already in use.
Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
422Both of a pair given, a bad name, reset period or IP range, or body validation.
Request
curl -X POST 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/keys' \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "contractor-alice",
"expires_in_days": 90,
"identity": {
"display_name": "Contractors",
"models": [
"claude-sonnet-4.6",
"gpt-6-luna",
"deepseek-v4-flash"
]
},
"budget": {
"name": "Alice",
"limit_nano_usd": 100000000000,
"reset_period": "monthly"
},
"rate_limits": {
"requests_per_minute": 60
},
"ip_rules": {
"mode": "allow",
"cidrs": [
"203.0.113.0/24"
]
}
}'Response
{
"key": "<new-api-key-shown-once>",
"data": {
"id": "11111111-1111-1111-1111-111111111111",
"name": "contractor-alice",
"label": "xpl_live_3b7e…04fc",
"identity_id": "contractors-7c1e40ab",
"budget": {
"budget_id": "c4a2e8f1-7b3d-4e9a-8c15-3f0d6b2a9e71",
"period": "*",
"scope_kind": "keys",
"api_key_id": null,
"identity_id": null,
"alias_id": null,
"pool_id": null,
"deployment_id": null,
"limit_nano_usd": 100000000000,
"reserved_nano_usd": 0,
"settled_nano_usd": 0,
"remaining_nano_usd": 100000000000,
"created_by_kind": "api_key",
"created_by_api_key_id": "6b1d2f4e-3c8a-4f0e-9a21-7e5c0d9b4a33",
"name": "Alice",
"reset_period": "monthly",
"api_key_ids": [
"11111111-1111-1111-1111-111111111111"
]
},
"rate_limits": {
"requests_per_minute": 60,
"tokens_per_minute": null,
"tokens_per_hour": null,
"tokens_per_day": null
},
"ip_rules": {
"mode": "allow",
"cidrs": [
"203.0.113.0/24"
]
},
"legacy_spend_caps": [],
"is_provisioning": false,
"expires_at": "2027-02-20T16:10:03.220Z",
"created_at": "2026-11-22T16:10:03.220Z",
"revoked_at": null
}
}https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/keys