# SYLPHY Token Swap Execution

> SYLPHY Token Swap Execution is a paid API for AI agents from api.sylphyagent.com, paid per call via x402, $0.02/call, status down (last checked 2026-09-15).

Executes a token swap on Base, exchanging a specified input token for an output token with slippage protection and a deadline, returning a transaction hash and swap details.

## Facts

- Endpoint: POST https://api.sylphyagent.com/api/swap
- Price: $0.02/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/sylphy-token-swap-bd3d9fdd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Cs-V2IIdmApsV3V9kN-BA

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 sylphy-token-swap-bd3d9fdd -d '<json body>'
```

Example prompt: Swap 1 ETH (0x0) for USDC (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48) with a minimum output of 990000 USDC units and a deadline 10 minutes from now.

## When to prefer this

Use this endpoint when an agent needs to programmatically execute a token swap on Base with on-chain settlement finality, encrypted intent, and a verifiable transaction hash. Prefer this over generic DEX aggregators when policy compliance, audit proofs, and privacy of intent are required alongside the swap execution.

## Known failure modes

- Slippage exceeded — amountOut would fall below minAmountOut, swap reverted
- Deadline passed — the deadline timestamp has already elapsed
- Invalid token address — tokenIn or tokenOut is not a valid ERC-20 contract on Base
- Insufficient liquidity — not enough pool depth to fill the swap
- Payment failure — x402 payment of 0.02 USDC not confirmed, request rejected
- Malformed amountIn — non-numeric or negative value provided

## How this service works

Sylphy helps wallets, apps, and AI agents execute payments and settlements with encrypted intent, policy checks, and audit proofs — while final settlement remains verifiable on Base.

## Output

Returns a JSON object containing the swap ID (swapId), the on-chain transaction hash (txHash), the actual amount of output tokens received (amountOut), and the fee tier used (fee). The agent can use txHash to verify settlement on Base.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "tokenIn": {
   "type": "string",
   "description": "Input token address (use 0x0 for ETH)"
  },
  "amountIn": {
   "type": "string"
  },
  "deadline": {
   "type": "number"
  },
  "tokenOut": {
   "type": "string"
  },
  "minAmountOut": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "fee": "3000",
  "swapId": "0xdef...",
  "txHash": "0xghi...",
  "amountOut": "997000"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sylphy-token-swap-bd3d9fdd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.sylphyagent.com](https://www.zero.xyz/host/api.sylphyagent.com/llms.txt)
