API reference

API reference · Agents

List the account's agents

GET/v1/agentsAPI key

An agent is a named sub balance of the account with a key of its own (lib/agents.ts). Money reaches it only by a transfer from the account's own balance, written as two ledger rows that sum to zero; its requests are held and settled against it alone, and when it is empty they are refused with 402 agent_balance_exhausted. Needs a key with the agents scope; an agent's own key is refused.

Answer 200

The agents.

Fields of the 200 answer
FieldTypeWhat it is
objectstringOne of "list".
dataarray of object
data[].objectstringOne of "agent".
data[].idinteger
data[].namestring
data[].statusstringOne of "active", "paused".
data[].createdintegerUnix seconds.
data[].expires_atinteger or null
data[].expiredboolean
data[].modelsarray of string or null
data[].max_cost_per_request_microsinteger or null
data[].daily_cap_microsinteger or null
data[].auto_refillobject or null
data[].auto_refill.amount_microsrequiredintegerMove at least this much per refill. At least 1.
data[].auto_refill.daily_max_microsrequiredintegerNever refill more than this per UTC day. At least 1.
data[].wallet_addressstring or null
data[].keyobject or null
data[].key.idinteger
data[].key.prefixstring
data[].key.last_used_atinteger or null
data[].balance_microsintegerSpendable: open holds taken off.
data[].held_microsinteger
data[].spent_today_microsintegerToday's settled spend plus open holds: what the daily cap counts.
data[].refilled_today_microsinteger
data[].currencystringOne of "USD".

Errors

  • 401OpenAI shaped error.
  • 403OpenAI shaped error.
  • 429OpenAI shaped error.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter