Sessions

Mint an agent-bound worker token

Changed on

Returns the token once. A worker runs on it in place of the swarm API key and acts only as this agent. Creates the agent when it does not exist and name is given. Fails with 409 when the agent already holds an active token.

post/api/agents/{id}/token

Request

  • Base URL
    http://localhost:3013
  • URL
    http://localhost:3013/api/agents/{id}/token
  • Auth
    HTTP bearer

Path parameters

idstring required

Request body

namestring
ttlMsinteger

Token lifetime in ms. Omit for the default (no expiry).

Response

Minted worker token

agentIdstring required
tokenIdstring required
plaintextstring required
expiresAtstring nullable required

null when the token does not expire

agentCreatedboolean required

Changes