# Ozmium Base Mainnet Swap (CDP Trade API)

> Ozmium Base Mainnet Swap (CDP Trade API) is a paid API for AI agents from ozmium.org, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns unsigned swap transaction + permit2 payload for a Base mainnet token swap, quoted via Coinbase CDP Trade API, ready for agent-side signing.

## Facts

- Endpoint: POST https://ozmium.org/v1/tx/swap
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ozmium-base-mainnet-swap-cdp-trade-api-8befd9d7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bFOZbS3jtHrNabssJX9Bv

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability ozmium-base-mainnet-swap-cdp-trade-api-8befd9d7 -d '<json body>'
```

Example prompt: Swap 1000000 USDC (atomic units) to WETH on Base mainnet for my wallet 0xAbC...123, using a 50 bps slippage tolerance — give me the unsigned transaction and permit2 payload so I can sign it.

## When to prefer this

Use this endpoint when an AI agent needs to swap tokens on Base mainnet and wants the raw unsigned transaction + permit2 payload to sign itself, specifically leveraging Coinbase CDP Trade API routing. Prefer over generic DEX aggregators when operating within the Coinbase/Base ecosystem or when agent-side signing with permit2 is required.

## Known failure modes

- Invalid token address returns 400 or empty quote
- fromAmount too small for routing returns no-route error
- taker address malformed returns validation error
- Slippage too tight causes quote failure
- CDP Trade API downstream unavailability returns 5xx
- Payment of $0.02 USDC not included causes 402 rejection

## How this service works

Executable Base mainnet swap via the Coinbase CDP Trade API: returns the unsigned transaction + permit2 payload exactly as CDP quotes it; the agent signs with its own wallet. POST /v1/tx/swap { fromToken, toToken, fromAmount (atomic), taker, signerAddress?, slippageBps? }.

## Output

Returns the unsigned transaction object and permit2 payload exactly as quoted by the Coinbase CDP Trade API, including calldata, to, value, and any permit2 signature requirements — ready for the agent to sign with its own wallet and broadcast.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "taker": {
   "type": "string"
  },
  "toToken": {
   "type": "string"
  },
  "fromToken": {
   "type": "string"
  },
  "fromAmount": {
   "type": "string"
  },
  "slippageBps": {
   "type": "number"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ozmium-base-mainnet-swap-cdp-trade-api-8befd9d7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ozmium.org](https://www.zero.xyz/host/ozmium.org/llms.txt)
