Solrouter
API ReferenceSwaps

Begin a one-shot ephemeral-wallet private swap (Mode B)

Start a private swap that runs through a throwaway ephemeral wallet — no managed custody. Solrouter returns an unsigned `fundingTx`; the agent signs and broadcasts it, then calls `POST /swaps/oneshot/{id}/execute` to kick off the swap orchestrator.

POST
/agents/v1/swaps/oneshot
X-PAYMENT<token>

x402 USDC-on-Solana payment payload

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/agents/v1/swaps/oneshot" \  -H "Content-Type: application/json" \  -d '{    "payerPubkey": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",    "fromMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",    "toMint": "So11111111111111111111111111111111111111112",    "amount": "1000000",    "destinationPubkey": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",    "slippageBps": 50  }'
{
  "sessionId": "b3d9a1e2-5c4f-4a8b-9e7d-1f2a3b4c5d6e",
  "ephemeralPubkey": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "fundingTx": "AQAB...base64...",
  "expectedSeconds": 75,
  "bucketed": true,
  "expiresAt": "2026-06-09T18:30:00.000Z"
}
{
  "error": "missing_required_fields"
}
{
  "error": "missing_required_fields"
}