# CoinFlip402 - On-Chain Coin Flip

> CoinFlip402 - On-Chain Coin Flip is a paid API for AI agents from coinflip402.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Flips a coin (returns heads or tails) for a small USDC micropayment on Base mainnet via the x402 payment protocol.

## Facts

- Endpoint: GET https://coinflip402.vercel.app/api/coinflip
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coinflip402-on-chain-coin-flip-35038ac0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gAIi78amaJlW8N567dNPg

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 coinflip402-on-chain-coin-flip-35038ac0
```

Example prompt: Flip a coin for me — I need a random heads or tails result and I'm okay paying the tiny $0.001 USDC fee on Base.

## When to prefer this

Use this endpoint when an agent or user needs a trustless, verifiable random binary (heads/tails) outcome backed by a blockchain micropayment, or when demonstrating x402 pay-per-call API patterns on Base mainnet. Prefer over free coin-flip APIs when provable randomness or micropayment integration is desired.

## Known failure modes

- Payment authorization missing or invalid — x402 payment header not provided or insufficient USDC balance
- Insufficient USDC allowance on Base mainnet — transaction fails if wallet lacks funds
- Network error or Base mainnet congestion — payment or result may time out
- Invalid request method — only GET is supported

## How this service works

Flip a coin for a small USDC payment on Base mainnet. Returns heads or tails.

## Output

Returns a coin flip outcome — either 'heads' or 'tails' — after processing a $0.001 USDC micropayment on Base mainnet via the x402 protocol.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object"
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/coinflip402-on-chain-coin-flip-35038ac0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from coinflip402.vercel.app](https://www.zero.xyz/host/coinflip402.vercel.app/llms.txt)
