LLM RESOURCE — API REFERENCE

Orkid Swap API

Gasless swap execution API. The user signs a Permit2; the solver pays gas and settles atomically on-chain. REST, SDK, CLI, and ElizaOS plugin.

Endpoints

{
`BASE URLS:
  Production:  https://orkidlabs.xyz   (paths /api/v1/*)
  Sandbox:     https://sandbox.orkidlabs.com  (paths /v1/*; /api/v1/* also accepted)

ENDPOINTS:
  POST /api/v1/route    — Executable quote (free, non-billable)
  POST /api/v1/solve    — Execute gasless swap (billable, rebate-eligible)
  GET  /api/v1/tokens   — Serveable token list per chain
  GET  /api/v1/account  — Partner account info + rebate rate
  GET  /api/v1/usage    — Usage events (quotes and solves)
  GET  /api/v1/rebates  — Monthly rebate ledger
  POST /api/v1/confirm  — Confirm user-pays-gas tx for volume tracking
  /api/v1/bridge/*      — Cross-chain bridge quote/track (Across)

AUTHENTICATION:
  X-ORKID-API-Key: <40-char-hex-key>   (production, required)
  Sandbox: no key required — anonymous 60 req/min per IP;
  sandbox keys raise to 300 req/min.
  Self-serve key: https://orkidlabs.xyz/partner

RATE LIMITS (production):
  free 60/min · pro 120/min · enterprise 1000/min

SUPPORTED CHAINS (same-chain gasless):
  base · ethereum · arbitrum
  polygon: same-chain paused; bridge to/from it via /api/v1/bridge/*

MINIMUM NOTIONAL (gasless):
  base $20 · ethereum $200 · arbitrum $50`
      }

POST /api/v1/route

Executable quote across indexed liquidity venues (Uniswap v2/v3/v4, Aerodrome, PancakeSwap, and more). Required fields: from, to, amount. Token symbols or addresses accepted.

{
`REQUEST:
POST /api/v1/route
Content-Type: application/json
X-ORKID-API-Key: 

{
  "from": "USDC",
  "to": "WETH",
  "amount": "25.0",
  "chain": "base"
}

RESPONSE (200):
{
  "ok": true,
  "quote": {
    "amountIn": "25.000000",
    "amountOut": "0.009615",
    "amountOutRaw": "9614922034445563",
    "volumeUsd": 25.0,
    "rate": "0.000385 WETH/USDC",
    "protocol": "uniswap_v3",
    "poolAddress": "0x...",
    "priceImpactBps": 1.76,
    "gasUsd": 0.0096,
    "gasUnits": 121000
  },
  "computeMs": 312
}`
      }

POST /api/v1/solve

Executes the swap gaslessly — user signs a Permit2 PermitTransferFrom, solver submits and pays gas. Set dryRun: true to get ready-to-sign calldata without submitting (non-billable). On the sandbox, dryRun is always forced true.

{
`REQUEST:
POST /api/v1/solve
Content-Type: application/json
X-ORKID-API-Key: 

{
  "from": "USDC",
  "to": "WETH",
  "amount": "25.0",
  "chain": "base",
  "user": "0x",
  "fromAddress": "0x833589fCD6e6D0896C1dE0c1d4a3BCc6c5c8e3D2",
  "fromDecimals": 6,
  "toAddress": "0x4200000000000000000000000000000000000006",
  "toDecimals": 18,
  "dryRun": false,
  "slippageBps": 50,
  "permit": { "permitted": {"token": "0x8335...", "amount": "25000000"},
              "nonce": "0", "deadline": "1722816000" },
  "signature": "0x<65-byte EIP-712 signature>"
}

RESPONSE (200):
{
  "ok": true,
  "quote": { ...same shape as /route... },
  "transaction": { "to": "0x", "data": "0x",
                   "value": "0", "chain": "base", "txHash": "0x..." },
  "computeMs": 450
}`
      }

Sandbox

https://sandbox.orkidlabs.com — real solver quotes and real calldata, never submits on-chain. No API key needed. Ideal for integration testing and agent demos.

{
`curl -X POST https://sandbox.orkidlabs.com/v1/route \\
  -H "Content-Type: application/json" \\
  -d '{"from":"USDC","to":"WETH","amount":"25","chain":"base"}'`}

FAQ

Is the Orkid API free?

Route quotes are free and non-billable. Executed swaps carry a tiered Orkid fee in the output token — see https://orkidlabs.xyz/partner for current tiers. Sandbox usage is free and never bills.

Do I need an API key?

Production requires X-ORKID-API-Key — self-serve instantly at https://orkidlabs.xyz/partner. The sandbox (sandbox.orkidlabs.com) needs no key at all for quotes and dry-run solves; anonymous callers are limited to 60 requests/minute per IP.

What chains are supported?

Gasless same-chain swaps: Base, Ethereum, Arbitrum. Polygon same-chain is paused pending private-relay work, but cross-chain bridging to and from Polygon works via /api/v1/bridge/*. Pass chain as a string: base, ethereum, arbitrum.

Can I use the API without the Orkid UI?

Yes — the API is designed for programmatic access. Build your own frontend, or integrate via @orkid-labs/sdk, the orkid CLI, or the ElizaOS plugin @orkid-labs/plugin-orkid.

LLM Resource Index llms.txt