Skip to main content

Overview

Creates a new type=user API key in the organization associated with the current management token.

Request Body

Notes

  • Monetary fields are USD-only. CNY inputs are retired and return 400 currency_retired.
  • The full API key value is shown only once in the response.
  • models: [] means the key has no additional model restriction beyond organization policy.
  • limitAmount: 0 creates a key that is valid but cannot spend quota until updated.

Example

Request / Response

Use the interactive OpenAPI panel above for the exact schema and response fields.

Response example

Important fields

string
Full secret API key value. It is returned only once on creation.
string
API key identifier used in follow-up Management API calls.
string
Display name for the API key.
string
Non-secret key prefix for display and support.
string
One of active, inactive, or revoked.
number | null
Spending cap in USD as a JSON number for display. null means unlimited.
string | null
Exact spending cap in USD as a decimal string. null means unlimited.
number
Accumulated usage in USD as a JSON number for display.
string
Exact accumulated usage in USD as a decimal string.
string[]
Per-key model allowlist. Empty array means no additional key-level model restriction.
string | null
ISO timestamp when the key expires, or null for no expiry.
string | null
ISO timestamp for the most recent use, or null when unused.
string
ISO creation timestamp.