Create a key
Creates an inference key of your own. The answer, 201, carries the key object in data and the key itself in key, which no later answer repeats. OpenRouter's other create fields, such as include_byok_in_limit and workspace_id, are accepted and ignored, except external.api_key, which is a 400: llm.buzz issues its own keys.
curl -X POST https://api.llm.buzz/api/v1/keys \
-H "Authorization: Bearer $LLM_BUZZ_MANAGEMENT_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "CI key",
"limit": 5,
"limit_reset": "monthly"
}'{
"data": {
"hash": "...",
"name": "CI key",
"label": "CI key",
"disabled": false,
"created_at": "...",
"updated_at": null,
"expires_at": null,
"last_used_at": null,
"limit": 5,
"limit_remaining": 5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 0,
"usage_daily": 0,
"usage_weekly": 0,
"usage_monthly": 0,
"byok_usage": 0,
"byok_usage_daily": 0,
"byok_usage_weekly": 0,
"byok_usage_monthly": 0,
"creator_user_id": "...",
"external_user": null,
"workspace_id": "default"
},
"key": "exp_vk_..."
}{
"error": {
"code": 400,
"message": "...",
"metadata": {
"error_type": "invalid_request",
"gateway_code": "invalid_parameter",
"param": "limit"
}
}
}{
"error": {
"code": 401,
"message": "Missing Authentication header",
"metadata": {
"error_type": "authentication",
"gateway_code": "missing_authentication"
}
}
}{
"error": {
"code": 403,
"message": "Only management keys can perform this operation; use a management key, created on the console Keys page",
"metadata": {
"error_type": "permission_denied",
"gateway_code": "management_key_required"
}
}
}Authorization
A management key, created on the console's Keys page, as Authorization: Bearer KEY. The samples read it from $LLM_BUZZ_MANAGEMENT_KEY; an inference key gets 403 management_key_required.
Body application/json
namestringrequired1 to 64 characters.
limitnumberA spending limit in US dollars, at most nine decimal places;
nullfor none.limit_resetstringThe limit's period in UTC, a week starting on Monday;
nullcounts the key's whole life.dailyweeklymonthlyexpires_atstringWhen the key expires: ISO 8601 with seconds and an offset, in the future, such as
2027-12-31T23:59:59Z. Omitted, it never expires.
Response 201
The key object and the key.
Errors
400The body is not JSON (
invalid_json), a field or query value is invalid (invalid_parameter, withmetadata.param), or aPATCHsets no field (invalid_request).401No
Authorizationheader (missing_authentication), or the key is unknown, expired, revoked or disabled (invalid_key).403An inference key called a route that takes a management key. Create one on the console's Keys page.