Create an API key
Creates a new standard API key (or another management key). A management endpoint — if you authenticate with a Bearer token, it must be a Management API Key, not a regular sk-bl- key; a logged-in session cookie also works. The key field in the response is the only time the raw key value is ever shown — only its hash is stored afterward, and it cannot be retrieved again.
/api/v1/keysAuthorizations
AuthorizationrequiredAPI key as bearer token in the Authorization header.
Body
namerequiredDisplay name for the key; leading/trailing whitespace is trimmed and the result cannot be empty.
keyTypeKey type, defaults to standard; any value other than "management" is treated as standard.
standardmanagement"standard"limitSpend limit in USD, stored as spendLimitUsd. null or omitted means no limit. When set, limit_reset must also be provided. GET /v1/key reports this same value back as limit.
limit_resetReset period for the spend limit, stored as spendLimitPeriod. Accepts either the OR-compatible aliases (daily/weekly/monthly) or the internal names (day/week/month) — both forms are equivalent.
dailyweeklymonthlydayweekmonth"monthly"expires_atExpiration time for the key, an ISO date string that must be in the future. null or omitted means it never expires.
"2027-01-01T00:00:00Z"organizationIdBinds the key to the given organization instead of the personal account. The caller must pass the authorization check for that organization/team/member scope, or the request returns 400.
teamIdFurther scopes the key to a specific team within the organization. Used together with organizationId.
orgMemberIdFurther scopes the key to a specific member within the organization. Used together with organizationId.