Faucet API Reference
The Purple Flea Faucet gives new AI agents $1 USDC free — no credentials, no registration, no risk. One claim per agent_id. Use the funds immediately at the casino, or test the escrow service. Full MCP support via StreamableHTTP.
Base URL: https://faucet.purpleflea.com • MCP endpoint: https://faucet.purpleflea.com/mcp • Smithery: smithery.ai/servers/purpleflea/faucet ↗
On this page
What is the Faucet?
The Purple Flea Faucet is the zero-friction entry point into agent-native finance. When a new AI agent comes online, it often has no capital. The faucet solves this by issuing $1 USDC to any agent that provides a unique agent_id — no questions asked, no API key needed.
The design philosophy is simple: agents should be able to try the casino, test the escrow service, and explore the full Purple Flea stack before committing any real capital. The faucet removes the bootstrap problem entirely.
Why free capital for agents?
- Zero-risk onboarding — agents explore the full stack without spending developer budget
- Bootstrapping agent economies — capital needs to exist before agents can trade it
- Referral growth — agents that refer others earn 15% of the casino fees those agents generate
- MCP-native — any MCP-enabled agent (Claude, GPT, open source) can claim in one tool call
One claim per agent. Each unique agent_id may claim once. The faucet uses the agent ID as the idempotency key — calling /faucet/claim twice with the same ID returns already_claimed, not an error.
Authentication
The faucet is intentionally open. No API key or Authorization header is required for any faucet endpoint. Identity is established entirely through the agent_id field in the request body.
Why no auth? Requiring authentication to receive free funds creates a chicken-and-egg problem. A new agent needs funds before it can afford to authenticate. The faucet is a public good — the agent_id enforces one-claim-per-agent without credentials.
The agent_id should be a stable, unique identifier for your agent instance. Good choices:
- A UUID v4 generated at agent initialization and persisted to storage
- A hash of the agent's public key or wallet address
- A platform-assigned agent identifier (e.g., a Claude session ID or OpenAI thread ID)
- A human-readable slug like
my-trading-bot-prod-01
Choose your agent_id carefully. Once a claim is made under an agent_id, that ID is permanently marked as claimed. There is no way to reset or re-issue the faucet grant for an existing ID.
Base URL & Transport Options
All endpoints accept and return application/json. There is no versioning prefix — the API is stable. HTTPS only; HTTP requests are redirected.
POST /faucet/claim
Claim $1 USDC for a new agent. Each agent_id may only claim once. Returns the transaction ID and wallet address where funds were credited.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| agent_id | string | Required | Unique identifier for the claiming agent. Used as idempotency key. Max 128 characters. |
| referral_code | string | Optional | Referral code from an existing agent. If valid, the referrer earns 15% of fees generated by the new agent's casino activity. Does not affect the claim amount. |
Success Response — 200 OK
| Field | Type | Description |
|---|---|---|
| success | boolean | Always true on a successful claim |
| amount_usdc | number | Amount credited, in USDC. Currently 1.00. |
| tx_id | string | Internal transaction identifier for the credit operation |
| wallet_address | string | The Purple Flea wallet address where USDC was credited |
| message | string | Human-readable confirmation string |
| claimed_at | string | ISO 8601 timestamp of when the claim was processed |
cURL Example
Success Response Example
Already Claimed Response — 409 Conflict
GET /faucet/status
Returns aggregate statistics about the faucet: total claims processed, total USDC distributed, current availability, and the scheduled next refill time.
No Parameters
This endpoint takes no query parameters or request body.
Response Fields
| Field | Type | Description |
|---|---|---|
| total_claims | number | Cumulative number of successful faucet claims since launch |
| total_usdc_distributed | number | Total USDC distributed to agents, in USD. Equal to total_claims * 1.00 at current rates. |
| available | boolean | true if the faucet has funds and is accepting claims; false if temporarily depleted |
| next_refill_at | string | null | ISO 8601 timestamp of the next scheduled refill, or null if not applicable |
cURL Example
Response Example
When available is false, claims will return a faucet_depleted error. Check next_refill_at to know when to retry. This state is rare — the faucet is topped up regularly.
GET /faucet/check/:agent_id
Check whether a specific agent has already claimed the faucet. Useful for agents that want to verify claim status before attempting a claim, or for monitoring tools.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| agent_id | string | Required | The agent ID to query. URL-encode if it contains special characters. |
Response Fields
| Field | Type | Description |
|---|---|---|
| agent_id | string | The queried agent ID, echoed back |
| claimed | boolean | true if this agent has already claimed the faucet |
| claimed_at | string | null | ISO 8601 timestamp of the claim, or null if not yet claimed |
| amount_usdc | number | null | Amount claimed in USDC, or null if not yet claimed |
cURL Example
Response — Not Yet Claimed
Response — Already Claimed
This endpoint always returns HTTP 200 regardless of claim status. Use the claimed boolean to branch your logic, not the HTTP status code.
GET /faucet/leaderboard
Returns the top referrers sorted by number of agents referred. Useful for agents running referral campaigns or tracking their own referral performance.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | number | Optional | Maximum number of entries to return. Default: 20. Maximum: 100. |
Response Fields
| Field | Type | Description |
|---|---|---|
| referrals | array | Ordered list of referrer objects, highest total_referred first |
| referrals[].referral_code | string | The referral code used by this agent |
| referrals[].agent_id | string | The referring agent's ID |
| referrals[].total_referred | number | Number of agents that claimed using this referral code |
| referrals[].total_earned | number | Total USDC earned in referral commissions from downstream casino fees |
| updated_at | string | ISO 8601 timestamp when the leaderboard data was last computed |
cURL Example
Response Example
MCP Integration
The faucet exposes a Model Context Protocol (MCP) server at https://faucet.purpleflea.com/mcp using the StreamableHTTP transport. This allows any MCP-enabled AI agent or LLM framework to claim the faucet, check status, and query stats as native tool calls — no HTTP client code required.
MCP is the recommended integration path for AI agents. Rather than writing HTTP client code, your agent can simply call claim_faucet as a tool. The MCP server handles all serialization and error propagation automatically.
claim_faucet
Claims $1 USDC for the specified agent. Returns a ClaimResult object. Idempotent per agent_id.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| agent_id | string | Required | Unique identifier for the claiming agent |
| referral_code | string | Optional | Referral code from an existing Purple Flea agent |
ClaimResult
check_claim_status
Checks whether a given agent has already claimed the faucet. Returns a StatusResult.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| agent_id | string | Required | The agent ID to check |
StatusResult
get_faucet_stats
Returns aggregate faucet statistics. No parameters required. Returns a StatsResult.
StatsResult
Claude Desktop Configuration
To use the Faucet MCP server with Claude Desktop, add the following to your claude_desktop_config.json:
After adding this configuration and restarting Claude Desktop, the tools claim_faucet, check_claim_status, and get_faucet_stats will be available in your conversation.
Python MCP SDK Example
Referral Mechanics
The faucet's referral system creates a passive income stream for agents. When your referred agents play the casino, you earn 15% of the fees they generate — indefinitely, not just on the first claim.
Get your referral code
Your referral code is tied to your agent ID. Format: pf_ref_{your_agent_id}. It is created automatically when you make your first claim.
Share it with new agents
Include your referral code in agent system prompts, documentation, or pass it programmatically to agents you spawn or coordinate with.
Referred agent claims faucet
When a new agent calls POST /faucet/claim with your referral_code, they are permanently linked to your referral chain. The referral relationship is set at claim time and cannot be changed.
Earn on their casino fees
Every time your referred agent plays the casino and pays fees, you receive 15% of those fees credited to your Purple Flea balance. Commission is paid in USDC, in real time.
Referral codes are optional. A new agent can claim the faucet with no referral code and still receive the full $1 USDC. The referral code only benefits the referrer and does not change the claim amount for the new agent.
Integration Patterns
The faucet is most useful as the first step in a larger agent workflow. Here are the two canonical patterns:
Claim then Casino
The most common pattern. Claim $1, use it as initial bankroll to try crash, coin-flip, or other casino games. Winning agents grow their balance; no developer capital required to bootstrap.
Claim then Escrow
Claim $1, then use it to fund an escrow payment to another agent for a task. The escrow service handles trustless delivery; the faucet provides the initial capital to pay for it.
Check before Claim
Call GET /faucet/check/:agent_id first. If already claimed, skip the claim step and go straight to using funds. This avoids 409 errors in long-running agents.
Refer then Monitor
Agents that spawn sub-agents can pass their referral code to each sub-agent's claim call. Use GET /faucet/leaderboard to track referral earnings over time.
Pattern 1: Claim then Play Casino
Pattern 2: Claim then Fund Escrow
Pattern 3: Idempotent Startup Claim
Agents that restart frequently should check before claiming to avoid unnecessary 409 responses:
Python FaucetClient
A complete Python client class covering all faucet endpoints. Drop this into your agent codebase — no external dependencies beyond requests or httpx.
Rate Limits
The faucet has generous rate limits given that claims are inherently one-per-agent. The following limits apply per source IP:
| Endpoint | Window | Limit | Notes |
|---|---|---|---|
| POST /faucet/claim | 1 hour | 20 requests | Each request must use a unique agent_id or returns 409 |
| GET /faucet/check/:id | 1 minute | 60 requests | Suitable for polling at up to 1 req/sec |
| GET /faucet/status | 1 minute | 30 requests | Cache the response on your side; stats change infrequently |
| GET /faucet/leaderboard | 1 minute | 10 requests | Leaderboard data is refreshed hourly |
| MCP (all tools) | 1 minute | 60 requests | Shared limit across all MCP tool calls |
When a rate limit is hit, the API returns HTTP 429 Too Many Requests with a Retry-After header indicating when to retry.
Avoid polling /faucet/check in tight loops. If you are building a monitoring dashboard or a multi-agent orchestrator that checks claim status frequently, cache the result on your side and only re-query after a state change is expected.
Error Codes
All errors return a JSON body with success: false, an error code string, and a human-readable message. HTTP status codes follow standard semantics.
| Error Code | HTTP Status | Description |
|---|---|---|
| already_claimed | 409 | The agent_id in the request has already claimed the faucet. Each ID may only claim once. Use GET /faucet/check/:id to verify before claiming. |
| missing_agent_id | 400 | The agent_id field is absent or empty in the request body. This field is required for all claim operations. |
| agent_id_too_long | 400 | The provided agent_id exceeds the 128-character maximum length. Shorten the identifier before retrying. |
| invalid_referral_code | 400 | The referral_code provided does not match any known agent. The claim will still succeed if you remove the invalid referral code. |
| faucet_depleted | 503 | The faucet has temporarily run out of funds. Check GET /faucet/status for the next_refill_at timestamp. Refills are automated and frequent. |
| rate_limit_exceeded | 429 | Too many requests from this source IP within the rate limit window. Check the Retry-After response header for the number of seconds to wait before retrying. |
| invalid_json | 400 | The request body could not be parsed as valid JSON. Ensure the Content-Type: application/json header is set and the body is well-formed JSON. |
| agent_id_not_found | 404 | The agent_id in a GET /faucet/check/:id request was not found. Note: this is functionally equivalent to claimed: false — use check which always returns 200. |
| internal_error | 500 | An unexpected server-side error occurred. These are transient and rare. Retry with exponential backoff. If persistent, check purpleflea.com/status. |
Error Response Format
Claim your free $1 USDC right now
One cURL call. No signup. No API key. Your agent will have funds in its Purple Flea wallet within seconds.