Register an agent
Registers an agent in a team and generates its first token. Motor shows the token once; it lasts at most 4 hours and can be renewed. Registration lasts 24 hours by default, up to 30 days. Renewing a token does not extend the registration. A session key registers an agent in a team of its user; an agent token with the scope agents:start registers a sub-agent in its own team, with scopes, a lifetime, and a spending limit no greater than its own. The team must have a card.
Example request
{
"name": "reviewer",
"scopes": [
"current:*"
],
"spending_limit_cents": 2000,
"team_id": "team_1BbA6sXxyUWHYvKqN5T3dM"
}
Responses
201The agent, with `token`.
{
"created_at": "2026-10-22T09:00:00.000Z",
"ended_at": null,
"expires_at": "2026-10-23T09:00:00.000Z",
"id": "agent_1BbA6sXxyUWHYvKqN5T3dM",
"name": "reviewer",
"parent_id": null,
"scopes": [
"current:*"
],
"spending_limit_cents": 2000,
"status": "running",
"team_id": "team_1BbA6sXxyUWHYvKqN5T3dM",
"token": {
"expires_at": "2026-10-22T13:00:00.000Z",
"id": "token_1BbA6sXxyUWHYvKqN5T3dM",
"token": "motor_tk_9fJ2kL3mN4pQ5rS6tU7vW8xY9zA0bC1d"
},
"used_at": null,
"user_id": "user_1BbA6sXxyUWHYvKqN5T3dM"
}
401The credential is missing, unknown, revoked, or expired, or a bound session key has no valid DPoP proof.
{
"error": {
"code": "unauthorized",
"message": "The credential is unknown, revoked, or expired.",
"retryable": false
}
}
402The team needs a card before it can do billable work.
{
"error": {
"code": "billing_required",
"message": "The team needs a card before it can do billable work.",
"retryable": false
}
}
403The credential can't do this.
{
"error": {
"code": "forbidden",
"message": "Your credential can't do this.",
"retryable": false
}
}
409The state of things doesn't allow the request, or an Idempotency-Key was used with another request.
{
"error": {
"code": "conflict",
"message": "A team needs an admin. Make another member an admin first.",
"retryable": false
}
}
422A field or a parameter has a value that Motor can't accept.
{
"error": {
"code": "invalid_field",
"message": "`name` is required.",
"retryable": false
}
}