Skip to content
Product Docs

API Keys

List Api Keys
client.APIKeys.List(ctx, query) (*PaginatedCursor[APIKey], error)
GET/api/v1/beta/api-keys
Create Api Key
client.APIKeys.New(ctx, body) (*APIKey, error)
POST/api/v1/beta/api-keys
Delete Api Key
client.APIKeys.Delete(ctx, apiKeyID) (*APIKeyDeleteResponse, error)
DELETE/api/v1/beta/api-keys/{api_key_id}
ModelsExpand Collapse
type APIKey struct{…}

Schema for an API Key.

ID string

Unique identifier

formatuuid
RedactedAPIKey string

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

UserID string
CreatedAt TimeOptional

Creation datetime

formatdate-time
ExpiresAt TimeOptional

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

formatdate-time
KeyType APIKeyKeyTypeOptional
One of the following:
const APIKeyKeyTypeAgent APIKeyKeyType = "agent"
const APIKeyKeyTypeUser APIKeyKeyType = "user"
Metadata map[string, any]Optional
Name stringOptional
ProjectID stringOptional
Role APIKeyRoleOptional

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

One of the following:
const APIKeyRoleAdmin APIKeyRole = "admin"
const APIKeyRoleAgentViewer APIKeyRole = "agent_viewer"
const APIKeyRoleViewer APIKeyRole = "viewer"
const APIKeyRoleViewerV2 APIKeyRole = "viewer_v2"
UpdatedAt TimeOptional

Update datetime

formatdate-time