Skip to main content
enact pay <url> [options]
Makes an HTTP request that automatically handles 402 Payment Required responses. If the server requests payment, Enact pays using your agent session credentials and retries.

Options

FlagDescription
--method <METHOD>HTTP method (default: GET)
--body <JSON>Request body
--header 'Key: Value'Add a request header (repeatable)
--dry-runPreview cost without paying

Examples

# Basic GET
enact pay https://api.example.com/resource

# POST with body
enact pay https://api.example.com/analyze \
  --method POST \
  --body '{"text": "hello world"}'

# Preview cost before paying
enact pay --dry-run https://api.example.com/resource

# Custom headers
enact pay https://api.example.com/resource \
  --header 'X-Request-ID: abc123'

Dry run output

enact pay --dry-run https://api.example.com/resource

  Dry Run: GET https://api.example.com/resource

  Payment required
  Cost:      $0.01
  Remaining: $95.50
If Remaining is lower than Cost, the request will fail. Top up your wallet or create a new session with a higher budget.

Agent mode

enact -t pay https://api.example.com/resource
{
  "status": 200,
  "receipt": true,
  "body": { ... }
}
Dry run in agent mode:
enact -t pay --dry-run https://api.example.com/resource
{
  "requiresPayment": true,
  "cost": { "amount": "0.01", "currency": "AlphaUSD" },
  "remainingBudget": "95.50",
  "wouldExceedBudget": false
}