Skip to main content

List API Keys

Retrieve a list of API keys belonging to the authenticated user.
curl -X GET "https://api.example.com/api/v1/api_keys" \
  -H "X-API-Key: your-api-key-here"

Response

status
object
Response status information
code
integer
HTTP status code (200)
message
string
Status message
data
array
Array of API key objects
id
integer
API key ID
key_type
string
Type of key: ‘private’ or ‘public’
name
string
Descriptive name for the key
key_value
string
The actual key (only returned on creation)
allowed_origins
array
Array of allowed CORS origins
allowed_assistants
array
Array of assistant IDs the key can access
transient_assistant
boolean
Whether the key supports transient assistants
user_id
integer
Owner user ID
user_email
string
Owner email address
created_at
string
ISO 8601 creation timestamp
updated_at
string
ISO 8601 last update timestamp
{
  "status": {
    "code": 200,
    "message": "Success"
  },
  "data": [
    {
      "id": 1,
      "key_type": "private",
      "name": "Production API Key",
      "key_value": null,
      "allowed_origins": ["https://example.com"],
      "allowed_assistants": ["123", "456"],
      "transient_assistant": false,
      "user_id": 1,
      "user_email": "[email protected]",
      "created_at": "2024-01-10T08:00:00Z",
      "updated_at": "2024-01-10T08:00:00Z"
    }
  ]
}
The key_value field is only returned when creating a new API key. It cannot be retrieved later for security reasons.

Error Responses

401
object
Unauthorized - Invalid or missing authentication