Skip to Content

Create a new API key

POST

https://novapai.ai/api/v1/keys 

POST

/api/v1/keys

cURL
$curl -X POST https://novapai.ai/api/v1/keys \ >-H "Authorization: Bearer <token>" \ >-H "Content-Type: application/json" \ >-d '\{ >"name": "Analytics Service Key", >"limit": 150, >"limit_reset": "monthly", >"include_byok_in_limit": true, >"expires_at": "2028-06-30T23:59:59Z" >\}'
201 Created
reference-api-keys-create-keys-01.json
{ "data": { "hash": "a3f5c9d8e7b4f2a1c6d8e9f0b7a3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1", "name": "Analytics Service Key", "label": "sk-or-v1-analytics-3f5c9d8e", "disabled": false, "limit": 150, "limit_remaining": 150, "limit_reset": "monthly", "include_byok_in_limit": true, "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, "created_at": "2026-04-01T09:00:00Z", "expires_at": "2028-06-30T23:59:59Z" }, "key": "sk-or-v1-analytics-3f5c9d8e7b4f2a1c6d8e9f0b7a3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1" }

Create a new API key for the authenticated user. Management key  required.

Authentication

Authorization Bearer

API key as bearer token in Authorization header

Request

This endpoint expects an object.

字段类型必填说明
namestring>=1 character Name for the new API key
limitdouble or nullOptional spending limit for the API key in USD
limit_resetenum or nullType of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. Allowed values:daily weekly monthly
include_byok_in_limitbooleanWhether to include BYOK usage in the limit
expires_atdatetime or nullOptional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected

Response

API key created successfully

字段类型必填说明
dataobject-The created API key information
keystring-The actual API key string (only shown once)

Errors

状态码说明
400Bad Request Error
401Unauthorized Error
429Too Many Requests Error
500Internal Server Error