Hadrian is experimental alpha software. Do not use in production.
Hadrian

Me

Self-service endpoints for authenticated users. Export personal data for GDPR compliance.

Delete current user and all associated data (GDPR Article 17 - Right to Erasure)

DELETE
/admin/v1/me
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Response Body

application/json

application/json

application/json

curl -X DELETE "https://loading/admin/v1/me"
{
  "api_keys_deleted": 0,
  "conversations_deleted": 0,
  "deleted": true,
  "dynamic_providers_deleted": 0,
  "usage_records_deleted": 0,
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

List current user's API keys

GET
/admin/v1/me/api-keys
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

limit?integer|null

Maximum number of results to return

Formatint64
cursor?string|null

Cursor for keyset pagination. Encoded as base64 string.

direction?string|null

Pagination direction: "forward" (default) or "backward".

include_deleted?boolean|null

Include soft-deleted records in results

Response Body

application/json

application/json

curl -X GET "https://loading/admin/v1/me/api-keys"
{
  "data": [
    {
      "allowed_models": [
        "string"
      ],
      "budget_limit_cents": 0,
      "budget_period": {},
      "created_at": "2019-08-24T14:15:22Z",
      "expires_at": "2019-08-24T14:15:22Z",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "ip_allowlist": [
        "string"
      ],
      "key_prefix": "string",
      "last_used_at": "2019-08-24T14:15:22Z",
      "name": "string",
      "owner": {
        "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
        "type": "organization"
      },
      "rate_limit_rpm": 0,
      "rate_limit_tpm": 0,
      "revoked_at": "2019-08-24T14:15:22Z",
      "rotated_from_key_id": "4020a89e-8741-4a95-bbec-f0b312e899f2",
      "rotation_grace_until": "2019-08-24T14:15:22Z",
      "scopes": [
        "string"
      ],
      "sovereignty_requirements": {}
    }
  ],
  "pagination": {
    "has_more": true,
    "limit": 100,
    "next_cursor": "MTczMzU4MDgwMDAwMDphYmMxMjM0NS02Nzg5LTAxMjMtNDU2Ny0wMTIzNDU2Nzg5YWI",
    "prev_cursor": "string"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Create an API key for the current user

POST
/admin/v1/me/api-keys
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Request Body

application/json

allowed_models?|null

Allowed models (null = all models)

budget_limit_cents?integer|null

Budget limit in cents

Formatint64
budget_period?null|BudgetPeriod
expires_at?string|null
Formatdate-time
ip_allowlist?|null

IP allowlist in CIDR notation (null = all IPs)

name*string
rate_limit_rpm?integer|null

Requests per minute override

Formatint32
rate_limit_tpm?integer|null

Tokens per minute override

Formatint32
scopes?|null

Permission scopes (null = full access)

sovereignty_requirements?null|

Response Body

application/json

application/json

application/json

curl -X POST "https://loading/admin/v1/me/api-keys" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "allowed_models": [
    "string"
  ],
  "budget_limit_cents": 0,
  "budget_period": {},
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "ip_allowlist": [
    "string"
  ],
  "key_prefix": "string",
  "last_used_at": "2019-08-24T14:15:22Z",
  "name": "string",
  "owner": {
    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
    "type": "organization"
  },
  "rate_limit_rpm": 0,
  "rate_limit_tpm": 0,
  "revoked_at": "2019-08-24T14:15:22Z",
  "rotated_from_key_id": "4020a89e-8741-4a95-bbec-f0b312e899f2",
  "rotation_grace_until": "2019-08-24T14:15:22Z",
  "scopes": [
    "string"
  ],
  "sovereignty_requirements": {},
  "key": "string"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Get an API key by ID (current user only)

GET
/admin/v1/me/api-keys/{key_id}
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

key_id*string

API key ID

Formatuuid

Response Body

application/json

application/json

curl -X GET "https://loading/admin/v1/me/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "allowed_models": [
    "string"
  ],
  "budget_limit_cents": 0,
  "budget_period": {},
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "ip_allowlist": [
    "string"
  ],
  "key_prefix": "string",
  "last_used_at": "2019-08-24T14:15:22Z",
  "name": "string",
  "owner": {
    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
    "type": "organization"
  },
  "rate_limit_rpm": 0,
  "rate_limit_tpm": 0,
  "revoked_at": "2019-08-24T14:15:22Z",
  "rotated_from_key_id": "4020a89e-8741-4a95-bbec-f0b312e899f2",
  "rotation_grace_until": "2019-08-24T14:15:22Z",
  "scopes": [
    "string"
  ],
  "sovereignty_requirements": {}
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Revoke an API key (current user only)

DELETE
/admin/v1/me/api-keys/{key_id}
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

key_id*string

API key ID

Formatuuid

Response Body

application/json

curl -X DELETE "https://loading/admin/v1/me/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Rotate an API key (current user only)

POST
/admin/v1/me/api-keys/{key_id}/rotate
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

key_id*string

API key ID to rotate

Formatuuid

Request Body

application/json

grace_period_seconds?integer|null

Grace period in seconds during which both old and new keys are valid. Default: 86400 (24 hours). Maximum: 604800 (7 days).

Formatint64
Range0 <= value

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://loading/admin/v1/me/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08/rotate" \  -H "Content-Type: application/json" \  -d '{}'
{
  "allowed_models": [
    "string"
  ],
  "budget_limit_cents": 0,
  "budget_period": {},
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "ip_allowlist": [
    "string"
  ],
  "key_prefix": "string",
  "last_used_at": "2019-08-24T14:15:22Z",
  "name": "string",
  "owner": {
    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
    "type": "organization"
  },
  "rate_limit_rpm": 0,
  "rate_limit_tpm": 0,
  "revoked_at": "2019-08-24T14:15:22Z",
  "rotated_from_key_id": "4020a89e-8741-4a95-bbec-f0b312e899f2",
  "rotation_grace_until": "2019-08-24T14:15:22Z",
  "scopes": [
    "string"
  ],
  "sovereignty_requirements": {},
  "key": "string"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

List built-in providers from the gateway configuration

GET
/admin/v1/me/built-in-providers
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Response Body

application/json

curl -X GET "https://loading/admin/v1/me/built-in-providers"
{
  "data": [
    {
      "base_url": "string",
      "name": "string",
      "provider_type": "string"
    }
  ]
}

Export current user's data (GDPR Article 15 - Right of Access)

GET
/admin/v1/me/export
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Response Body

application/json

application/json

application/json

curl -X GET "https://loading/admin/v1/me/export"
{
  "api_keys": [
    {
      "budget_limit_cents": 0,
      "budget_period": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "expires_at": "2019-08-24T14:15:22Z",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "key_prefix": "string",
      "last_used_at": "2019-08-24T14:15:22Z",
      "name": "string",
      "revoked_at": "2019-08-24T14:15:22Z"
    }
  ],
  "audit_logs": [
    {
      "action": "string",
      "actor_id": "04f37679-bfbf-4906-b749-01756515cecf",
      "actor_type": "user",
      "details": null,
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "ip_address": "string",
      "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
      "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
      "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
      "resource_type": "string",
      "timestamp": "2019-08-24T14:15:22Z",
      "user_agent": "string"
    }
  ],
  "conversations": [
    {
      "created_at": "2019-08-24T14:15:22Z",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "messages": [
        {
          "content": "string",
          "role": "string"
        }
      ],
      "models": [
        "string"
      ],
      "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
      "owner_type": "project",
      "pin_order": 0,
      "title": "string",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "exported_at": "2019-08-24T14:15:22Z",
  "memberships": {
    "organizations": [
      {
        "joined_at": "2019-08-24T14:15:22Z",
        "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
        "org_name": "string",
        "org_slug": "string",
        "role": "string",
        "source": "manual"
      }
    ],
    "projects": [
      {
        "joined_at": "2019-08-24T14:15:22Z",
        "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
        "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
        "project_name": "string",
        "project_slug": "string",
        "role": "string",
        "source": "manual"
      }
    ],
    "teams": [
      {
        "joined_at": "2019-08-24T14:15:22Z",
        "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
        "role": "string",
        "source": "manual",
        "team_id": "810007d0-bec5-486c-b5d1-28fcd8a079ba",
        "team_name": "string",
        "team_slug": "string"
      }
    ]
  },
  "sessions": [
    {
      "created_at": "2019-08-24T14:15:22Z",
      "device_description": "string",
      "expires_at": "2019-08-24T14:15:22Z",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "ip_address": "string",
      "last_activity": "2019-08-24T14:15:22Z"
    }
  ],
  "usage_summary": {
    "first_request_at": "2019-08-24T14:15:22Z",
    "last_request_at": "2019-08-24T14:15:22Z",
    "request_count": 0,
    "total_cost_microcents": 0,
    "total_tokens": 0
  },
  "user": {
    "created_at": "2019-08-24T14:15:22Z",
    "email": "string",
    "external_id": "string",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

List current user's dynamic providers

GET
/admin/v1/me/providers
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

limit?integer|null

Maximum number of results to return

Formatint64
cursor?string|null

Cursor for keyset pagination. Encoded as base64 string.

direction?string|null

Pagination direction: "forward" (default) or "backward".

include_deleted?boolean|null

Include soft-deleted records in results

Response Body

application/json

application/json

curl -X GET "https://loading/admin/v1/me/providers"
{
  "data": [
    {
      "base_url": "string",
      "config": null,
      "created_at": "2019-08-24T14:15:22Z",
      "has_api_key": true,
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "is_enabled": true,
      "models": [
        "string"
      ],
      "name": "string",
      "owner": {
        "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
        "type": "organization"
      },
      "provider_type": "string",
      "sovereignty": {},
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "pagination": {
    "has_more": true,
    "limit": 100,
    "next_cursor": "MTczMzU4MDgwMDAwMDphYmMxMjM0NS02Nzg5LTAxMjMtNDU2Ny0wMTIzNDU2Nzg5YWI",
    "prev_cursor": "string"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Create a dynamic provider for the current user

POST
/admin/v1/me/providers
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Request Body

application/json

api_key?string|null

Raw API key (stored in secrets manager if available, otherwise stored directly)

base_url?string

Base URL for the provider (required for OpenAI/Anthropic/Azure, optional for Bedrock/Vertex)

config?unknown

Provider-specific configuration (e.g., region, credentials for Bedrock/Vertex)

models?|null

List of supported model names

name*string
provider_type*string

Provider type (e.g., "openai", "anthropic", "bedrock", "vertex")

sovereignty?null|

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://loading/admin/v1/me/providers" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "provider_type": "string"  }'
{
  "base_url": "string",
  "config": null,
  "created_at": "2019-08-24T14:15:22Z",
  "has_api_key": true,
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "is_enabled": true,
  "models": [
    "string"
  ],
  "name": "string",
  "owner": {
    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
    "type": "organization"
  },
  "provider_type": "string",
  "sovereignty": {},
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Test credentials before creating a provider

POST
/admin/v1/me/providers/test-credentials
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Request Body

application/json

api_key?string|null

Raw API key (stored in secrets manager if available, otherwise stored directly)

base_url?string

Base URL for the provider (required for OpenAI/Anthropic/Azure, optional for Bedrock/Vertex)

config?unknown

Provider-specific configuration (e.g., region, credentials for Bedrock/Vertex)

models?|null

List of supported model names

name*string
provider_type*string

Provider type (e.g., "openai", "anthropic", "bedrock", "vertex")

sovereignty?null|

Response Body

application/json

application/json

curl -X POST "https://loading/admin/v1/me/providers/test-credentials" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "provider_type": "string"  }'
{
  "latency_ms": 0,
  "message": "string",
  "status": "string"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Get a dynamic provider by ID (current user only)

GET
/admin/v1/me/providers/{id}
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

id*string

Dynamic provider ID

Formatuuid

Response Body

application/json

application/json

curl -X GET "https://loading/admin/v1/me/providers/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "base_url": "string",
  "config": null,
  "created_at": "2019-08-24T14:15:22Z",
  "has_api_key": true,
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "is_enabled": true,
  "models": [
    "string"
  ],
  "name": "string",
  "owner": {
    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
    "type": "organization"
  },
  "provider_type": "string",
  "sovereignty": {},
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Update a dynamic provider (current user only)

PATCH
/admin/v1/me/providers/{id}
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

id*string

Dynamic provider ID

Formatuuid

Request Body

application/json

api_key?string|null

Raw API key (stored in secrets manager if available, otherwise stored directly)

base_url?string|null
config?unknown

Provider-specific configuration (e.g., region, credentials for Bedrock/Vertex)

is_enabled?boolean|null
models?|null

List of supported model names

sovereignty?null|

Response Body

application/json

application/json

curl -X PATCH "https://loading/admin/v1/me/providers/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{
  "base_url": "string",
  "config": null,
  "created_at": "2019-08-24T14:15:22Z",
  "has_api_key": true,
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "is_enabled": true,
  "models": [
    "string"
  ],
  "name": "string",
  "owner": {
    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
    "type": "organization"
  },
  "provider_type": "string",
  "sovereignty": {},
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Delete a dynamic provider (current user only)

DELETE
/admin/v1/me/providers/{id}
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

id*string

Dynamic provider ID

Formatuuid

Response Body

application/json

curl -X DELETE "https://loading/admin/v1/me/providers/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Test connectivity for a dynamic provider (current user only)

POST
/admin/v1/me/providers/{id}/test
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

id*string

Dynamic provider ID

Formatuuid

Response Body

application/json

application/json

curl -X POST "https://loading/admin/v1/me/providers/497f6eca-6276-4993-bfeb-53cbbbba6f08/test"
{
  "latency_ms": 0,
  "message": "string",
  "status": "string"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

List current user's active sessions.

GET
/admin/v1/me/sessions
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Response Body

application/json

application/json

curl -X GET "https://loading/admin/v1/me/sessions"
{
  "current_session_id": "d988c88f-5c99-433f-a9ad-20df4ed60745",
  "data": [
    {
      "created_at": "2019-08-24T14:15:22Z",
      "device": {},
      "expires_at": "2019-08-24T14:15:22Z",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "last_activity": "2019-08-24T14:15:22Z"
    }
  ],
  "enhanced_enabled": true
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Revoke a specific session belonging to the current user.

DELETE
/admin/v1/me/sessions/{session_id}
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

session_id*string

Session ID to revoke

Formatuuid

Response Body

application/json

application/json

application/json

curl -X DELETE "https://loading/admin/v1/me/sessions/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "sessions_revoked": 0
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Get current user's usage summary

GET
/admin/v1/me/usage
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

start_date?string|null

Start date (YYYY-MM-DD)

end_date?string|null

End date (YYYY-MM-DD)

Response Body

application/json

application/json

curl -X GET "https://loading/admin/v1/me/usage"
{
  "audio_seconds": 0,
  "character_count": 0,
  "first_request_at": "string",
  "image_count": 0,
  "input_tokens": 0,
  "last_request_at": "string",
  "output_tokens": 0,
  "request_count": 0,
  "total_cost": 0.1,
  "total_tokens": 0
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Get current user's usage by date

GET
/admin/v1/me/usage/by-date
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

start_date?string|null

Start date (YYYY-MM-DD)

end_date?string|null

End date (YYYY-MM-DD)

Response Body

application/json

application/json

curl -X GET "https://loading/admin/v1/me/usage/by-date"
[
  {
    "audio_seconds": 0,
    "character_count": 0,
    "date": "string",
    "image_count": 0,
    "input_tokens": 0,
    "output_tokens": 0,
    "request_count": 0,
    "total_cost": 0.1,
    "total_tokens": 0
  }
]
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Get current user's usage by date and model

GET
/admin/v1/me/usage/by-date-model
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

start_date?string|null

Start date (YYYY-MM-DD)

end_date?string|null

End date (YYYY-MM-DD)

Response Body

application/json

curl -X GET "https://loading/admin/v1/me/usage/by-date-model"
[
  {
    "audio_seconds": 0,
    "character_count": 0,
    "date": "string",
    "image_count": 0,
    "input_tokens": 0,
    "model": "string",
    "output_tokens": 0,
    "request_count": 0,
    "total_cost": 0.1,
    "total_tokens": 0
  }
]

Get current user's usage by date and pricing source

GET
/admin/v1/me/usage/by-date-pricing-source
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

start_date?string|null

Start date (YYYY-MM-DD)

end_date?string|null

End date (YYYY-MM-DD)

Response Body

application/json

curl -X GET "https://loading/admin/v1/me/usage/by-date-pricing-source"
[
  {
    "audio_seconds": 0,
    "character_count": 0,
    "date": "string",
    "image_count": 0,
    "input_tokens": 0,
    "output_tokens": 0,
    "pricing_source": "string",
    "request_count": 0,
    "total_cost": 0.1,
    "total_tokens": 0
  }
]

Get current user's usage by date and provider

GET
/admin/v1/me/usage/by-date-provider
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

start_date?string|null

Start date (YYYY-MM-DD)

end_date?string|null

End date (YYYY-MM-DD)

Response Body

application/json

curl -X GET "https://loading/admin/v1/me/usage/by-date-provider"
[
  {
    "audio_seconds": 0,
    "character_count": 0,
    "date": "string",
    "image_count": 0,
    "input_tokens": 0,
    "output_tokens": 0,
    "provider": "string",
    "request_count": 0,
    "total_cost": 0.1,
    "total_tokens": 0
  }
]

Get current user's usage by model

GET
/admin/v1/me/usage/by-model
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

start_date?string|null

Start date (YYYY-MM-DD)

end_date?string|null

End date (YYYY-MM-DD)

Response Body

application/json

application/json

curl -X GET "https://loading/admin/v1/me/usage/by-model"
[
  {
    "audio_seconds": 0,
    "character_count": 0,
    "image_count": 0,
    "input_tokens": 0,
    "model": "string",
    "output_tokens": 0,
    "request_count": 0,
    "total_cost": 0.1,
    "total_tokens": 0
  }
]
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Get current user's usage by pricing source

GET
/admin/v1/me/usage/by-pricing-source
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

start_date?string|null

Start date (YYYY-MM-DD)

end_date?string|null

End date (YYYY-MM-DD)

Response Body

application/json

curl -X GET "https://loading/admin/v1/me/usage/by-pricing-source"
[
  {
    "audio_seconds": 0,
    "character_count": 0,
    "image_count": 0,
    "input_tokens": 0,
    "output_tokens": 0,
    "pricing_source": "string",
    "request_count": 0,
    "total_cost": 0.1,
    "total_tokens": 0
  }
]

Get current user's usage by provider

GET
/admin/v1/me/usage/by-provider
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

start_date?string|null

Start date (YYYY-MM-DD)

end_date?string|null

End date (YYYY-MM-DD)

Response Body

application/json

application/json

curl -X GET "https://loading/admin/v1/me/usage/by-provider"
[
  {
    "audio_seconds": 0,
    "character_count": 0,
    "image_count": 0,
    "input_tokens": 0,
    "output_tokens": 0,
    "provider": "string",
    "request_count": 0,
    "total_cost": 0.1,
    "total_tokens": 0
  }
]
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

List current user's usage logs

GET
/admin/v1/me/usage/logs
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

org_id?string|null
Formatuuid
user_id?string|null
Formatuuid
project_id?string|null
Formatuuid
team_id?string|null
Formatuuid
api_key_id?string|null
Formatuuid
service_account_id?string|null
Formatuuid
model?string|null
provider?string|null
provider_source?string|null
from?string|null
Formatdate-time
to?string|null
Formatdate-time
limit?integer|null
Formatint64
cursor?string|null
direction?string|null

Response Body

application/json

curl -X GET "https://loading/admin/v1/me/usage/logs"
{
  "data": [
    {
      "api_key_id": "b0dd218e-3bcf-4bdb-a1e3-0689d60a8afd",
      "audio_seconds": 0,
      "cached_tokens": 0,
      "cancelled": true,
      "character_count": 0,
      "cost": 0.1,
      "finish_reason": "string",
      "http_referer": "string",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "image_count": 0,
      "input_tokens": 0,
      "latency_ms": 0,
      "model": "string",
      "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
      "output_tokens": 0,
      "pricing_source": "string",
      "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
      "provider": "string",
      "provider_source": "string",
      "reasoning_tokens": 0,
      "recorded_at": "string",
      "request_id": "string",
      "service_account_id": "81f92c7b-60ae-411e-bc6f-e2dc93db8886",
      "status_code": 0,
      "streamed": true,
      "team_id": "810007d0-bec5-486c-b5d1-28fcd8a079ba",
      "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
    }
  ],
  "pagination": {
    "has_more": true,
    "limit": 100,
    "next_cursor": "MTczMzU4MDgwMDAwMDphYmMxMjM0NS02Nzg5LTAxMjMtNDU2Ny0wMTIzNDU2Nzg5YWI",
    "prev_cursor": "string"
  }
}

Export current user's usage logs

GET
/admin/v1/me/usage/logs/export
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

org_id?string|null
Formatuuid
user_id?string|null
Formatuuid
project_id?string|null
Formatuuid
team_id?string|null
Formatuuid
api_key_id?string|null
Formatuuid
service_account_id?string|null
Formatuuid
model?string|null
provider?string|null
provider_source?string|null
from?string|null
Formatdate-time
to?string|null
Formatdate-time
format?string

Export format for usage logs

Value in"csv" | "jsonl"

Response Body

application/x-ndjson

curl -X GET "https://loading/admin/v1/me/usage/logs/export"
Empty