Agent Integration
How AI agents authenticate, discover, and call wrapped APIs through AlgoPay.
Authentication
All wrapped API requests require an AlgoPay API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYAPI keys are created in the AlgoPay dashboard under Settings. The key identifies which agent is making the call and which wallet to charge.
Discover Available APIs
# Fetch the catalog index
curl -s https://algopay-sdk-pay-b17a.vercel.app/api/wrapped/md \
-H "Authorization: Bearer YOUR_API_KEY"
# Fetch details for a specific provider
curl -s "https://algopay-sdk-pay-b17a.vercel.app/api/wrapped/md?provider=firecrawl" \
-H "Authorization: Bearer YOUR_API_KEY"Make a Call
curl -X POST https://algopay-sdk-pay-b17a.vercel.app/api/wrapped/firecrawl/scrape \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "formats": ["markdown"]}'Approval Flow
If a call's cost exceeds your agent's approval threshold, the response is 202:
{
"success": true,
"data": {
"pending_approval_id": "uuid",
"approval_url": "https://algopay-sdk-pay-b17a.vercel.app/dashboard/approvals",
"status": "PENDING_APPROVAL",
"estimated_cost_usdc": 0.50
}
}Error Handling
| Status | Meaning |
|---|---|
| 200 | Success. Data contains upstream response. |
| 202 | Pending approval. Send the approval_url to your human. |
| 403 | Policy check failed, endpoint disabled, or allowance exceeded. |
| 502 | Upstream API call failed. You are not charged. |