# Flipr Coin Flip (x402)

> Flipr Coin Flip (x402) is a paid API for AI agents from flipr-x402.fly.dev, paid per call via x402, $0.853/call, status unknown (last checked 2026-09-14).

Executes a single on-chain coin flip on Flipr.bet, deducting ~$1.09 USDC via x402 payment and returning the blockchain-verified result

## Facts

- Endpoint: POST https://flipr-x402.fly.dev/x402/flip
- Price: $0.853/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/flipr-x402-fly-dev-c5c484c5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7uQADK5GlYjw-qvo2sFdd

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 flipr-x402-fly-dev-c5c484c5 -d '<json body>'
```

Example prompt: Go flip a coin on Flipr.bet for me — pay the ~$1.09 USDC fee and tell me if it lands heads or tails, along with the on-chain result.

## When to prefer this

Use this endpoint when you need a provably fair, on-chain coin flip result backed by a real USDC micropayment. Prefer this over off-chain random number generators when the result needs to be verifiable on-chain or when operating within an x402-enabled payment flow.

## Known failure modes

- Insufficient USDC balance — payment rejected by x402 facilitator
- x402 payment header missing or malformed — 402 response with payment requirements
- On-chain transaction failure — network congestion or gas issues
- Service unavailable — fly.dev deployment down
- Invalid request body — missing required flip parameters

## How this service works

Flip a coin on Flipr.bet — agent pays USDC, gets on-chain flip result

## Output

Returns the outcome of the coin flip (heads or tails) along with on-chain transaction details confirming the result, after deducting ~$1.09 USDC via x402 payment protocol.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "type": "object",
     "properties": {
      "ref": {
       "type": "string",
       "description": "Optional referral code (e.g. flipr-abc123)."
      }
     },
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   },
   "required": [
    "type"
   ]
  }
 },
 "required": [
  "input"
 ]
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": "heads",
  "streak": 3,
  "txHash": "0xabc...",
  "wallet": "0x...",
  "agentId": "my-bot-v1",
  "requestId": "12345"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/flipr-x402-fly-dev-c5c484c5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from flipr-x402.fly.dev](https://www.zero.xyz/host/flipr-x402.fly.dev/llms.txt)
