keys
Scoped API keys for programmatic access (CLI / MCP / SDK)
GET / v1/ keys
List my API keys
Returns metadata only. Key material is never returned after creation. Revoked keys stay listed with revoked_at set, so audit history keeps resolving. Newest first. A short-lived child key (createChildApiKey) is not listed: it belongs to the key it was made from, lives an hour at most, and the desktop app makes one an hour.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | Page size. |
cursor | query | string | Opaque cursor from the previous page's |
Responses
| Status | Description | Body |
|---|---|---|
200 | Page of API keys. | ApiKeyPage |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
POST / v1/ keys
Create an API key
Mints a scoped programmatic key. The plaintext key (lucen_sk_...) is returned once, in this response. It is never returned again. Only an argon2 hash is stored. Requested scopes must be a subset of what the caller can grant (read ⊂ write ⊂ train). Lower scopes are implied, so the redundant ones may be omitted. When set, daily_gpu_hour_quota caps the GPU hours this key may reserve on priced executors per 24 h. That cap sits inside the account's own RUN_DAILY_GPU_HOUR_QUOTA (createRun).
Three settings make a key safer to hand to an AI agent. expires_at ends the key at that instant. After it the key answers 401 with a problem that says it expired. limited_to restricts the key to some repos. Outside them it gets the answer a stranger gets. It may call the repo operations and getMe. It may run a robot in its list, under an owner it names whole. It may test in sim a policy on a robot, both in its list. Every other operation answers 403 with errors[].type forbidden.key_limits. agent marks a key an AI agent holds. Its rows in the activity feed say so. Hosted work beyond the free allowance answers 403 forbidden.agent_key_spend, because a person starts it.
Request body
| Field | Type | Description |
|---|---|---|
name | string | |
scopes | array of ApiKeyScope | |
daily_gpu_hour_quota | number | null | |
expires_at | string (date-time) | null (date-time) | When the key stops working. It must be in the future. Null or absent means the key does not expire. |
limited_to | array of ApiKeyLimit | null | Restrict the key to these repos. Each entry is a repo you can read, as |
agent | boolean | Mark the key as one an AI agent holds. |
Responses
| Status | Description | Body |
|---|---|---|
201 | Key created; | ApiKeyCreated |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
422 | Request failed validation. | Problem |
POST / v1/ keys/ child
Mint a short-lived child of this key
Mints a key from the API key that calls, for a program that should not hold the long-lived one. The desktop app gives one to the MCP server it starts. The child has the caller's scopes or fewer, its repo limits and its agent mark. It lives at most one hour (ttl_s, 60 to 3600). It stops when its parent is revoked, rotated or expires. A child cannot mint a child, and a session cannot call this: it has no key to derive from. A key with a daily GPU-hour quota cannot mint one either (403): the quota is counted per key, and a child would get a budget of its own. The plaintext is returned once. One person has at most five live child keys at a time. A sixth is 429, with Retry-After until the oldest one expires; revoking a child frees its place.
Request body
| Field | Type | Description |
|---|---|---|
name | string | |
scopes | array of ApiKeyScope | The child's scopes, each one the caller holds. Omitted means the caller's own. |
ttl_s | integer | Seconds the child lives. |
Responses
| Status | Description | Body |
|---|---|---|
201 | Child key created; | ApiKeyCreated |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
422 | Request failed validation. | Problem |
429 | This person already has five live child keys. | Problem |
DELETE / v1/ keys/ {key_id}
Revoke an API key
Revocation takes effect on the next request and cannot be undone. The row is retained (audit rows point at it). It keeps appearing in GET /v1/keys with revoked_at set. The short-lived keys made from it (createChildApiKey) are revoked with it. Idempotent: revoking an already-revoked key is still 204.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
key_id | path | Id | API key id ( |
Responses
POST / v1/ keys/ {key_id}/ rotate
Rotate an API key
Mints a new key with the old key's name, scopes, daily GPU-hour cap, repo limits and agent mark. When the old key expires, the new one gets the same lifetime, counted from now. The plaintext is returned once, as createApiKey returns it.
The old key keeps working for at most 7 more days, so whatever uses it can switch over. Its expires_at becomes the earlier of its own expiry and 7 days from now, and replaced_by names the new key. The short-lived keys made from the old key (createChildApiKey) are revoked now. Revoking it ends it sooner. A key that is revoked, expired or already rotated answers 409. Someone else's key answers 404.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
key_id | path | Id | API key id ( |
Responses
| Status | Description | Body |
|---|---|---|
201 | The new key; | ApiKeyCreated |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
GET / v1/ keys/ {key_id}/ activity
What one API key did
The activity feed rows written with this key, newest first, with the key itself and a summary of every row it wrote. Each row reads as it does in listActivity. The summary counts the actions and names the first and the last. The hub records no IP address, so none is shown. Only the key's owner may read it. Anyone else's key answers 404.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
key_id | path | Id | API key id ( |
limit | query | integer | Page size. |
cursor | query | string | Opaque cursor from the previous page's |
Responses
| Status | Description | Body |
|---|---|---|
200 | The key, its summary and one page of its rows. | ApiKeyActivity |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
Schemas (14)
The schemas these operations reach before any other tag’s do. A type that links elsewhere is rendered on that tag’s page.
ApiKeyPage
| Field | Type | Description |
|---|---|---|
items | array of ApiKey | |
next_cursor | string | null |
ApiKeyCreate
| Field | Type | Description |
|---|---|---|
name | string | |
scopes | array of ApiKeyScope | |
daily_gpu_hour_quota | number | null | |
expires_at | string (date-time) | null (date-time) | When the key stops working. It must be in the future. Null or absent means the key does not expire. |
limited_to | array of ApiKeyLimit | null | Restrict the key to these repos. Each entry is a repo you can read, as |
agent | boolean | Mark the key as one an AI agent holds. |
ChildApiKeyCreate
A short-lived child of the calling key.
| Field | Type | Description |
|---|---|---|
name | string | |
scopes | array of ApiKeyScope | The child's scopes, each one the caller holds. Omitted means the caller's own. |
ttl_s | integer | Seconds the child lives. |
ApiKeyActivity
| Field | Type | Description |
|---|---|---|
key | ApiKey | |
summary | ApiKeyActivitySummary | |
items | array of Activity | |
next_cursor | string | null |
ApiKey
API key metadata. The secret itself is never returned here.
| Field | Type | Description |
|---|---|---|
id | Id | |
name | string | Human label shown in the settings UI. |
key_prefix | string | Display fragment of the key: |
scopes | array of ApiKeyScope | Scopes as granted (implied lower scopes are not expanded). |
daily_gpu_hour_quota | number | null | Per-key daily GPU-hour cap; |
last_used_at | string (date-time) | null (date-time) | Last time this key authenticated a request. |
revoked_at | string (date-time) | null (date-time) | Set once revoked; a revoked key authenticates nothing. |
expires_at | string (date-time) | null (date-time) | When the key stops working. Null means it does not expire. After this instant the key answers 401 with a problem that says it expired. |
limited_to | array of ApiKeyLimit | null | The repos this key may act on, by their current names. Null means every repo the account can reach. An empty list means every repo it named has since been deleted. |
agent | boolean | Marked as a key an AI agent holds. Its rows in the activity feed say |
replaced_by | Id | null | The key that |
parent_key_id | Id | null | For a short-lived child ( |
created_at | string (date-time) |
ApiKeyActivitySummary
Every row the key wrote, counted. The counts cover the key's whole history, beyond the page.
| Field | Type | Description |
|---|---|---|
total | integer | How many activity rows the key wrote. |
actions | array of object | Rows per action, most frequent first. |
action | string | |
count | integer | |
first_at | string (date-time) | null (date-time) | The key's first row. Null when it wrote none. |
last_at | string (date-time) | null (date-time) | The key's latest row. Null when it wrote none. |
Activity
One audit-log row, as a person reads it.
| Field | Type | Description |
|---|---|---|
id | Id | |
created_at | string (date-time) | |
action | string | The audit action ( |
actor | ActivityActor | |
resource | ActivityResource | |
summary | string | One sentence saying who did what to what. It is safe to show verbatim. It names a template, a place and an amount the way the pages do: "MuJoCo PPO", "your own machine", "$3.22". |
outcome | string | null | The state this action left its resource in, when it set one. Null for actions that change no state. Possible values: |
cost_usd | number | null | USD the hub recorded for this action, set only where the cost was incurred: |
priced | boolean | null | Read with |
ActivityActor
| Field | Type | Description |
|---|---|---|
kind | ActivityActorKind | |
user | UserPublic | null | The person the credential belongs to; null for |
key | ActivityActorKey | null | Set when |
plan_id | Id | null | Set when a plan's planner took the action, acting as the credential above. A plan acts as the credential that created it, narrowed to |
agent | ActivityAgent | null |
|
agent_session_id | Id | null | Set when the row was written with a key the hub minted for this agent session. The session acted as the credential above. |
ActivityResource
| Field | Type | Description |
|---|---|---|
type | ActivityResourceType | |
id | string | The resource's id ( |
label | string | A display name: a repo's full name, a plan's task, a device's name, |
owner | RepoOwner | null | The resource's owner (user or org), as recorded when the row was written. |
parent | ActivityResourceRef | null | The resource a page is reached through, for resources without a page of their own:
|
ActivityActorKind
Which credential wrote the row.
person: a signed-in web session.key: an API key (the CLI, an SDK, an MCP server, a runner, a device driver). The hub cannot tell which, and does not guess.system: the hub on its own (the lease sweep, the verify worker, a dispatch, a plan ended by its window or budget).
ActivityActorKey
The API key that wrote the row. The fields are enough to recognise the key. They are never enough to use it.
| Field | Type | Description |
|---|---|---|
id | Id | |
name | string | |
prefix | string | The key's display prefix ( |
scope | ApiKeyScope | |
revoked | boolean | True once the key has been revoked; the row still says it was used. |
agent | boolean | True when the key is marked as one an AI agent holds. |
ActivityAgent
An agent the hub itself knows took an action.
planner: a plan's frontier model decided it.agent: the hub's cloud agent. The hub knows because the row was written with a key it minted for an agent session (agent_session_id).
A request that arrives with any other API key is the key's, whoever or whatever held it.
ActivityResourceType
What a row is about: repo, run, rollout, advice_session, device, approval_request, approval, endpoint, endpoint_session, plan, api_key, campaign, agent_session, trial, org, user, spend_hold or motion_job. advice_session is a coach call. trial is a real-robot trial or its session. org is an organization's profile and memberships. user is a person's own account, such as a change of handle. spend_hold is cloud work an agent's key asked for, held for a person. motion_job is a motion learned from a video.
ActivityResourceRef
| Field | Type | Description |
|---|---|---|
type | ActivityResourceType | |
id | string |