Skip to main content

Create API Key

Create a new API key for the authenticated user. The key_value will only be returned on creation.

Request Body

object
required
API key object
string
required
Descriptive name for the key
string
required
Type of key: ‘private’ or ‘public’
array
Array of allowed CORS origins
array
Array of assistant IDs the key can access
boolean
default:"false"
Whether the key supports transient assistants

Response

object
Response status information
integer
HTTP status code (201)
string
Status message
object
Created API key object (includes key_value only on creation)
The key_value is only returned when creating a new API key. Store it securely immediately as it cannot be retrieved later.

Error Responses

object
Unauthorized - Invalid or missing authentication
object
Validation error - Invalid request body