OneOS Docs
Genesis 0.3.3 Console

API reference

Flocks

Your own machines and cloud instances with a harness installed: enroll nodes, rotate their credentials and read their state.

Operations
36
Base path
https://os.one.ml/api/v1/flocks
Scopes
flocks:read flocks:write
API keys
1 need a signed-in session · 3 refused to API keys · 5 untested · 26 tested with an API key
SDK
genesis.call('flocks_listGrants', …) · helpers under genesis.flocks
CLI
genesis flocks
MCP
36 tools

Operations

OperationEndpointAPI key
List account grantsGET/account-grantsTested with an API key
Revoke an account grantDELETE/account-grants/{grant_id}Tested with an API key
List inference accountsGET/accountsTested with an API key
Add an inference accountPOST/accountsTested with an API key
Get an inference accountGET/accounts/{id}Tested with an API key
Remove an inference accountDELETE/accounts/{id}Tested with an API key
Grant an account to another orgPOST/accounts/{id}/grantsTested with an API key
Sign an account in from one instancePOST/accounts/{id}/login—
Clear an account's recorded identityPOST/accounts/{id}/reset-identityTested with an API key
List the org's Flocks agentsGET/agentsTested with an API key
Create an agent that selects a harness and optionally pins a nodePOST/agentsTested with an API key
Read one Flocks agentGET/agents/{agent_id}Tested with an API key
Delete (archive) a Flocks agentDELETE/agents/{agent_id}—
Start a run of an agentPOST/agents/{agent_id}/runsTested with an API key
Exchange a join token under verified One account org identityPOST/byom/enrollAPI keys refused
List customer hardware belonging to the verified orgGET/byom/nodesTested with an API key
Revoke an org-owned node binding immediatelyDELETE/byom/nodes/{id}API keys refused
Update an org-owned node nickname and labelsPATCH/byom/nodes/{id}Tested with an API key
Read one node's presence and the runs recorded against itGET/byom/nodes/{id}/activityTested with an API key
Record presence using One account auth plus the node-specific bindingPOST/byom/nodes/{id}/heartbeatAPI keys refused
Read server-owned enrollment availability for the verified orgGET/byom/readinessTested with an API key
Create an org-scoped single-use join token (admin required)POST/byom/tokensSigned-in session
List the harnesses each of your nodes reports, with version and readinessGET/harnessesTested with an API key
Accounts bound to an instanceGET/instances/{id}/accountTested with an API key
Sign an instance out of a provider accountPOST/instances/{id}/account/logoutTested with an API key
Switch an instance to an accountPOST/instances/{id}/account/switchTested with an API key
Sign many instances out of a provider accountPOST/instances/account/bulk-logoutTested with an API key
Switch many instances to an accountPOST/instances/account/bulk-switchTested with an API key
Get an account jobGET/jobs/{id}Tested with an API key
Send the pasted sign-in code to a waiting loginPOST/jobs/{id}/login-input—
Activate the exact saved One account node reservation idempotentlyPOST/nodes/{id}/activate—
Prepare a fixed-scope key, persist it, then commit; cancel an uncertain prepare before retryingPOST/nodes/{id}/credential:rotate—
Exchange a one-time Console join for a node-only One account credential; persist it before activationPOST/nodes/enroll—
List inference providersGET/providersTested with an API key
List Flocks agent runs, optionally for one agentGET/runsTested with an API key
Read one Flocks agent runGET/runs/{run_id}Tested with an API key

Account grants

List account grants

GET/v1/flocks/account-grants

flocks:readTested with an API keyflocks_listGrants

Grants you issued or received. Needs flocks:read (flocks:write or flocks:admin also satisfy it).

Parameters

  • directionquery · "issued" | "received"
  • account_idquery · string

Responses

  • 200Success
    Response fields
    • itemsobject[]required
    • items[].[].idstringrequired

      pattern ^iag_[0-9a-f]{32}$

    • items[].[].account_idstringrequired
    • items[].[].owner_orgstringrequired
    • items[].[].grantee_orgstringrequired
    • items[].[].status"active" | "revoked"required
    • items[].[].notestringrequired
    • items[].[].created_bystringrequired
    • items[].[].created_atintegerrequired
    • items[].[].revoked_atinteger | nullrequired
  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/account-grants" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Revoke an account grant

DELETE/v1/flocks/account-grants/{grant_id}

flocks:writeTested with an API keyflocks_revokeGrant

New runs on the account are refused at once, and every grantee instance bound to it is signed out and wiped. Owner only. Needs flocks:admin for org API keys; a signed-in Console session needs flocks:admin or flocks:write.

Parameters

  • grant_idpath · stringrequired

    Grant id (iag_...)

Responses

  • 202Success
    Response fields
    • grantobjectrequired
    • grant.idstringrequired

      pattern ^iag_[0-9a-f]{32}$

    • grant.account_idstringrequired
    • grant.owner_orgstringrequired
    • grant.grantee_orgstringrequired
    • grant.status"active" | "revoked"required
    • grant.notestringrequired
    • grant.created_bystringrequired
    • grant.created_atintegerrequired
    • grant.revoked_atinteger | nullrequired
    • job_idstring | nullrequired

      Null when the grant was already revoked (re-revoking starts no job).

  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 409Conflict (grant_exists, login_not_waiting, generation_conflict and similar)
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl -X DELETE "https://os.one.ml/api/v1/flocks/account-grants/$GRANT_ID" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Accounts

List inference accounts

GET/v1/flocks/accounts

flocks:readTested with an API keyflocks_listAccounts

Accounts your org owns plus accounts granted to it (granted: true). Never returns credentials. Needs flocks:read (flocks:write or flocks:admin also satisfy it).

Parameters

  • limitquery · integer
  • cursorquery · string
  • providerquery · string

Responses

  • 200Success
    Response fields
    • itemsobject[]required
    • items[].[].idstringrequired

      pattern ^ia_[0-9a-f]{32}$

    • items[].[].providerstringrequired
    • items[].[].labelstringrequired
    • items[].[].auth_kind"subscription_oauth" | "api_key"required
    • items[].[].identitystring | nullrequired

      Signed-in identity (for example an email); null until the first login completes.

    • items[].[].status"pending_login" | "active" | "needs_login" | "revoked" | "deleted"required
    • items[].[].owner_orgstringrequired
    • items[].[].grantedbooleanrequired

      True when the account is owned by another org and granted to the caller org.

    • items[].[].created_bystringrequired
    • items[].[].created_atintegerrequired
    • items[].[].updated_atintegerrequired
    • items[].[].bound_instancesinteger

      getAccount only: instances bound to the account across the owner and its grantees. min 0

    • next_cursorstring | nullrequired
  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/accounts" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Add an inference account

POST/v1/flocks/accounts

flocks:writeTested with an API keyflocks_createAccount

Creates an account owned by your org. subscription_oauth accounts start pending_login and are signed in on one instance with loginAccount; api_key accounts are active at once and take only a secret reference. Needs flocks:admin for org API keys; a signed-in Console session needs flocks:admin or flocks:write.

Request body application/json

  • providerstringrequired

    A provider id from listProviders (claude, codex).

  • labelstringrequired

    min length 1 · max length 128

  • auth_kind"subscription_oauth" | "api_key"required
  • api_key_secret_refstring

    api_key accounts only: the name of a key your org already holds in Blinds (NAME or blinds:NAME). Never the key itself. Secret Manager names are refused. max length 256

Responses

  • 201Success
    Response fields
    • idstringrequired

      pattern ^ia_[0-9a-f]{32}$

    • providerstringrequired
    • labelstringrequired
    • auth_kind"subscription_oauth" | "api_key"required
    • identitystring | nullrequired

      Signed-in identity (for example an email); null until the first login completes.

    • status"pending_login" | "active" | "needs_login" | "revoked" | "deleted"required
    • owner_orgstringrequired
    • grantedbooleanrequired

      True when the account is owned by another org and granted to the caller org.

    • created_bystringrequired
    • created_atintegerrequired
    • updated_atintegerrequired
    • bound_instancesinteger

      getAccount only: instances bound to the account across the owner and its grantees. min 0

  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 409Conflict (grant_exists, login_not_waiting, generation_conflict and similar)
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/accounts" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "string",
    "label": "string",
    "auth_kind": "subscription_oauth"
  }'

Get an inference account

GET/v1/flocks/accounts/{id}

flocks:readTested with an API keyflocks_getAccount

The account plus bound_instances, the count of instances bound to it across the owner and its grantees. Needs flocks:read (flocks:write or flocks:admin also satisfy it).

Parameters

  • idpath · stringrequired

    Inference account id (ia_...)

Responses

  • 200Success
    Response fields
    • idstringrequired

      pattern ^ia_[0-9a-f]{32}$

    • providerstringrequired
    • labelstringrequired
    • auth_kind"subscription_oauth" | "api_key"required
    • identitystring | nullrequired

      Signed-in identity (for example an email); null until the first login completes.

    • status"pending_login" | "active" | "needs_login" | "revoked" | "deleted"required
    • owner_orgstringrequired
    • grantedbooleanrequired

      True when the account is owned by another org and granted to the caller org.

    • created_bystringrequired
    • created_atintegerrequired
    • updated_atintegerrequired
    • bound_instancesinteger

      getAccount only: instances bound to the account across the owner and its grantees. min 0

  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/accounts/$ID" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Remove an inference account

DELETE/v1/flocks/accounts/{id}

flocks:writeTested with an API keyflocks_deleteAccount

Logs the account out of every bound instance (owner and grantees), then revokes the credential in custody. Returns the job to follow. Needs flocks:admin for org API keys; a signed-in Console session needs flocks:admin or flocks:write.

Parameters

  • idpath · stringrequired

    Inference account id (ia_...)

Responses

  • 202Success
    Response fields
    • accountobjectrequired
    • account.idstringrequired

      pattern ^ia_[0-9a-f]{32}$

    • account.providerstringrequired
    • account.labelstringrequired
    • account.auth_kind"subscription_oauth" | "api_key"required
    • account.identitystring | nullrequired

      Signed-in identity (for example an email); null until the first login completes.

    • account.status"pending_login" | "active" | "needs_login" | "revoked" | "deleted"required
    • account.owner_orgstringrequired
    • account.grantedbooleanrequired

      True when the account is owned by another org and granted to the caller org.

    • account.created_bystringrequired
    • account.created_atintegerrequired
    • account.updated_atintegerrequired
    • account.bound_instancesinteger

      getAccount only: instances bound to the account across the owner and its grantees. min 0

    • job_idstringrequired
  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 409Conflict (grant_exists, login_not_waiting, generation_conflict and similar)
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl -X DELETE "https://os.one.ml/api/v1/flocks/accounts/$ID" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Grants

Grant an account to another org

POST/v1/flocks/accounts/{id}/grants

flocks:writeTested with an API keyflocks_createGrant

Lets the grantee org bind its own instances to this account. The credential never leaves the owner's custody. Owner only. Needs flocks:admin for org API keys; a signed-in Console session needs flocks:admin or flocks:write.

Parameters

  • idpath · stringrequired

    Inference account id (ia_...)

Request body application/json

  • grantee_org_idstringrequired
  • notestring

    max length 256

Responses

  • 201Success
    Response fields
    • idstringrequired

      pattern ^iag_[0-9a-f]{32}$

    • account_idstringrequired
    • owner_orgstringrequired
    • grantee_orgstringrequired
    • status"active" | "revoked"required
    • notestringrequired
    • created_bystringrequired
    • created_atintegerrequired
    • revoked_atinteger | nullrequired
  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 409Conflict (grant_exists, login_not_waiting, generation_conflict and similar)
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/accounts/$ID/grants" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "grantee_org_id": "string"
  }'

Login

Sign an account in from one instance

POST/v1/flocks/accounts/{id}/login

flocks:writeflocks_loginAccount

Starts a login job on one of your instances. When the device url and code are captured they appear on the job item for the initiator only; poll getAccountJob. Needs flocks:admin for org API keys; a signed-in Console session needs flocks:admin or flocks:write.

Parameters

  • idpath · stringrequired

    Inference account id (ia_...)

Request body application/json

  • instance_idstring (uuid)required

Responses

  • 202Success
    Response fields
    • idstringrequired

      pattern ^job_[0-9a-f]{32}$

    • kind"login" | "switch" | "logout"required
    • state"running" | "succeeded" | "partial" | "failed"required
    • account_idstring | nullrequired
    • providerstringrequired
    • concurrencyintegerrequired
    • forcebooleanrequired
    • totalsobjectrequired
    • totals.queuedintegerrequired
    • totals.dispatchedintegerrequired
    • totals.succeededintegerrequired
    • totals.failedintegerrequired
    • totals.timed_outintegerrequired
    • totals.rolled_backintegerrequired
    • totals.unsupportedintegerrequired
    • itemsobject[]required
    • items[].[].instance_idstring | nullrequired

      Null for an instance of another org (a grantee, on an owner's revoke or delete job); the owner is never told which.

    • items[].[].state"queued" | "dispatched" | "succeeded" | "failed" | "timed_out" | "rolled_back" | "unsupported"required
    • items[].[].previous_account_idstring | nullrequired
    • items[].[].identitystring | nullrequired
    • items[].[].error_codestring | nullrequired

      HARNESS_NOT_ON_NODE, instance_unsupported, account_needs_login, drain_timeout, timed_out, verify_failed, identity_mismatch, grant_revoked, custody_unavailable, node_offline, login_failed, credential_not_found, generation_conflict or provider_unknown.

    • items[].[].loginobject | object

      Login items only. The device url (and code, when the provider shows one) reach the job initiator; everyone else sees {pending:true}. A url with a null code means the sign-in waits for the owner to paste the authorization code: send it with submitAccountLoginInput.

    • items[].[].grantee_instancebooleanrequired

      True when the instance belongs to another org.

    • created_atintegerrequired
    • updated_atintegerrequired
  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 409Conflict (grant_exists, login_not_waiting, generation_conflict and similar)
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/accounts/$ID/login" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_id": "00000000-0000-4000-8000-000000000000"
  }'

Reset identity

Clear an account's recorded identity

POST/v1/flocks/accounts/{id}/reset-identity

flocks:writeTested with an API keyflocks_resetAccountIdentity

Owner only. Clears a wrong identity (the answer shows identity null). The next switch verified on one of the owner's own instances records it again; grantee instances never set it. For api_key accounts the identity is key:<first 8 hex characters of the key's SHA-256>. Needs flocks:admin for org API keys; a signed-in Console session needs flocks:admin or flocks:write.

Parameters

  • idpath · stringrequired

    Inference account id (ia_...)

Responses

  • 200The account with identity null
    Response fields
    • idstringrequired

      pattern ^ia_[0-9a-f]{32}$

    • providerstringrequired
    • labelstringrequired
    • auth_kind"subscription_oauth" | "api_key"required
    • identitystring | nullrequired

      Signed-in identity (for example an email); null until the first login completes.

    • status"pending_login" | "active" | "needs_login" | "revoked" | "deleted"required
    • owner_orgstringrequired
    • grantedbooleanrequired

      True when the account is owned by another org and granted to the caller org.

    • created_bystringrequired
    • created_atintegerrequired
    • updated_atintegerrequired
    • bound_instancesinteger

      getAccount only: instances bound to the account across the owner and its grantees. min 0

  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin; node credentials are refused), or not_account_owner: the account belongs to another org (you hold it by grant)
  • 404Unknown account, or one not owned by or granted to your org
  • 503ACCOUNT_CUSTODY_UNAVAILABLE or inventory unavailable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/accounts/$ID/reset-identity" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Agents

List the org's Flocks agents

GET/v1/flocks/agents

flocks:readTested with an API keyflocks_listAgents

These are harness agents that select one harness and optionally pin a node. They are separate from canonical agents (a_<ULID>), which are executed with executeAgent.

Parameters

  • limitquery · integer

    Page size, 1-100 (default 50)

  • cursorquery · string

    Opaque next_cursor from the previous page

Responses

  • 200One page of agents
    Response fields
    • itemsobject[]required
    • items[].[].idstringrequired
    • items[].[].namestringrequired
    • items[].[].harnessstringrequired
    • items[].[].node_idstring | nullrequired

      Pinned node, if any

    • items[].[].owner_subjectstring

      Present only when the caller owns the agent

    • items[].[].created_atintegerrequired

      Unix seconds

    • items[].[].updated_atintegerrequired

      Unix seconds

    • next_cursorstring | nullrequired
  • 400Invalid request, malformed cursor or unknown query parameter
  • 401Invalid One account credential
  • 403Insufficient permission; node credentials cannot read or manage agents
  • 429Too many list requests; retry after retry_after_seconds
  • 503Inventory unavailable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/agents" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Create an agent that selects a harness and optionally pins a node

POST/v1/flocks/agents

flocks:writeTested with an API keyflocks_createAgent

Request body application/json

  • namestringrequired

    Printable label min length 1 · max length 128

  • harness"claude" | "codex" | "gemini" | "droid" | "crush" | "opencode" | "forgecode" | "generic"required
  • node_idstring

    Pin the agent to one of your nodes; that node must be online and report the harness ready min length 1 · max length 128 · pattern ^[A-Za-z0-9._:-]+$

Responses

  • 201The created agent
    Response fields
    • idstringrequired
    • namestringrequired
    • harnessstringrequired
    • node_idstring | nullrequired

      Pinned node, if any

    • owner_subjectstring

      Present only when the caller owns the agent

    • created_atintegerrequired

      Unix seconds

    • updated_atintegerrequired

      Unix seconds

  • 400Invalid body or unknown harness (HARNESS_UNKNOWN)
  • 401Invalid One account credential
  • 403Insufficient permission; node credentials cannot read or manage agents
  • 404Unknown or foreign node
  • 409The pinned node is offline or does not report the harness ready (HARNESS_NOT_ON_NODE)
  • 503Inventory unavailable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/agents" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "harness": "claude"
  }'

Read one Flocks agent

GET/v1/flocks/agents/{agent_id}

flocks:readTested with an API keyflocks_getAgent

Parameters

  • agent_idpath · stringrequired

Responses

  • 200The agent
    Response fields
    • idstringrequired
    • namestringrequired
    • harnessstringrequired
    • node_idstring | nullrequired

      Pinned node, if any

    • owner_subjectstring

      Present only when the caller owns the agent

    • created_atintegerrequired

      Unix seconds

    • updated_atintegerrequired

      Unix seconds

  • 401Invalid One account credential
  • 403Insufficient permission; node credentials cannot read or manage agents
  • 404Unknown agent in the verified org
  • 503Inventory unavailable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/agents/$AGENT_ID" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Delete (archive) a Flocks agent

DELETE/v1/flocks/agents/{agent_id}

flocks:writeflocks_deleteAgent

Needs flocks:write (or flocks:admin), as creating an agent does. Soft-deletes the agent in the verified org and environment: its runs are kept as history, and it leaves listAgents and getAgent. A repeat by the owning org in the same environment answers the same 200. Another org's or environment's agent and an unknown id are 404 agent_not_found. Refused with 409 agent_has_active_runs while a run is pending or running (nothing is cancelled).

Parameters

  • agent_idpath · stringrequired

Responses

  • 200Deleted (or already deleted by the owner)
    Response fields
    • idstringrequired
    • deletedtruerequired
    • archivedtruerequired
  • 401Invalid One account credential
  • 403Insufficient permission
  • 404Unknown agent in the verified org and environment
  • 409agent_has_active_runs
  • 503Inventory unavailable
  • 4xx 5xxThe error envelope.
curl -X DELETE "https://os.one.ml/api/v1/flocks/agents/$AGENT_ID" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Runs

Start a run of an agent

POST/v1/flocks/agents/{agent_id}/runs

flocks:writeTested with an API keyflocks_createRun

Runs the agent's harness on its pinned node, the node_id you give, or the first online node reporting the harness ready. On an instance with a bound inference account the run is recorded pending, dispatched with the instance's next heartbeat and answers 202 with the Run (inference_account_id, account_owner_org and grantee_org say which account and orgs it is metered to). Without a bound account, or with no node named and no online node reporting the harness ready, nothing is started: the answer is 503 HARNESS_CREDENTIALS_UNAVAILABLE and the body carries the failed run, which is recorded. Needs flocks:write (flocks:admin also passes).

Parameters

  • agent_idpath · stringrequired

    Agent id

Request body application/json

  • taskstringrequired

    1-4096 bytes of printable text (newline, carriage return and tab allowed) min length 1 · max length 4096

  • node_idstring

    Run on this node instead of the agent's pinned node, for this run only. It must be online and report the harness ready. min length 1 · max length 128 · pattern ^[A-Za-z0-9._:-]+$

Responses

  • 202The pending run
    Response fields
    • idstringrequired
    • agent_idstringrequired
    • harnessstringrequired
    • node_idstring | nullrequired
    • taskstringrequired
    • state"pending" | "running" | "completed" | "failed"required
    • error_codestring | nullrequired

      Stable code when state is failed

    • owner_subjectstring

      Present only when the caller owns the run

    • created_atintegerrequired

      Unix seconds

    • updated_atintegerrequired

      Unix seconds

    • inference_account_idstring | nullrequired

      Inference account the run executed under (runs on instances with a bound account).

    • account_owner_orgstring | nullrequired

      Org that owns that account.

    • grantee_orgstring | nullrequired

      Org the run was billed to (the instance org).

    • run_secondsinteger | nullrequired

      Wall-clock seconds the harness ran, once finished.

  • 400Invalid body, task or node_id
  • 401Invalid One account credential
  • 403Insufficient permission; node credentials cannot start runs
  • 404Unknown agent or node
  • 409grant_revoked or account_needs_login (the bound account cannot run), or HARNESS_NOT_ON_NODE (the node you named or pinned is offline or does not report the harness ready; nothing is recorded)
  • 503HARNESS_CREDENTIALS_UNAVAILABLE: the instance has no bound account, or no node was named and no online node reports the harness ready (reason no_ready_node, run node_id null), so nothing was started; the body carries the failed run. Also inventory unavailable (then without run).
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/agents/$AGENT_ID/runs" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "task": "string"
  }'

List Flocks agent runs, optionally for one agent

GET/v1/flocks/runs

flocks:readTested with an API keyflocks_listRuns

Runs are recorded by the agent run endpoint, which does not start processes yet (credential lease issuance is absent), so recorded runs are failed with HARNESS_CREDENTIALS_UNAVAILABLE. Canonical executions (executeAgent) are not runs here.

Parameters

  • limitquery · integer

    Page size, 1-100 (default 50)

  • cursorquery · string

    Opaque next_cursor from the previous page

  • agent_idquery · string

    Only runs of this agent

Responses

  • 200One page of runs
    Response fields
    • itemsobject[]required
    • items[].[].idstringrequired
    • items[].[].agent_idstringrequired
    • items[].[].harnessstringrequired
    • items[].[].node_idstring | nullrequired
    • items[].[].taskstringrequired
    • items[].[].state"pending" | "running" | "completed" | "failed"required
    • items[].[].error_codestring | nullrequired

      Stable code when state is failed

    • items[].[].owner_subjectstring

      Present only when the caller owns the run

    • items[].[].created_atintegerrequired

      Unix seconds

    • items[].[].updated_atintegerrequired

      Unix seconds

    • items[].[].inference_account_idstring | nullrequired

      Inference account the run executed under (runs on instances with a bound account).

    • items[].[].account_owner_orgstring | nullrequired

      Org that owns that account.

    • items[].[].grantee_orgstring | nullrequired

      Org the run was billed to (the instance org).

    • items[].[].run_secondsinteger | nullrequired

      Wall-clock seconds the harness ran, once finished.

    • next_cursorstring | nullrequired
  • 400Invalid request, malformed cursor or unknown query parameter
  • 401Invalid One account credential
  • 403Insufficient permission; node credentials cannot read or manage agents
  • 429Too many list requests; retry after retry_after_seconds
  • 503Inventory unavailable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/runs" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Read one Flocks agent run

GET/v1/flocks/runs/{run_id}

flocks:readTested with an API keyflocks_getRun

Parameters

  • run_idpath · stringrequired

Responses

  • 200The run
    Response fields
    • idstringrequired
    • agent_idstringrequired
    • harnessstringrequired
    • node_idstring | nullrequired
    • taskstringrequired
    • state"pending" | "running" | "completed" | "failed"required
    • error_codestring | nullrequired

      Stable code when state is failed

    • owner_subjectstring

      Present only when the caller owns the run

    • created_atintegerrequired

      Unix seconds

    • updated_atintegerrequired

      Unix seconds

    • inference_account_idstring | nullrequired

      Inference account the run executed under (runs on instances with a bound account).

    • account_owner_orgstring | nullrequired

      Org that owns that account.

    • grantee_orgstring | nullrequired

      Org the run was billed to (the instance org).

    • run_secondsinteger | nullrequired

      Wall-clock seconds the harness ran, once finished.

  • 401Invalid One account credential
  • 403Insufficient permission; node credentials cannot read or manage agents
  • 404Unknown run in the verified org
  • 503Inventory unavailable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/runs/$RUN_ID" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Byom

Exchange a join token under verified One account org identity

POST/v1/flocks/byom/enroll

flocks:writeAPI keys refusedflocks_enrollNode

Request body application/json

  • tokenstringrequired

    max length 256

  • namestringrequired

    max length 128

  • platformstringrequired

    max length 128

  • cpu_countintegerrequired

    min 1 · max 65536

Responses

  • 200Success
    Response fields
    • nodeobjectrequired
    • node.idstringrequired
    • node.namestringrequired
    • node.nicknamestringrequired
    • node.platformstringrequired
    • node.cpu_countintegerrequired

      min 1

    • node.state"enrolled" | "revoked"required
    • node.last_seen_atintegerrequired
    • node.enrolled_atintegerrequired
    • node.labelsobject

      Free-form labels; the key flock groups instances.

    • node.accountsobject[]

      Inference accounts the instance last reported.

    • node.accounts[].[].providerstringrequired
    • node.accounts[].[].account_idstring | nullrequired
    • node.accounts[].[].identitystring | nullrequired
    • node.accounts[].[].auth_state"authenticated" | "unauthenticated" | "unknown" | "switching"required
    • node.accounts[].[].generationintegerrequired

      Credential generation the instance holds (0 when none). min 0

    • node.accounts_supportedboolean

      True when the instance reported a seal key and can hold inference accounts.

    • node_bindingstringrequired
    • heartbeat_interval_secondsintegerrequired
  • 401Invalid One account credential or node binding
  • 403Insufficient permission
  • 404Unknown resource in verified org
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/byom/enroll" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "string",
    "name": "string",
    "platform": "string",
    "cpu_count": 1
  }'

List customer hardware belonging to the verified org

GET/v1/flocks/byom/nodes

flocks:readTested with an API keyflocks_listNodes

Responses

  • 200Success
    Response fields
    • idstringrequired
    • namestringrequired
    • nicknamestringrequired
    • platformstringrequired
    • cpu_countintegerrequired

      min 1

    • state"enrolled" | "revoked"required
    • last_seen_atintegerrequired
    • enrolled_atintegerrequired
    • labelsobject

      Free-form labels; the key flock groups instances.

    • accountsobject[]

      Inference accounts the instance last reported.

    • accounts[].[].providerstringrequired
    • accounts[].[].account_idstring | nullrequired
    • accounts[].[].identitystring | nullrequired
    • accounts[].[].auth_state"authenticated" | "unauthenticated" | "unknown" | "switching"required
    • accounts[].[].generationintegerrequired

      Credential generation the instance holds (0 when none). min 0

    • accounts_supportedboolean

      True when the instance reported a seal key and can hold inference accounts.

  • 401Invalid One account credential or node binding
  • 403Insufficient permission
  • 404Unknown resource in verified org
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/byom/nodes" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Revoke an org-owned node binding immediately

DELETE/v1/flocks/byom/nodes/{id}

flocks:writeAPI keys refusedflocks_revokeNode

Parameters

  • idpath · stringrequired

Responses

  • 200Success
    Response fields
    • idstringrequired
    • namestringrequired
    • nicknamestringrequired
    • platformstringrequired
    • cpu_countintegerrequired

      min 1

    • state"enrolled" | "revoked"required
    • last_seen_atintegerrequired
    • enrolled_atintegerrequired
    • labelsobject

      Free-form labels; the key flock groups instances.

    • accountsobject[]

      Inference accounts the instance last reported.

    • accounts[].[].providerstringrequired
    • accounts[].[].account_idstring | nullrequired
    • accounts[].[].identitystring | nullrequired
    • accounts[].[].auth_state"authenticated" | "unauthenticated" | "unknown" | "switching"required
    • accounts[].[].generationintegerrequired

      Credential generation the instance holds (0 when none). min 0

    • accounts_supportedboolean

      True when the instance reported a seal key and can hold inference accounts.

  • 401Invalid One account credential or node binding
  • 403Insufficient permission
  • 404Unknown resource in verified org
  • 4xx 5xxThe error envelope.
curl -X DELETE "https://os.one.ml/api/v1/flocks/byom/nodes/$ID" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Update an org-owned node nickname and labels

PATCH/v1/flocks/byom/nodes/{id}

flocks:writeTested with an API keyflocks_renameNode

Parameters

  • idpath · stringrequired

Request body application/json

  • nicknamestring

    max length 128

  • labelsobject

    Up to 32 labels; keys [a-z0-9._/-]{1,63}, values up to 128 printable characters.

Responses

  • 200Success
    Response fields
    • idstringrequired
    • namestringrequired
    • nicknamestringrequired
    • platformstringrequired
    • cpu_countintegerrequired

      min 1

    • state"enrolled" | "revoked"required
    • last_seen_atintegerrequired
    • enrolled_atintegerrequired
    • labelsobject

      Free-form labels; the key flock groups instances.

    • accountsobject[]

      Inference accounts the instance last reported.

    • accounts[].[].providerstringrequired
    • accounts[].[].account_idstring | nullrequired
    • accounts[].[].identitystring | nullrequired
    • accounts[].[].auth_state"authenticated" | "unauthenticated" | "unknown" | "switching"required
    • accounts[].[].generationintegerrequired

      Credential generation the instance holds (0 when none). min 0

    • accounts_supportedboolean

      True when the instance reported a seal key and can hold inference accounts.

  • 401Invalid One account credential or node binding
  • 403Insufficient permission
  • 404Unknown resource in verified org
  • 4xx 5xxThe error envelope.
curl -X PATCH "https://os.one.ml/api/v1/flocks/byom/nodes/$ID" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Read one node's presence and the runs recorded against it

GET/v1/flocks/byom/nodes/{id}/activity

flocks:readTested with an API keyflocks_getNodeActivity

The node as the Flocks gateway last saw it (online, heartbeat age, harness report) plus one page of the runs recorded on that node, newest first (node_activity in flocks crates/flocks-cli/src/cmd/gateway/harness_api.rs). Needs flocks:read, flocks:write or flocks:admin; node credentials are refused. Paging follows listRuns: limit 1-100 (default 50), opaque cursor, next_cursor null on the last page; agent_id is not a filter here and any other query parameter answers 400. owner_subject appears only on runs you started. Shares the list rate limit with listHarnesses, listAgents and listRuns.

Parameters

  • idpath · stringrequired

    Node id (UUID) from listNodes

  • limitquery · integer

    Runs per page, 1-100 (default 50)

  • cursorquery · string

    Opaque next_cursor from the previous page

Responses

  • 200The node's presence and one page of its runs
    Response fields
    • nodeobjectrequired

      One node as the gateway last saw it.

    • node.node_idstringrequired
    • node.namestringrequired
    • node.nicknamestringrequired
    • node.platformstringrequired
    • node.cpu_countintegerrequired

      min 1

    • node.statestringrequired

      enrolled or revoked

    • node.onlinebooleanrequired

      Enrolled and a heartbeat under 90 seconds old

    • node.enrolled_atintegerrequired

      Unix seconds

    • node.last_seen_atintegerrequired

      Unix seconds of the last accepted heartbeat

    • node.heartbeat_age_secondsintegerrequired

      Seconds since the last accepted heartbeat min 0

    • node.harnessesobject[]required
    • node.harnesses[].[].namestringrequired
    • node.harnesses[].[].versionstring | null

      Version the CLI printed, when the probe succeeded

    • node.harnesses[].[].readybooleanrequired

      The CLI binary was found and answered the probe

    • itemsobject[]required

      Runs recorded against the node, newest first

    • items[].[].idstringrequired
    • items[].[].agent_idstringrequired
    • items[].[].harnessstringrequired
    • items[].[].node_idstring | nullrequired
    • items[].[].taskstringrequired
    • items[].[].state"pending" | "running" | "completed" | "failed"required
    • items[].[].error_codestring | nullrequired

      Stable code when state is failed

    • items[].[].owner_subjectstring

      Present only when the caller owns the run

    • items[].[].created_atintegerrequired

      Unix seconds

    • items[].[].updated_atintegerrequired

      Unix seconds

    • items[].[].inference_account_idstring | nullrequired

      Inference account the run executed under (runs on instances with a bound account).

    • items[].[].account_owner_orgstring | nullrequired

      Org that owns that account.

    • items[].[].grantee_orgstring | nullrequired

      Org the run was billed to (the instance org).

    • items[].[].run_secondsinteger | nullrequired

      Wall-clock seconds the harness ran, once finished.

    • next_cursorstring | nullrequired
  • 400Invalid request, malformed cursor or unknown query parameter (invalid_request)
  • 401Invalid One account credential
  • 403Insufficient permission; node credentials cannot read node activity
  • 404node_not_found: unknown node, or one your org does not own
  • 429Too many list requests; retry after retry_after_seconds
  • 503Inventory unavailable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/byom/nodes/$ID/activity" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Record presence using One account auth plus the node-specific binding

POST/v1/flocks/byom/nodes/{id}/heartbeat

flocks:writeAPI keys refusedflocks_heartbeatNode

Parameters

  • idpath · stringrequired

Request body application/json

  • node_bindingstringrequired

    min length 64 · max length 64

Responses

  • 200Success
    Response fields
    • acceptedbooleanrequired
  • 401Invalid One account credential or node binding
  • 403Insufficient permission
  • 404Unknown resource in verified org
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/byom/nodes/$ID/heartbeat" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "node_binding": "string"
  }'

Read server-owned enrollment availability for the verified org

GET/v1/flocks/byom/readiness

flocks:readTested with an API keyflocks_getEnrollmentReadiness

Responses

  • 200Enrollment readiness
    Response fields
    • node_enrollment_availablebooleanrequired

      True only when the service can complete the scoped One account node credential flow.

    • reason_code"node_credential_issuer_unavailable"

      Present while a supported scoped node credential issuer is unavailable.

  • 401Invalid One account credential
  • 403Insufficient permission
  • 503The configured durable inventory store is unavailable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/byom/readiness" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Create an org-scoped single-use join token (admin required)

POST/v1/flocks/byom/tokens

flocks:writeSigned-in sessionflocks_createJoinToken

Request body application/json

  • ttl_secondsinteger

    min 60 · max 600 · default 600

Responses

  • 200Success
    Response fields
    • tokenstringrequired
    • expires_atintegerrequired
  • 401Invalid One account credential or node binding
  • 403Insufficient permission
  • 404Unknown resource in verified org
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/byom/tokens" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Harnesses

List the harnesses each of your nodes reports, with version and readiness

GET/v1/flocks/harnesses

flocks:readTested with an API keyflocks_listHarnesses

Pages the nodes of the verified org with the harnesses each reported in its last heartbeat. known_harnesses names every harness Flocks can drive. The backend serves the same listing at /v1/byom/harnesses.

Parameters

  • limitquery · integer

    Page size, 1-100 (default 50)

  • cursorquery · string

    Opaque next_cursor from the previous page

Responses

  • 200One page of nodes with their harnesses
    Response fields
    • known_harnessesstring[]required
    • itemsobject[]required
    • items[].[].node_idstringrequired
    • items[].[].namestringrequired
    • items[].[].nicknamestringrequired
    • items[].[].statestringrequired
    • items[].[].onlinebooleanrequired
    • items[].[].last_seen_atintegerrequired
    • items[].[].harnessesobject[]required
    • items[].[].harnesses[].[].namestringrequired
    • items[].[].harnesses[].[].versionstring | null

      Version the CLI printed, when the probe succeeded

    • items[].[].harnesses[].[].readybooleanrequired

      The CLI binary was found and answered the probe

    • next_cursorstring | nullrequired
  • 400Invalid request, malformed cursor or unknown query parameter
  • 401Invalid One account credential
  • 403Insufficient permission; node credentials cannot read or manage agents
  • 429Too many list requests; retry after retry_after_seconds
  • 503Inventory unavailable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/harnesses" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Account

Accounts bound to an instance

GET/v1/flocks/instances/{id}/account

flocks:readTested with an API keyflocks_getInstanceAccount

Per provider: the bound account, its identity, auth state and binding state. Needs flocks:read (flocks:write or flocks:admin also satisfy it).

Parameters

  • idpath · stringrequired

    Instance (node) id

Responses

  • 200Success
    Response fields
    • instance_idstringrequired
    • accountsobject[]required
    • accounts[].[].providerstringrequired
    • accounts[].[].account_idstring | nullrequired
    • accounts[].[].identitystring | nullrequired
    • accounts[].[].auth_state"authenticated" | "unauthenticated" | "unknown" | "switching"required
    • accounts[].[].binding_state"unbound" | "switching" | "active" | "failed" | "logged_out"required
    • accounts[].[].desired_account_idstring | nullrequired
    • accounts[].[].updated_atintegerrequired
  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/instances/$ID/account" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Sign an instance out of a provider account

POST/v1/flocks/instances/{id}/account/logout

flocks:writeTested with an API keyflocks_logoutInstanceAccount

Drains, deletes the account files and clears the binding. The provider's own logout is never run, so other instances sharing the login are unaffected. Needs flocks:admin for org API keys; a signed-in Console session needs flocks:admin or flocks:write.

Parameters

  • idpath · stringrequired

    Instance (node) id

Request body application/json

  • providerstringrequired
  • forceboolean

    Cancel in-flight runs instead of waiting for them to finish. default false

Responses

  • 202Success
    Response fields
    • idstringrequired

      pattern ^job_[0-9a-f]{32}$

    • kind"login" | "switch" | "logout"required
    • state"running" | "succeeded" | "partial" | "failed"required
    • account_idstring | nullrequired
    • providerstringrequired
    • concurrencyintegerrequired
    • forcebooleanrequired
    • totalsobjectrequired
    • totals.queuedintegerrequired
    • totals.dispatchedintegerrequired
    • totals.succeededintegerrequired
    • totals.failedintegerrequired
    • totals.timed_outintegerrequired
    • totals.rolled_backintegerrequired
    • totals.unsupportedintegerrequired
    • itemsobject[]required
    • items[].[].instance_idstring | nullrequired

      Null for an instance of another org (a grantee, on an owner's revoke or delete job); the owner is never told which.

    • items[].[].state"queued" | "dispatched" | "succeeded" | "failed" | "timed_out" | "rolled_back" | "unsupported"required
    • items[].[].previous_account_idstring | nullrequired
    • items[].[].identitystring | nullrequired
    • items[].[].error_codestring | nullrequired

      HARNESS_NOT_ON_NODE, instance_unsupported, account_needs_login, drain_timeout, timed_out, verify_failed, identity_mismatch, grant_revoked, custody_unavailable, node_offline, login_failed, credential_not_found, generation_conflict or provider_unknown.

    • items[].[].loginobject | object

      Login items only. The device url (and code, when the provider shows one) reach the job initiator; everyone else sees {pending:true}. A url with a null code means the sign-in waits for the owner to paste the authorization code: send it with submitAccountLoginInput.

    • items[].[].grantee_instancebooleanrequired

      True when the instance belongs to another org.

    • created_atintegerrequired
    • updated_atintegerrequired
  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 409Conflict (grant_exists, login_not_waiting, generation_conflict and similar)
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/instances/$ID/account/logout" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "string"
  }'

Switch an instance to an account

POST/v1/flocks/instances/{id}/account/switch

flocks:writeTested with an API keyflocks_switchInstanceAccount

Drains in-flight runs (or cancels them with force), installs the account, verifies its identity and swaps; on failure the previous account stays and the item reports rolled_back. Needs flocks:admin for org API keys; a signed-in Console session needs flocks:admin or flocks:write.

Parameters

  • idpath · stringrequired

    Instance (node) id

Request body application/json

  • account_idstringrequired
  • providerstring
  • forceboolean

    Cancel in-flight runs instead of waiting for them to finish. default false

  • drain_timeout_secsinteger

    min 0 · max 3600 · default 120

Responses

  • 202Success
    Response fields
    • idstringrequired

      pattern ^job_[0-9a-f]{32}$

    • kind"login" | "switch" | "logout"required
    • state"running" | "succeeded" | "partial" | "failed"required
    • account_idstring | nullrequired
    • providerstringrequired
    • concurrencyintegerrequired
    • forcebooleanrequired
    • totalsobjectrequired
    • totals.queuedintegerrequired
    • totals.dispatchedintegerrequired
    • totals.succeededintegerrequired
    • totals.failedintegerrequired
    • totals.timed_outintegerrequired
    • totals.rolled_backintegerrequired
    • totals.unsupportedintegerrequired
    • itemsobject[]required
    • items[].[].instance_idstring | nullrequired

      Null for an instance of another org (a grantee, on an owner's revoke or delete job); the owner is never told which.

    • items[].[].state"queued" | "dispatched" | "succeeded" | "failed" | "timed_out" | "rolled_back" | "unsupported"required
    • items[].[].previous_account_idstring | nullrequired
    • items[].[].identitystring | nullrequired
    • items[].[].error_codestring | nullrequired

      HARNESS_NOT_ON_NODE, instance_unsupported, account_needs_login, drain_timeout, timed_out, verify_failed, identity_mismatch, grant_revoked, custody_unavailable, node_offline, login_failed, credential_not_found, generation_conflict or provider_unknown.

    • items[].[].loginobject | object

      Login items only. The device url (and code, when the provider shows one) reach the job initiator; everyone else sees {pending:true}. A url with a null code means the sign-in waits for the owner to paste the authorization code: send it with submitAccountLoginInput.

    • items[].[].grantee_instancebooleanrequired

      True when the instance belongs to another org.

    • created_atintegerrequired
    • updated_atintegerrequired
  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 409Conflict (grant_exists, login_not_waiting, generation_conflict and similar)
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/instances/$ID/account/switch" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "string"
  }'

Instances

Sign many instances out of a provider account

POST/v1/flocks/instances/account/bulk-logout

flocks:writeTested with an API keyflocks_bulkLogoutInstanceAccount

Selector-based logout with bounded concurrency. Needs flocks:admin for org API keys; a signed-in Console session needs flocks:admin or flocks:write.

Request body application/json

  • selectorobjectrequired

    Resolves only against the calling org's enrolled instances; given fields are ANDed. A selector that matches nothing is refused with 400 selector_empty.

  • selector.instance_idsstring (uuid)[]
  • selector.flockstring

    Matches instances whose label flock equals this value. max length 128

  • selector.labelsobject

    Instances must carry every label given.

  • selector.from_account_idstring

    Instances currently bound to this account.

  • providerstringrequired
  • concurrencyinteger

    min 1 · max 20 · default 5

  • forceboolean

    Cancel in-flight runs instead of waiting for them to finish. default false

Responses

  • 202Success
    Response fields
    • idstringrequired

      pattern ^job_[0-9a-f]{32}$

    • kind"login" | "switch" | "logout"required
    • state"running" | "succeeded" | "partial" | "failed"required
    • account_idstring | nullrequired
    • providerstringrequired
    • concurrencyintegerrequired
    • forcebooleanrequired
    • totalsobjectrequired
    • totals.queuedintegerrequired
    • totals.dispatchedintegerrequired
    • totals.succeededintegerrequired
    • totals.failedintegerrequired
    • totals.timed_outintegerrequired
    • totals.rolled_backintegerrequired
    • totals.unsupportedintegerrequired
    • itemsobject[]required
    • items[].[].instance_idstring | nullrequired

      Null for an instance of another org (a grantee, on an owner's revoke or delete job); the owner is never told which.

    • items[].[].state"queued" | "dispatched" | "succeeded" | "failed" | "timed_out" | "rolled_back" | "unsupported"required
    • items[].[].previous_account_idstring | nullrequired
    • items[].[].identitystring | nullrequired
    • items[].[].error_codestring | nullrequired

      HARNESS_NOT_ON_NODE, instance_unsupported, account_needs_login, drain_timeout, timed_out, verify_failed, identity_mismatch, grant_revoked, custody_unavailable, node_offline, login_failed, credential_not_found, generation_conflict or provider_unknown.

    • items[].[].loginobject | object

      Login items only. The device url (and code, when the provider shows one) reach the job initiator; everyone else sees {pending:true}. A url with a null code means the sign-in waits for the owner to paste the authorization code: send it with submitAccountLoginInput.

    • items[].[].grantee_instancebooleanrequired

      True when the instance belongs to another org.

    • created_atintegerrequired
    • updated_atintegerrequired
  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 409Conflict (grant_exists, login_not_waiting, generation_conflict and similar)
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/instances/account/bulk-logout" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "selector": {},
    "provider": "string"
  }'

Switch many instances to an account

POST/v1/flocks/instances/account/bulk-switch

flocks:writeTested with an API keyflocks_bulkSwitchInstanceAccount

Selects instances by id, flock, labels or current account and switches them with bounded concurrency. Needs flocks:admin for org API keys; a signed-in Console session needs flocks:admin or flocks:write.

Request body application/json

  • selectorobjectrequired

    Resolves only against the calling org's enrolled instances; given fields are ANDed. A selector that matches nothing is refused with 400 selector_empty.

  • selector.instance_idsstring (uuid)[]
  • selector.flockstring

    Matches instances whose label flock equals this value. max length 128

  • selector.labelsobject

    Instances must carry every label given.

  • selector.from_account_idstring

    Instances currently bound to this account.

  • account_idstringrequired
  • concurrencyinteger

    min 1 · max 20 · default 5

  • forceboolean
  • drain_timeout_secsinteger

    min 0 · max 3600

Responses

  • 202Success
    Response fields
    • idstringrequired

      pattern ^job_[0-9a-f]{32}$

    • kind"login" | "switch" | "logout"required
    • state"running" | "succeeded" | "partial" | "failed"required
    • account_idstring | nullrequired
    • providerstringrequired
    • concurrencyintegerrequired
    • forcebooleanrequired
    • totalsobjectrequired
    • totals.queuedintegerrequired
    • totals.dispatchedintegerrequired
    • totals.succeededintegerrequired
    • totals.failedintegerrequired
    • totals.timed_outintegerrequired
    • totals.rolled_backintegerrequired
    • totals.unsupportedintegerrequired
    • itemsobject[]required
    • items[].[].instance_idstring | nullrequired

      Null for an instance of another org (a grantee, on an owner's revoke or delete job); the owner is never told which.

    • items[].[].state"queued" | "dispatched" | "succeeded" | "failed" | "timed_out" | "rolled_back" | "unsupported"required
    • items[].[].previous_account_idstring | nullrequired
    • items[].[].identitystring | nullrequired
    • items[].[].error_codestring | nullrequired

      HARNESS_NOT_ON_NODE, instance_unsupported, account_needs_login, drain_timeout, timed_out, verify_failed, identity_mismatch, grant_revoked, custody_unavailable, node_offline, login_failed, credential_not_found, generation_conflict or provider_unknown.

    • items[].[].loginobject | object

      Login items only. The device url (and code, when the provider shows one) reach the job initiator; everyone else sees {pending:true}. A url with a null code means the sign-in waits for the owner to paste the authorization code: send it with submitAccountLoginInput.

    • items[].[].grantee_instancebooleanrequired

      True when the instance belongs to another org.

    • created_atintegerrequired
    • updated_atintegerrequired
  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 409Conflict (grant_exists, login_not_waiting, generation_conflict and similar)
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/instances/account/bulk-switch" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "selector": {},
    "account_id": "string"
  }'

Jobs

Get an account job

GET/v1/flocks/jobs/{id}

flocks:readTested with an API keyflocks_getAccountJob

Per-instance results for a login, switch or logout job. Poll until state is not running. Needs flocks:read (flocks:write or flocks:admin also satisfy it).

Parameters

  • idpath · stringrequired

    Job id (job_...)

Responses

  • 200Success
    Response fields
    • idstringrequired

      pattern ^job_[0-9a-f]{32}$

    • kind"login" | "switch" | "logout"required
    • state"running" | "succeeded" | "partial" | "failed"required
    • account_idstring | nullrequired
    • providerstringrequired
    • concurrencyintegerrequired
    • forcebooleanrequired
    • totalsobjectrequired
    • totals.queuedintegerrequired
    • totals.dispatchedintegerrequired
    • totals.succeededintegerrequired
    • totals.failedintegerrequired
    • totals.timed_outintegerrequired
    • totals.rolled_backintegerrequired
    • totals.unsupportedintegerrequired
    • itemsobject[]required
    • items[].[].instance_idstring | nullrequired

      Null for an instance of another org (a grantee, on an owner's revoke or delete job); the owner is never told which.

    • items[].[].state"queued" | "dispatched" | "succeeded" | "failed" | "timed_out" | "rolled_back" | "unsupported"required
    • items[].[].previous_account_idstring | nullrequired
    • items[].[].identitystring | nullrequired
    • items[].[].error_codestring | nullrequired

      HARNESS_NOT_ON_NODE, instance_unsupported, account_needs_login, drain_timeout, timed_out, verify_failed, identity_mismatch, grant_revoked, custody_unavailable, node_offline, login_failed, credential_not_found, generation_conflict or provider_unknown.

    • items[].[].loginobject | object

      Login items only. The device url (and code, when the provider shows one) reach the job initiator; everyone else sees {pending:true}. A url with a null code means the sign-in waits for the owner to paste the authorization code: send it with submitAccountLoginInput.

    • items[].[].grantee_instancebooleanrequired

      True when the instance belongs to another org.

    • created_atintegerrequired
    • updated_atintegerrequired
  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/jobs/$ID" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Login input

Send the pasted sign-in code to a waiting login

POST/v1/flocks/jobs/{id}/login-input

flocks:writeflocks_submitAccountLoginInput

A headless Claude sign-in prints a URL and then waits for the authorization code. The job initiator pastes it here; it is sealed to the instance, delivered with the next heartbeat and never stored. Only for a login job whose item on that instance is waiting, else 409 login_not_waiting. Needs flocks:admin for org API keys; a signed-in Console session needs flocks:admin or flocks:write.

Parameters

  • idpath · stringrequired

    Job id (job_...)

Request body application/json

  • instance_idstring (uuid)required
  • codestringrequired

    The authorization code the owner copied from the provider sign-in page. It is sealed to the instance and never stored or returned. min length 1 · max length 512

Responses

  • 202Success
    Response fields
    • acceptedtruerequired
  • 400Invalid request
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin; node credentials are refused)
  • 404Unknown job in the verified org
  • 409login_not_waiting: the job is not a login job, was not started by the caller, or that instance is not waiting for input
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/jobs/$ID/login-input" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_id": "00000000-0000-4000-8000-000000000000",
    "code": "string"
  }'

Activate

Activate the exact saved One account node reservation idempotently

POST/v1/flocks/nodes/{id}/activate

flocks:writeflocks_activateNode

Parameters

  • idpath · string (uuid)required

Request body application/json

  • node_noncestringrequired

    pattern ^[0-9a-f]{64}$

  • namestringrequired

    min length 1 · max length 128

  • platformstringrequired

    min length 1 · max length 128

  • cpu_countintegerrequired

    min 1 · max 65536

Responses

  • 200The same enrolled node, without reusable secrets
    Response fields
    • nodeobjectrequired
    • node.idstringrequired
    • node.namestringrequired
    • node.nicknamestringrequired
    • node.platformstringrequired
    • node.cpu_countintegerrequired

      min 1

    • node.state"enrolled" | "revoked"required
    • node.last_seen_atintegerrequired
    • node.enrolled_atintegerrequired
    • node.labelsobject

      Free-form labels; the key flock groups instances.

    • node.accountsobject[]

      Inference accounts the instance last reported.

    • node.accounts[].[].providerstringrequired
    • node.accounts[].[].account_idstring | nullrequired
    • node.accounts[].[].identitystring | nullrequired
    • node.accounts[].[].auth_state"authenticated" | "unauthenticated" | "unknown" | "switching"required
    • node.accounts[].[].generationintegerrequired

      Credential generation the instance holds (0 when none). min 0

    • node.accounts_supportedboolean

      True when the instance reported a seal key and can hold inference accounts.

    • activatedbooleanrequired
  • 401Inactive node credential
  • 404Unknown or foreign node/nonce
  • 409Conflicting or revoked reservation
  • 503Native receiver unavailable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/nodes/$ID/activate" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "node_nonce": "string",
    "name": "string",
    "platform": "string",
    "cpu_count": 1
  }'

Credential:rotate

Prepare a fixed-scope key, persist it, then commit; cancel an uncertain prepare before retrying

POST/v1/flocks/nodes/{id}/credential:rotate

flocks:writeflocks_rotateNodeCredential

Parameters

  • idpath · string (uuid)required

Request body application/json

  • action"prepare" | "commit" | "cancel"required
  • node_noncestringrequired

    pattern ^[0-9a-f]{64}$

  • operation_noncestringrequired

    pattern ^[0-9a-f]{64}$

Responses

  • 200Committed or cancelled
    Response fields
    • acceptedbooleanrequired
  • 201Prepared key shown once; persist before commit
    Response fields
    • node_idstring (uuid)required
    • organization_idstringrequired
    • credential_idstringrequired
    • credential_valuestringrequired

      min length 1 · max length 4096

    • scopes"flocks:node"[]required
    • expires_atstring (date-time)required
    • node_nonce_hashstring

      pattern ^[0-9a-f]{64}$

  • 401Inactive key version
  • 404Unknown or foreign node/nonce
  • 409Pending, terminal or premature rotation
  • 503Rotation unavailable; retain recovery state
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/nodes/$ID/credential:rotate" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "prepare",
    "node_nonce": "string",
    "operation_nonce": "string"
  }'

Nodes

Exchange a one-time Console join for a node-only One account credential; persist it before activation

POST/v1/flocks/nodes/enroll

flocks:writeNo key neededflocks_exchangeJoinToken

Request body application/json

  • tokenstringrequired

    pattern ^[0-9a-f]{64}$

  • node_noncestringrequired

    pattern ^[0-9a-f]{64}$

Responses

  • 201Credential shown once; save privately before activation
    Response fields
    • node_idstring (uuid)required
    • organization_idstringrequired
    • credential_idstringrequired
    • credential_valuestringrequired

      min length 1 · max length 4096

    • scopes"flocks:node"[]required
    • expires_atstring (date-time)required
    • node_nonce_hashstring

      pattern ^[0-9a-f]{64}$

  • 400Invalid closed body or unexpected bearer
  • 401Expired or used join
  • 503Native issuance unavailable
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/flocks/nodes/enroll" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "string",
    "node_nonce": "string"
  }'

Providers

List inference providers

GET/v1/flocks/providers

flocks:readTested with an API keyflocks_listProviders

Providers (claude, codex) with the login kinds each supports and plain guidance on which plans fit sharing one login across many instances. Needs flocks:read (flocks:write or flocks:admin also satisfy it).

Responses

  • 200Success
    Response fields
    • itemsobject[]required
    • items[].[].idstringrequired
    • items[].[].display_namestringrequired
    • items[].[].auth_kinds"subscription_oauth" | "api_key"[]required
    • items[].[].plan_guidancestringrequired

      One plain sentence on which plans fit sharing one login across many instances.

  • 400Invalid request, or selector_empty
  • 401Invalid One account credential
  • 403Insufficient permission (org API keys need flocks:admin for writes; node credentials are refused)
  • 404Unknown resource in the verified org
  • 422The request is well formed but cannot be applied (for example a secret reference Blinds cannot import)
  • 503ACCOUNT_CUSTODY_UNAVAILABLE: custody is not configured or unreachable
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/flocks/providers" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

L1fe AI Inc. · Built from Genesis 0.3.3 and the live gateway on 2026-10-25. Support