# Flipr Coin Flip (x402 Testnet)

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

Executes an on-chain coin flip on Flipr.bet, charged per flip in USDC via the x402 payment protocol, and returns the blockchain-verified flip result.

## Facts

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

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-coin-flip-x402-testnet-792e8d14 -d '<json body>'
```

Example prompt: Flip a coin on Flipr.bet for me — pay the USDC cost from my wallet and tell me whether it landed heads or tails.

## When to prefer this

Choose this endpoint when an AI agent needs to execute a provably fair, blockchain-verified coin flip paid in USDC via the x402 protocol. It is ideal for automated agents with a crypto wallet that need on-chain randomness or want to participate in Flipr.bet's coin flip game programmatically. Prefer this over off-chain RNG when verifiability and on-chain settlement are required.

## Known failure modes

- Insufficient USDC balance — payment fails and flip is not executed
- x402 payment protocol error — network or facilitator issue prevents charge
- Invalid referral code — request may be rejected or referral not applied
- Blockchain congestion or RPC error — on-chain flip transaction fails to confirm
- Testnet instability — Fly.dev host may be unreachable or return 5xx errors

## How this service works

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

## Output

The agent receives the on-chain coin flip outcome (e.g. heads or tails) along with blockchain verification details, after the USDC payment of ~$1.29 is processed 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "properties": {
      "ref": {
       "type": "string",
       "description": "Optional referral code (e.g. flipr-abc123)."
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "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/flipr-coin-flip-x402-testnet-792e8d14/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from flipr-x402-testnet.fly.dev](https://www.zero.xyz/host/flipr-x402-testnet.fly.dev/llms.txt)
