Share this link via
Or copy link
Bet The Flip (β)
Your current points are 10.
Current win streak: 2
Win streak bonus: x1.5
Which one will you bet on?
How much would you like to bet?
You're betting 3 points on heads.
If you're ready, please tap the button below, and flip your coin!
Result
You Win! You've earned points!
Current points: 10
You can ask AI assistants like Claude, ChatGPT, or any agent framework to perform a real, verifiable coin flip on flip-a-coin.com — instead of having the AI invent a random result. The flip is recorded for 30 days at a citable URL anyone can visit.
If your AI assistant has any way to fetch a URL (web tools, browsing, an HTTP fetcher), you can use the flip-a-coin API today by copy-pasting a prompt. Nothing to install. Try one of these in ChatGPT, Claude, Gemini, Perplexity, or any AI assistant with web/browsing tools enabled:
Use the URL https://flip-a-coin.com/api/flip and tell me whether
the coin came up heads or tails. Include the verify_url in your answer
so I can check it myself.
I cannot decide between pizza and burger for dinner.
Please flip a fair coin for me by fetching
https://flip-a-coin.com/api/flip?heads=Pizza&tails=Burger
and tell me what came up, with the verify URL.
Fetch https://flip-a-coin.com/api/flip?n=1000&format=binary
and summarise: how many heads vs tails came up, and how close
to a perfect 50/50 split was the result?
Should I email my boss tonight? Flip a coin by visiting
https://flip-a-coin.com/api/flip?coin=fcc-yes-or-no
and report the result with a one-line justification.
These prompts work because the API is plain HTTPS JSON — any modern AI assistant can call it without a plugin. Citing the verify_url in your answer lets the user audit the flip at flip-a-coin.com/flip/<id> for up to 30 days.
Want the AI to call the coin flip automatically every time, without you pasting URLs? Read on for the MCP and GPT Actions integrations below.
The easiest path. One config change and you’re done.
brew install node.)
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonIf the file doesn’t exist, create it. If it’s empty, start with { "mcpServers": {} }.
flip-a-coin entry inside mcpServers:
{
"mcpServers": {
"flip-a-coin": {
"command": "npx",
"args": ["-y", "flip-a-coin-mcp"]
}
}
}
If you already have other MCP servers, just add the flip-a-coin key alongside them.
Flip a coin to decide whether I should have pizza or burger tonight.Claude should call the tool, perform the flip, and cite a
verify_url in its answer.
One line:
claude mcp add flip-a-coin -- npx -y flip-a-coin-mcp
Gemini CLI (Google’s terminal AI tool) also speaks MCP, so the same flip-a-coin-mcp package works there.
npm install -g @google/gemini-cli (requires Node.js).export GEMINI_API_KEY=AIza...
~/.gemini/settings.json:
{
"mcpServers": {
"flip-a-coin": {
"command": "npx",
"args": ["-y", "flip-a-coin-mcp"]
}
}
}
gemini -p "Flip a coin: pizza or burger?" \
--allowed-mcp-server-names flip-a-coin
The --allowed-mcp-server-names flag is needed in non-interactive (-p) mode; in interactive mode MCP servers are auto-enabled.
Heads up: consumer Gemini chat (gemini.google.com) and Gems don’t support third-party MCP yet — only the Gemini CLI does.
We’ve published a public Custom GPT pre-wired to the flip-a-coin API. Click the link, then chat as usual — no setup, no schema, no install:
Open Coin Flip — Verified Fair in ChatGPT →
Requires any ChatGPT plan that supports Custom GPTs — Go, Plus, Pro, Business, or Enterprise (Custom GPTs are not available on the Free plan).
Sign in to ChatGPT first. The model can chat without signing in, but ChatGPT disables external Actions for anonymous viewers, so the coin-flip API won’t actually run unless you’re logged in.
Test prompts to try:
If you want full control — your own GPT under your own builder profile, custom instructions, branding, or a GPT private to your team — you can build one against our public OpenAPI schema.
When the user asks you to flip a coin, pick between options, or
make a fair binary decision, call the flipCoin action. Always cite
the returned verify_url so the user can independently confirm the
result at flip-a-coin.com.
https://flip-a-coin.com/api/openapi.jsonIf you’re building your own AI app or agent, hit the API directly. Full documentation: flip-a-coin.com/api/.
Complete tool-use example with the Anthropic SDK (Python). The model decides when to call flip_coin, we execute the call, and the model returns a final answer citing the verify_url:
import anthropic, requests
client = anthropic.Anthropic()
TOOLS = [{
"name": "flip_coin",
"description": "Flip a real, cryptographically fair coin via flip-a-coin.com. "
"Returns heads/tails plus a verify_url that the user can visit.",
"input_schema": {
"type": "object",
"properties": {
"heads": {"type": "string", "description": "Custom heads label"},
"tails": {"type": "string", "description": "Custom tails label"},
"coin": {"type": "string", "description": "Coin slug (e.g. fcc-yes-or-no, usd-25cent, ccc-bitcoin)"},
"n": {"type": "integer", "minimum": 1, "maximum": 100000, "default": 1,
"description": "Number of flips per call (1-100,000)"},
"format":{"type": "string", "enum": ["array", "binary"], "default": "array"},
},
},
}]
def call_flip(args):
r = requests.get(
"https://flip-a-coin.com/api/flip",
params=args,
headers={"User-Agent": "MyApp/1.0"},
timeout=10,
)
r.raise_for_status()
return r.json()
# 1. First turn: send the user prompt + tools.
messages = [{"role": "user", "content": "Flip a coin to decide: pizza or burger?"}]
resp = client.messages.create(
model="claude-opus-4-7",
max_tokens=1024,
tools=TOOLS,
messages=messages,
)
# 2. If the model wants to call the tool, execute it and reply.
while resp.stop_reason == "tool_use":
tool_calls = [b for b in resp.content if b.type == "tool_use"]
messages.append({"role": "assistant", "content": resp.content})
tool_results = []
for tc in tool_calls:
if tc.name == "flip_coin":
result = call_flip(tc.input)
tool_results.append({
"type": "tool_result",
"tool_use_id": tc.id,
"content": str(result), # JSON string is fine
})
messages.append({"role": "user", "content": tool_results})
resp = client.messages.create(
model="claude-opus-4-7",
max_tokens=1024,
tools=TOOLS,
messages=messages,
)
# 3. Final assistant turn — the model will cite verify_url.
for block in resp.content:
if block.type == "text":
print(block.text)
For higher-throughput agent loops, swap requests.get for an async client (httpx.AsyncClient) and parallelise multiple flips. The API supports up to 60 requests/min and 5,000/day per IP.
For OpenAI Function Calling or LangChain, see the OpenAPI spec at /api/openapi.json.
n=100,000 in a single call — full parity with the on-site multi-flip.)coin=usd-25cent) or “Flip the California state quarter” (calls coin=usq-california).Every flip returns a URL like https://flip-a-coin.com/flip/<id>. Visit it to see the recorded flip — coin design, heads/tails labels, the result, and the exact UTC timestamp the flip was generated. Records are kept for 30 days.
flip_coin after I edited the config.npx) installed and on your PATH.rate_limited.flip-a-coin-mcp source release on GitHub is being prepared and will be published once the package stabilizes. In the meantime the npm package is fully functional — flip-a-coin-mcp on npm — and we’ll update this page when the repo is open. If you want early access or have a specific use case, contact us. Please call our public API rather than scraping the site.