Pay

Prepare a spending grant (step one of two)

Fixes the grant terms and a server-side nonce and returns the grant_digest the person must assert over with a passkey (action=x402_grant). Then call POST .../pay/grants with the same terms, the digest, and the passkey token. Preparations are single-use, bound to the caller and agent, and expire after ten minutes. The nonce never leaves the server, so the digest cannot be recomputed for different terms. Human callers only; terms are validated against the agent's maximum cap and window here as well. Owners and admins only.

post/v1/agents/{agent_id}/pay/grants/prepare

Request

  • Base URL: https://api.1claw.co
  • URL: https://api.1claw.co/v1/agents/{agent_id}/pay/grants/prepare
  • Auth: HTTP bearer

Path parameters

agent_idstring uuid required

Request body

cap_usdstring required
ttl_secsinteger required
allowed_paytosstring[] nullable

Response

The digest to assert over

grant_digeststring required
action'x402_grant' required
expires_in_secsinteger required

Changes

No recorded changes to this operation across all 2 revisions of this API.