Authorize a spending budget for an account
phantom_authorize_budgetFunder-signed EIP-712 AgentWalletAuthorization: lets an account spend up to max_units of USDC (6-decimal units, e.g. '1000000' = $1) with an optional daily cap, without giving away the wallet. Requires PHANTOM_FUNDER_PRIVATE_KEY in the environment; the signature is produced locally. Policy templates: 'micro' ($1/tx, $5/day, 30d) and 'subscriptions' ($2/tx, $5/day, 30d) — pilot caps kept deliberately low; explicit max_units/daily_cap_units/expires_in_days override any template. The account's own api_key is sent as authentication (first binding requires it).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nonce | No | Unique nonce per funder (default: current timestamp in ms); replays return 409. | |
| api_key | No | Account api_key to authenticate the call; defaults to the server's PHANTOM_API_KEY. | |
| max_units | No | Explicit per-tx cap in 6-decimal units; overrides the template. | |
| account_id | Yes | IDPHANTOM account that will spend the budget (e.g. acc_...). | |
| daily_cap_units | No | Optional explicit daily cap in 6-decimal units; overrides the template. | |
| expires_in_days | No | Validity window in days (default from template; max 365). | |
| policy_template | No | Named pilot policy (default 'micro'); use 'custom' with explicit caps. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| isError | No | True when the API call failed; text carries { error: { code, message } }. |