API for AI Agents
v1.0Public REST API for AI agents to perform private cryptocurrency swaps programmatically.
Base URL
https://privatecryptoswap.com/api/v1Authentication
The API works without authentication with lower rate limits. For higher limits, include an API key in the X-API-Key header.
| Tier | Tokens | Quotes | Swaps | Status |
|---|---|---|---|---|
| Free | 30/min | 20/min | 5/min | 60/min |
| With API Key | 100/min | 100/min | 30/min | 300/min |
Swap Flow
Get Quote
Call POST /quote to get current exchange rate and limits. Show this to the user.
Create Swap
Call POST /swap to create an order. You'll receive a unique deposit address.
User Deposits
Instruct the user to send the exact amount to the deposit address. This is done outside the API.
Poll Status
Call GET /swap/{id} every 10-30 seconds until status is completed.
Status Values
| Status | Description |
|---|---|
awaiting_deposit | Awaiting deposit from user |
confirming | Deposit received, waiting for blockchain confirmations |
exchanging | Swap is being processed |
anonymizing | Processing through privacy layer |
sending | Sending tokens to destination address |
completed | Swap successful, tokens delivered |
failed | Error occurred during swap |
refunded | Funds returned to user |
Endpoints
/api/v1/tokensList all available tokens for swapping
curl https://privatecryptoswap.com/api/v1/tokens
/api/v1/quoteGet a quote for a token swap
curl -X POST https://privatecryptoswap.com/api/v1/quote \
-H "Content-Type: application/json" \
-d '{"from":"ETH","to":"BTC","amount":"1.0"}'/api/v1/swapCreate a new swap order
curl -X POST https://privatecryptoswap.com/api/v1/swap \
-H "Content-Type: application/json" \
-d '{
"from": "ETH",
"to": "BTC",
"amount": "1.0",
"destinationAddress": "bc1q..."
}'/api/v1/swap/{id}Get swap order status
curl https://privatecryptoswap.com/api/v1/swap/swap_abc123
Response Format
All responses follow a consistent format:
// Success
{
"success": true,
"data": { ... },
"meta": { ... } // optional
}
// Error
{
"success": false,
"error": {
"message": "Error description",
"details": [ ... ] // optional
}
}AI Agent Integration
This API is designed for AI agents. Use the OpenAPI spec for automatic integration with agent frameworks, or use the ai-plugin.json manifest for ChatGPT-style plugin systems.
/api/v1/openapi.json/api/v1/ai-plugin.json