Skip to main content
POST
Create API key

Authorizations

Authorization
string
header
required

API key with the vk_ prefix. Create one from the dashboard.

Body

application/json
name
string
required
email
string | null

Server-injected display email for the authenticated user. Set by the web proxy from the signed-in Clerk session (never trusted from a browser body). Absent for keys minted outside the proxy (SDK, CI). When present, it upserts users.email so /v1/me and the CLI can show the account.

workspace_id
string | null

Workspace the key is scoped to (workspaces design). Stamped by the web proxy from the active Clerk org, or passed explicitly by SDK callers. Absent / equal to the caller's own id => a personal key. Validated server-side at mint: a workspace the caller is not a member of is rejected, so the stamp is a convenience, never an authority.

deployment_id
string | null

Mint a deployment-scoped "model access" key: it authenticates only GET /v1/deployments/{id} and the inference routes under it. Hand this to agent sandboxes and external agent hosts instead of a workspace key. The deployment must belong to the minted workspace.

expires_in_seconds
integer<int64> | null

Optional lifetime in seconds (60 .. 31,536,000). Absent = never expires.

Response

The created key, including the plaintext value returned once

object
string
required
id
string
required
name
string
required
key_prefix
string
required
created_at
string<date-time>
required
kind
string
required

'user' for a full workspace key; 'model_access' for a key bound to one deployment's inference routes (Managed Agents).

key
string
required

Plaintext key returned ONCE on creation. Save it immediately.

last_used_at
string<date-time> | null
deployment_id
string | null

Set on model-access keys: the only deployment this key can call.

expires_at
string<date-time> | null

When the key stops authenticating. Absent = never.