API reference

API reference · Account

Write one spending rule

PUT/api/account/agent-paySigned in session

The account's own rule (agent_id null), which personal keys pay under, or one agent's, which must be switched on before that agent pays. Fields left out keep what is stored. ap2_constraints takes an AP2 open payment mandate's constraints (payment.amount_range, payment.budget with a DAILY payment.agent_recurrence, payment.allowed_payees, payment.execution_date) and reads them into the same fields. Same origin only.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
enabledboolean
max_payment_microsinteger or null
daily_microsinteger or null
allow_hostsarray of string or null
deny_hostsarray of string
expires_atinteger or null
ap2_constraintsarray of any
agent_idinteger or nullThe agent whose rule this is, or null for the account's own.

Example

{}

Answer 200

The rule as stored.

Errors

  • 400OpenAI shaped error.
  • 401OpenAI shaped error.
  • 404OpenAI 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