Skip to content
Docs menu

keys

Scoped API keys for programmatic access (CLI / MCP / SDK)

6 operations · 14 schemas

GET /v1/keys

List my API keys

listApiKeys · scope session

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

listApiKeys parameters
NameInTypeDescription
limitqueryinteger

default 20 · ≥ 1 · ≤ 100

Page size.

cursorquerystring

length ≤ 512

Opaque cursor from the previous page's next_cursor.

Responses

listApiKeys responses
StatusDescriptionBody
200

Page of API keys.

ApiKeyPage
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json

POST /v1/keys

Create an API key

createApiKey · scope session

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

application/json · required · ApiKeyCreate

createApiKey request body
FieldTypeDescription
namerequiredstring

length 1–128

scopesrequiredarray of ApiKeyScope

items 1–3

daily_gpu_hour_quotanumber | null

> 0 · ≤ 999999.99

expires_atstring (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_toarray of ApiKeyLimit | null

items 1–50

Restrict the key to these repos. Each entry is a repo you can read, as owner/slug, or every repo of one owner, as owner/*. Null or absent means every repo the account can reach. An entry that names nothing you can see answers 422.

agentboolean

default false

Mark the key as one an AI agent holds.

Responses

createApiKey responses
StatusDescriptionBody
201

Key created; key is the only time the secret is shown.

ApiKeyCreated
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json

POST /v1/keys/child

Mint a short-lived child of this key

createChildApiKey · scope key:read

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

application/json · required · ChildApiKeyCreate

createChildApiKey request body
FieldTypeDescription
namerequiredstring

length 1–128

scopesarray of ApiKeyScope

items 1–3

The child's scopes, each one the caller holds. Omitted means the caller's own.

ttl_srequiredinteger

≥ 60 · ≤ 3600

Seconds the child lives.

Responses

createChildApiKey responses
StatusDescriptionBody
201

Child key created; key is the only time the secret is shown.

ApiKeyCreated
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json
429

This person already has five live child keys.

Problemapplication/problem+json

DELETE /v1/keys/{key_id}

Revoke an API key

revokeApiKey · scope session

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

revokeApiKey parameters
NameInTypeDescription
key_idrequiredpathId

API key id (key_...).

Responses

revokeApiKey responses
StatusDescriptionBody
204

Key revoked.

401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json

POST /v1/keys/{key_id}/rotate

Rotate an API key

rotateApiKey · scope session

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

rotateApiKey parameters
NameInTypeDescription
key_idrequiredpathId

API key id (key_...).

Responses

rotateApiKey responses
StatusDescriptionBody
201

The new key; key is the only time its secret is shown.

ApiKeyCreated
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
409

State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

Problemapplication/problem+json

GET /v1/keys/{key_id}/activity

What one API key did

listApiKeyActivity · scope session

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

listApiKeyActivity parameters
NameInTypeDescription
key_idrequiredpathId

API key id (key_...).

limitqueryinteger

default 20 · ≥ 1 · ≤ 100

Page size.

cursorquerystring

length ≤ 512

Opaque cursor from the previous page's next_cursor.

Responses

listApiKeyActivity responses
StatusDescriptionBody
200

The key, its summary and one page of its rows.

ApiKeyActivity
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json

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

object

ApiKeyPage fields
FieldTypeDescription
itemsrequiredarray of ApiKey
next_cursorrequiredstring | null

ApiKeyCreate

object

ApiKeyCreate fields
FieldTypeDescription
namerequiredstring

length 1–128

scopesrequiredarray of ApiKeyScope

items 1–3

daily_gpu_hour_quotanumber | null

> 0 · ≤ 999999.99

expires_atstring (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_toarray of ApiKeyLimit | null

items 1–50

Restrict the key to these repos. Each entry is a repo you can read, as owner/slug, or every repo of one owner, as owner/*. Null or absent means every repo the account can reach. An entry that names nothing you can see answers 422.

agentboolean

default false

Mark the key as one an AI agent holds.

ChildApiKeyCreate

object

A short-lived child of the calling key.

ChildApiKeyCreate fields
FieldTypeDescription
namerequiredstring

length 1–128

scopesarray of ApiKeyScope

items 1–3

The child's scopes, each one the caller holds. Omitted means the caller's own.

ttl_srequiredinteger

≥ 60 · ≤ 3600

Seconds the child lives.

ApiKeyActivity

object

ApiKeyActivity fields
FieldTypeDescription
keyrequiredApiKey
summaryrequiredApiKeyActivitySummary
itemsrequiredarray of Activity
next_cursorrequiredstring | null

ApiKey

object

API key metadata. The secret itself is never returned here.

ApiKey fields
FieldTypeDescription
idrequiredId
namerequiredstring

length 1–128

Human label shown in the settings UI.

key_prefixrequiredstring

length ≤ 32

Display fragment of the key: lucen_sk_ plus the first 8 characters of the secret. It is enough to recognise a key and useless as a credential.

scopesrequiredarray of ApiKeyScope

items 1–3

Scopes as granted (implied lower scopes are not expanded).

daily_gpu_hour_quotanumber | null

> 0 · ≤ 999999.99

Per-key daily GPU-hour cap; null means the account default applies.

last_used_atstring (date-time) | null (date-time)

Last time this key authenticated a request.

revoked_atstring (date-time) | null (date-time)

Set once revoked; a revoked key authenticates nothing.

expires_atrequiredstring (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_torequiredarray 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.

agentrequiredboolean

Marked as a key an AI agent holds. Its rows in the activity feed say agent, and hosted work beyond the free allowance needs a person.

replaced_byrequiredId | null

The key that rotateApiKey made to replace this one. This key then expires within 7 days.

parent_key_idId | null

For a short-lived child (createChildApiKey), the key it was made from. It stops when that key is revoked.

created_atrequiredstring (date-time)

ApiKeyActivitySummary

object

Every row the key wrote, counted. The counts cover the key's whole history, beyond the page.

ApiKeyActivitySummary fields
FieldTypeDescription
totalrequiredinteger

≥ 0

How many activity rows the key wrote.

actionsrequiredarray of object

Rows per action, most frequent first.

actionrequiredstring
countrequiredinteger

≥ 1

first_atrequiredstring (date-time) | null (date-time)

The key's first row. Null when it wrote none.

last_atrequiredstring (date-time) | null (date-time)

The key's latest row. Null when it wrote none.

Activity

object

One audit-log row, as a person reads it.

Activity fields
FieldTypeDescription
idrequiredId
created_atrequiredstring (date-time)
actionrequiredstring

The audit action (resource.verb, the API guide, "Audit trail"), e.g. run.finish.

actorrequiredActivityActor
resourcerequiredActivityResource
summaryrequiredstring

length ≤ 400

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".

outcomestring | null

The state this action left its resource in, when it set one. Null for actions that change no state. Possible values: queued, running, succeeded, failed, canceled, pending, approved, issued, denied, stopped, refused, degraded, recovered, open, closed, active, done, handed_back, budget_exhausted, expired, rejected, revoked. A campaign round's rows carry the round's state: training, scanning, review, confounded, decided, shortlisted.

cost_usdnumber | null

USD the hub recorded for this action, set only where the cost was incurred: run.finish, coach.advice / coach.plan, plan.decision, agent.finish and endpoint.finish. An endpoint's cost is its uptime, on the row that ends it. An endpoint created before 16 October 2026 is billed per session instead. Its endpoint.session_close rows carry the cost, and its endpoint.finish does not. Such a closed session reads its CURRENT cost (the server's last report may re-price it).

pricedboolean | null

Read with cost_usd. False when the hub charged nothing for the action (a self-hosted worker, an unpriced model). A zero cost then means "not charged by the hub". It does not mean "free".

ActivityActor

object

ActivityActor fields
FieldTypeDescription
kindrequiredActivityActorKind
userUserPublic | null

The person the credential belongs to; null for system.

keyActivityActorKey | null

Set when kind is key.

plan_idId | 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 write.

agentActivityAgent | null

planner exactly when plan_id is set. agent when agent_session_id is set, or when the key is marked as an agent's (key.agent). In the first two cases the hub itself knows an agent decided. In the third the key's owner said so when they made it. Everything else a key did is reported as the key, whoever held it.

agent_session_idId | 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

object

ActivityResource fields
FieldTypeDescription
typerequiredActivityResourceType
idrequiredstring

The resource's id (repo_…, run_…, dreq_…, …).

labelrequiredstring

length ≤ 300

A display name: a repo's full name, a plan's task, a device's name, model → device for an approval, template · output repo for a run. Some rows are visible only because the caller took the action. Such a row never names a repo the caller can no longer read.

ownerRepoOwner | null

The resource's owner (user or org), as recorded when the row was written.

parentActivityResourceRef | null

The resource a page is reached through, for resources without a page of their own:

  • an approval request or approval: its device.
  • an endpoint session: its endpoint.
  • a coach session: the run it read.

ActivityActorKind

string

one of person · key · system

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

object

The API key that wrote the row. The fields are enough to recognise the key. They are never enough to use it.

ActivityActorKey fields
FieldTypeDescription
idrequiredId
namerequiredstring
prefixrequiredstring

The key's display prefix (lucen_sk_ + 8 characters), as the key list shows it.

scoperequiredApiKeyScope
revokedrequiredboolean

True once the key has been revoked; the row still says it was used.

agentboolean

True when the key is marked as one an AI agent holds.

ActivityAgent

string

one of planner · agent

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

string

one of repo · run · rollout · advice_session · device · approval_request · approval · endpoint · endpoint_session · plan · api_key · campaign · agent_session · trial · org · user · spend_hold · motion_job

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

object

ActivityResourceRef fields
FieldTypeDescription
typerequiredActivityResourceType
idrequiredstring