Create an API key
Create a new API key.
Authentication
AuthorizationBearer
Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.
Request
This endpoint expects an object.
name
Key name.
expiry_date
Expiry date (ISO 8601).
max_usage
Max usage count. -1 = unlimited.
rate_limit
Calls per minute. Overridden by plan limit.
spending_limit
Spending limit in USD for gateway usage.
is_test
Test key (true) or production key (false).
Response
Created API key.
id
API key ID.
name
Key name.
prefix
Key prefix.
is_test
Test or production key.
expiry_date
Expiry date.
max_usage
Max usage count. -1 = unlimited.
rate_limit
Requests per minute. null uses the organization default.
spending_limit
Spending limit in USD.
api_key
The API key value. Only returned on creation - store it securely.
key_usage
Number of times this key has been used.
created
When the API key was created.
unique_organization_id
Owning organization UUID.
Errors
401
Unauthorized Error