Skip to content
Product Docs

API Keys

List Api Keys
client.apiKeys.list(APIKeyListParams { expand, key_type, name, 3 more } query?, RequestOptionsoptions?): PaginatedCursor<APIKey { id, redacted_api_key, user_id, 8 more } >
GET/api/v1/beta/api-keys
Create Api Key
client.apiKeys.create(APIKeyCreateParams { expires_at, key_type, name, 2 more } body, RequestOptionsoptions?): APIKey { id, redacted_api_key, user_id, 8 more }
POST/api/v1/beta/api-keys
Delete Api Key
client.apiKeys.delete(stringapiKeyID, RequestOptionsoptions?): APIKeyDeleteResponse { cache_ttl_seconds, success }
DELETE/api/v1/beta/api-keys/{api_key_id}
ModelsExpand Collapse
APIKey { id, redacted_api_key, user_id, 8 more }

Schema for an API Key.

id: string

Unique identifier

formatuuid
redacted_api_key: string

The key with its middle masked, except on the create response, which returns the full secret once and never again.

user_id: string
created_at?: string | null

Creation datetime

formatdate-time
expires_at?: string | null

When the API key expires. Null if the key never expires.

formatdate-time
key_type?: "agent" | "user"
One of the following:
"agent"
"user"
metadata?: Record<string, unknown> | null
name?: string | null
project_id?: string | null
role?: "admin" | "agent_viewer" | "viewer" | "viewer_v2" | null

Role capping what this key may do. Null if the key authorizes as its owner.

One of the following:
"admin"
"agent_viewer"
"viewer"
"viewer_v2"
updated_at?: string | null

Update datetime

formatdate-time
APIKeyDeleteResponse { cache_ttl_seconds, success }

Confirmation that a resource was deleted.

cache_ttl_seconds: number

Maximum seconds until cached information expires

minimum0
success: boolean

Whether the resource was deleted