Docs/API for AI Agents

API for AI Agents

v1.0

Public REST API for AI agents to perform private cryptocurrency swaps programmatically.

Base URL

https://privatecryptoswap.com/api/v1

Authentication

The API works without authentication with lower rate limits. For higher limits, include an API key in the X-API-Key header.

TierTokensQuotesSwapsStatus
Free30/min20/min5/min60/min
With API Key100/min100/min30/min300/min

Swap Flow

1

Get Quote

Call POST /quote to get current exchange rate and limits. Show this to the user.

2

Create Swap

Call POST /swap to create an order. You'll receive a unique deposit address.

3

User Deposits

Instruct the user to send the exact amount to the deposit address. This is done outside the API.

4

Poll Status

Call GET /swap/{id} every 10-30 seconds until status is completed.

Status Values

StatusDescription
awaiting_depositAwaiting deposit from user
confirmingDeposit received, waiting for blockchain confirmations
exchangingSwap is being processed
anonymizingProcessing through privacy layer
sendingSending tokens to destination address
completedSwap successful, tokens delivered
failedError occurred during swap
refundedFunds returned to user

Endpoints

GET/api/v1/tokens

List all available tokens for swapping

Example
curl https://privatecryptoswap.com/api/v1/tokens
POST/api/v1/quote

Get a quote for a token swap

Example
curl -X POST https://privatecryptoswap.com/api/v1/quote \
  -H "Content-Type: application/json" \
  -d '{"from":"ETH","to":"BTC","amount":"1.0"}'
POST/api/v1/swap

Create a new swap order

Example
curl -X POST https://privatecryptoswap.com/api/v1/swap \
  -H "Content-Type: application/json" \
  -d '{
    "from": "ETH",
    "to": "BTC",
    "amount": "1.0",
    "destinationAddress": "bc1q..."
  }'
GET/api/v1/swap/{id}

Get swap order status

Example
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