Skip to main content
POST
/
v1
/
workspaces
/
{workspace_id}
/
api-keys
Create API key
import requests

url = "https://api.auriko.ai/v1/workspaces/{workspace_id}/api-keys"

payload = {
    "name": "<string>",
    "key_type": "api",
    "scopes": ["<string>"],
    "rate_limit_rpm": 2,
    "expires_at": "2023-11-07T05:31:56Z",
    "budget": {
        "limit_usd": 500000.005,
        "enforce": True,
        "include_byok": True
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "key_prefix": "<string>",
  "scopes": [
    "<string>"
  ],
  "is_active": true,
  "created_at": "2023-11-07T05:31:56Z",
  "api_key": "<string>",
  "rate_limit_rpm": 123,
  "expires_at": "2023-11-07T05:31:56Z",
  "last_used_at": "2023-11-07T05:31:56Z",
  "created_by_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
Requires keys:write scope. No idempotency.
The response includes the raw API key secret once. It can’t be retrieved again.
If you lose the response, list keys, revoke the orphan, and create a replacement.
With an API key, you can only create inference-profile keys. To create management keys, use the dashboard.
All parameters, request/response schemas, and examples are auto-generated from the OpenAPI specification.

Authorizations

Authorization
string
header
required

API key authentication. Keys start with ak_ prefix. Example: Authorization: Bearer ak_live_xxxxxxxxxxxx

Path Parameters

workspace_id
string<uuid>
required

Workspace identifier

Body

application/json
name
string
required

Human-readable name for the key

Required string length: 1 - 255
key_type
enum<string>

Key type — api for inference

Available options:
api
scopes
string[]

Permission scopes to grant

rate_limit_rpm
integer

Per-key rate limit in requests per minute (minimum 1)

Required range: x >= 1
expires_at
string<date-time>

Expiration timestamp

budget
object

Budget configuration for an API key.

Response

Created

Created API key with the full secret value. The api_key field is returned only once and cannot be retrieved again.

id
string<uuid>
required

Unique identifier for the API key

workspace_id
string<uuid>
required

Workspace this key belongs to

name
string
required

Human-readable name for the key

key_prefix
string
required

Key prefix for identification

profile
enum<string>
required

Key profile derived from granted scopes

Available options:
inference,
management,
mixed
scopes
string[]
required

Granted permission scopes

is_active
boolean
required

Whether the key is currently active

created_at
string<date-time>
required

When the key was created

api_key
string
required

The full API key secret. Returned only on creation. Store it securely — it cannot be retrieved again.

rate_limit_rpm
integer | null

Per-key rate limit in requests per minute

expires_at
string<date-time> | null

Expiration timestamp

last_used_at
string<date-time> | null

When the key was last used

created_by_key_id
string<uuid> | null

ID of the API key that created this key

propagation_status
enum<string> | null

Status of edge propagation. Present when KV sync is pending.

Available options:
pending,
null