Skip to navigation

Create a temporary 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.
namestringOptional
Key name.
expiry_datedatetimeOptional

Expiry date (ISO 8601).

max_usageintegerOptionalDefaults to -1

Max usage count. -1 = unlimited.

rate_limitintegerOptional
Calls per minute. Overridden by plan limit.
spending_limitdoubleOptional
Spending limit in USD for gateway usage.
is_testbooleanOptionalDefaults to false

Test key (true) or production key (false).

limit_policieslist of objectsOptional

Caps to create and scope to this key. The response includes each created policy with its id, meter_definition_id, and current_state. Once a block rule's cap is reached, gateway requests with the key get 429.

Response

Created API key.
idstringOptional
API key ID.
namestringOptional
Key name.
prefixstringOptional
Key prefix.
is_testbooleanOptional
Test or production key.
expiry_datedatetimeOptional
Expiry date.
max_usageintegerOptional

Max usage count. -1 = unlimited.

rate_limitdouble or nullOptional
Requests per minute. null uses the organization default.
spending_limitdouble or nullOptional

Spending limit in USD. null when not set.

api_keystringOptional

The API key value. Only returned on creation - store it securely.

key_usageintegerOptional
Number of times this key has been used.
createddatetimeOptional
When the API key was created.
unique_organization_idstring or nullOptional
Owning organization UUID.

Errors

400
Bad Request Error
403
Forbidden Error