Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Keys

Get Api Keys

get

Get all API keys registered to the user

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200

Successful Response

application/json
read_onlybooleanRequired
fidstringRequiredExample: apikey_abc123456
namestringRequired
created_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
expires_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
deactivated_atstring · datetime · nullableOptionalExample: 2024-01-01T00:00:00Z
snippetstringRequiredExample: fkey_abc1...
get/v2/api-keys
GET /v2/api-keys HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
  {
    "read_only": true,
    "fid": "apikey_abc123456",
    "name": "text",
    "created_at": "2024-01-01T00:00:00Z",
    "expires_at": "2024-01-01T00:00:00Z",
    "deactivated_at": "2024-01-01T00:00:00Z",
    "snippet": "fkey_abc1..."
  }
]

Create Api Key

post

Create a new API key

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
namestringRequired
expires_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
read_onlybooleanOptionalDefault: false
Responses
201

Successful Response

application/json
read_onlybooleanRequired
fidstringRequiredExample: apikey_abc123456
namestringRequired
created_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
expires_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
deactivated_atstring · datetime · nullableOptionalExample: 2024-01-01T00:00:00Z
snippetstringRequiredExample: fkey_abc1...
secretstringRequiredExample: fkey_abc123456
post/v2/api-keys
POST /v2/api-keys HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 69

{
  "name": "text",
  "expires_at": "2024-01-01T00:00:00Z",
  "read_only": false
}
{
  "read_only": true,
  "fid": "apikey_abc123456",
  "name": "text",
  "created_at": "2024-01-01T00:00:00Z",
  "expires_at": "2024-01-01T00:00:00Z",
  "deactivated_at": "2024-01-01T00:00:00Z",
  "snippet": "fkey_abc1...",
  "secret": "fkey_abc123456"
}

Revoke Api Key

delete

Revoke an API key

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
key_fidstringRequiredExample: apikey_abc123456
Responses
204

Successful Response

No content

delete/v2/api-keys/{key_fid}
DELETE /v2/api-keys/{key_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Last updated