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
| Field | Type | What it is |
|---|---|---|
| enabled | boolean | |
| max_payment_micros | integer or null | |
| daily_micros | integer or null | |
| allow_hosts | array of string or null | |
| deny_hosts | array of string | |
| expires_at | integer or null | |
| ap2_constraints | array of any | |
| agent_id | integer or null | The 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.