API Overview
The sw4p API provides direct access to cross-chain transfer functionality.
The generated OpenAPI spec is published at
/api-reference/openapi.json in this docs site. A running backend also serves
Swagger UI at /docs and the live generated spec at /api-docs/openapi.json.
The checked-in spec is generated from sw4p-backend::SdkApiDoc:
bash
cargo run --manifest-path sw4p-backend/Cargo.toml --bin export_openapi -- docs/api-reference/openapi.json
Base URL
https://api.sw4p.io
Authentication
Published SDK routes require an API key in the header:
bash
curl https://api.sw4p.io/sdk/v1/pairs \
-H "X-API-Key: sk_555_live_your_api_key"
Wallet-owned app routes use the signed wallet session flow documented in Authentication.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /sdk/v1/transfer | Execute cross-chain transfer |
| POST | /sdk/v1/estimate | Estimate transfer fees |
| GET | /sdk/v1/status/:id | Get transfer status |
| GET | /sdk/v1/pairs | Get supported route pairs |
| GET | /sdk/v1/limits | Get transfer limits |
| POST | /sdk/v1/solana/build-tx | Build Solana transaction |
| POST | /sdk/v1/solana/submit | Submit signed Solana tx |
| POST | /v1/auth/nonce | Issue wallet-login nonce |
| POST | /v1/auth/login | Exchange signed nonce for JWT session |
| GET | /v1/auth/session | Get current wallet session |
| POST | /x402/verify | Verify x402 payment payload |
| POST | /x402/settle | Settle x402 payment payload |
Response Format
All responses are JSON:
json
{
"intent_id": "int_abc123",
"status": "pending",
"...": "..."
}
Error Responses
json
{
"error": "ERROR_CODE",
"message": "Human readable message"
}
| Status | Error Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST | Missing or invalid parameters |
| 401 | UNAUTHORIZED | Invalid API key |
| 404 | NOT_FOUND | Resource not found |
| 429 | RATE_LIMITED | Too many requests |
| 500 | INTERNAL_ERROR | Server error |
Rate Limits
| Tier | Requests/min | Transfers/day |
|---|---|---|
| Free | 60 | 10 |
| Pro | 300 | 100 |
| Enterprise | Unlimited | Unlimited |