Skip to main content
POST
Create an API key

Authorizations

Authorization
string
header
required

A management key (created from the organization dashboard or with POST /v3/manage/auth-keys), sent as Authorization: Bearer <management_key>. Inference API keys (sk-eden...) are not accepted on these endpoints.

Body

Settings for a new API key.

name must be unique among the owner's active keys. token_type selects the production (api_token) or sandbox (sandbox_api_token) environment and cannot be changed later. member attributes the key to an organization member so their usage is reported per user; omit it to create a service key attributed to the organization itself.

Spending controls are optional: balance with active_balance caps what the key can spend, expire_time sets a hard expiry (at least one day ahead), and balance_reset_period with balance_reset_amount refills the balance on a schedule. The same rules apply as when creating a key from the dashboard.

name
string
required
Required string length: 1 - 200
token_type
enum<string>
default:api_token
  • api_token - api_token
  • sandbox_api_token - sandbox_api_token
Available options:
api_token,
sandbox_api_token
member
string<email>
Minimum string length: 1
balance
string<decimal>
Pattern: ^-?\d{0,5}(?:\.\d{0,9})?$
expire_time
string<date-time>
active_balance
boolean
default:true
balance_reset_amount
string<decimal>
Pattern: ^-?\d{0,5}(?:\.\d{0,9})?$
balance_reset_period
enum<string>
default:none
  • none - None
  • daily - Daily
  • weekly - Weekly
  • monthly - Monthly
Available options:
none,
daily,
weekly,
monthly

Response

201 - application/json

A freshly created API key. Identical to the key resource plus secret, the full key value. The secret is shown only in this response and cannot be retrieved again; store it securely.

id
string<uuid> | null
required
read-only
name
string
required

The token name

Maximum string length: 200
member
string<email>
required
read-only
masked
string
required
read-only
balance
number<double> | null
required
read-only
Required range: -100000 < x < 100000
revoked
boolean
required
read-only
secret
string
required
read-only
token_type
enum<string>
  • sandbox_api_token - Sandbox
  • api_token - Back
Available options:
sandbox_api_token,
api_token
active_balance
boolean

Weither to use the balance field or not.

expire_time
string<date-time> | null
revoked_at
string<date-time> | null