Skip to content

Legacy: Invoke & Grants

WARNING

These endpoints are from Payre's earlier agent invocation system. They still work but are not part of the core payment flow. Most developers only need POST /v1/charges.

Grants

Grants authorize a caller to invoke a specific agent.

POST /grant

bash
curl -X POST https://api.payre.dev/grant \
  -H "Content-Type: application/json" \
  -H "X-Payre-Key: pyr_sk_xxx" \
  -d '{
    "callerId": "user-1",
    "targetAgentId": "my-agent",
    "type": "one_time"
  }'

GET /grant/:id

bash
curl https://api.payre.dev/grant/gnt_xxx \
  -H "X-Payre-Key: pyr_sk_xxx"

POST /grant/:id/revoke

bash
curl -X POST https://api.payre.dev/grant/gnt_xxx/revoke \
  -H "X-Payre-Key: pyr_sk_xxx"

Invoke

POST /invoke

bash
curl -X POST https://api.payre.dev/invoke \
  -H "Content-Type: application/json" \
  -H "X-Payre-Key: pyr_sk_xxx" \
  -d '{
    "targetAgentId": "my-agent",
    "grantId": "gnt_xxx",
    "capability": "search",
    "payload": {"query": "hello"}
  }'

GET /invoke/:id

bash
curl https://api.payre.dev/invoke/inv_xxx \
  -H "X-Payre-Key: pyr_sk_xxx"

GET /receipts/:id

bash
curl https://api.payre.dev/receipts/inv_xxx \
  -H "X-Payre-Key: pyr_sk_xxx"