Pay-per-call AI media and inference, no API key
13 routes on Cloudflare Workers AI, paid per call in USDC on Base with the x402 protocol. Prices from $0.001 to $5.00. No account, no key, no subscription; the first request answers 402 with the exact terms.
Routes and prices
| Route | What it does (Workers AI model ids) | Price (USDC) | Free sample |
|---|---|---|---|
POST /imageText to image | One 1024x1024 JPEG from a text prompt with FLUX.1 [schnell] (1-8 steps); Stable Diffusion XL base (PNG) if FLUX fails.@cf/black-forest-labs/flux-1-schnell, @cf/stabilityai/stable-diffusion-xl-base-1.0 | $0.02 | sample |
POST /captionImage caption | One or two sentences describing an image (LLaVA 1.5 7B; Llama 3.2 11B Vision as fallback).@cf/llava-hf/llava-1.5-7b-hf, @cf/meta/llama-3.2-11b-vision-instruct | $0.005 | sample |
POST /speechText to speech | MP3 speech for up to 2,000 characters with MeloTTS (en, es, fr, zh, ja, ko); Deepgram Aura-1 (English) as fallback for texts under 600 characters.@cf/myshell-ai/melotts, @cf/deepgram/aura-1 | $0.01 | sample |
POST /transcribeSpeech to text | Transcript of an audio file up to 10 MB with Whisper large-v3-turbo (Whisper as fallback up to 3 MB).@cf/openai/whisper-large-v3-turbo, @cf/openai/whisper | $0.01 | sample |
POST /translateTranslate | Translation between 100 languages with Meta M2M100 1.2B (Llama 3.1 8B with a translation prompt as fallback).@cf/meta/m2m100-1.2b, @cf/meta/llama-3.1-8b-instruct-fp8 | $0.002 | sample |
POST /summarizeSummarize | A summary of up to 20,000 characters of text by Llama 3.1 8B instruct with a summarization prompt (BART-large-CNN is no longer in the Workers AI catalog).@cf/meta/llama-3.1-8b-instruct-fp8, @cf/meta/llama-3.2-3b-instruct | $0.002 | sample |
POST /embedEmbeddings | 1024-dimension multilingual embeddings for up to 32 texts per call with BAAI bge-m3 (bge-base-en-v1.5, 768 dims, as fallback).@cf/baai/bge-m3, @cf/baai/bge-base-en-v1.5 | $0.001 | sample |
POST /chatChat completions | OpenAI-style chat completion: Llama 3.1 8B instruct fp8 for $0.005, or Llama 3.3 70B instruct fp8-fast for $0.02 when model is "llama-3.3-70b".@cf/meta/llama-3.1-8b-instruct-fp8, @cf/meta/llama-3.3-70b-instruct-fp8-fast, @cf/meta/llama-3.2-3b-instruct | $0.005 $0.02 70B | sample |
POST /classifyClassify text | Sentiment (POSITIVE/NEGATIVE with scores) from DistilBERT SST-2, or zero-shot into 2-10 labels of your own with Llama 3.1 8B when labels are sent.@cf/huggingface/distilbert-sst-2-int8, @cf/meta/llama-3.1-8b-instruct-fp8 | $0.001 | sample |
POST /ocrRead text in an image | The text visible in an image, read by a vision-language model (LLaVA 1.5 7B; Llama 3.2 11B Vision as fallback). Not a dedicated OCR engine.@cf/llava-hf/llava-1.5-7b-hf, @cf/meta/llama-3.2-11b-vision-instruct | $0.005 | sample |
POST /detect-languageDetect language | Language of a text by a heuristic: Unicode script ranges plus stopword frequencies for 20 Latin-script languages. No model. no model | $0.001 | sample |
POST /batchBatch of 100 | Up to 100 items across embed, translate, summarize and classify in one request for $1.00, each item answered separately.@cf/baai/bge-m3, @cf/meta/m2m100-1.2b, @cf/meta/llama-3.1-8b-instruct-fp8, @cf/huggingface/distilbert-sst-2-int8 | $1.00 | sample |
POST /image-setImage set of 20 | Twenty 1024x1024 JPEGs from a list of 1-20 prompts with FLUX.1 [schnell] at 1-4 steps each (schnell-grade quality), returned as base64.@cf/black-forest-labs/flux-1-schnell | $5.00 | sample |
Every paid route takes a JSON body by POST. Unpaid GET, HEAD and POST all answer 402 with the same terms. Limits and the fallback rules are on pricing; each sample shows a request and a response.
How to pay
Send the request. The answer is 402 Payment Required with an accepts list: scheme exact, network Base (eip155:8453), asset USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, payTo 0xc91cE6291eDC0713ec753BAFBA002506ffb2b95c, amount in USDC atomic units (10000 = $0.01). Sign the EIP-3009 authorization for that amount and resend the identical request with the X-PAYMENT header (v1) or PAYMENT-SIGNATURE (v2). The facilitator (facilitator.payai.network) verifies and settles on chain, the model runs, and the response carries PAYMENT-RESPONSE. Any x402 client works (x402-fetch, @x402/fetch, Coinbase AgentKit). If the model fails after settlement the call answers 502 and the same X-PAYMENT is honoured once more within 10 minutes (terms).
curl -s -X POST https://media.agentexchange.work/image -H 'content-type: application/json' -d '{"prompt":"a lighthouse at dawn"}'
# -> 402 {"x402Version":1,"accepts":[{"scheme":"exact","network":"base","maxAmountRequired":"20000","payTo":"0xc91cE6291eDC0713ec753BAFBA002506ffb2b95c",...}]}
curl -s -X POST https://media.agentexchange.work/image -H 'content-type: application/json' -H "X-PAYMENT: $SIGNED" -d '{"prompt":"a lighthouse at dawn"}'
# -> 200 {"image_base64":"/9j/...","mime":"image/jpeg","model":"@cf/black-forest-labs/flux-1-schnell","seed":null,"steps":4,"took_ms":2900}
Models
All inference runs on this account's Workers AI binding; the model ids below were checked against the Workers AI catalog on 2026-09-30 (each model page answered 200). Unit prices are Cloudflare's list prices from the pricing page (fetched 2026-09-30 23:17 UTC); pricing sets them against ours.
| Model id | Used for | Workers AI list price |
|---|---|---|
@cf/black-forest-labs/flux-1-schnell | text-to-image 1024x1024 JPEG, 1-8 steps | $0.0000528 per 512x512 tile + $0.0001056 per step |
@cf/stabilityai/stable-diffusion-xl-base-1.0 | text-to-image (fallback) PNG | $0.00 per step (beta; listed price on the model page) |
@cf/llava-hf/llava-1.5-7b-hf | image caption, OCR vision-language model | no unit price published (beta); billed in neurons at $0.011 per 1,000 |
@cf/meta/llama-3.2-11b-vision-instruct | caption, OCR (fallback) needs a one-time 'agree' request on the account (Meta licence) | $0.049 per M input tokens, $0.676 per M output tokens |
@cf/myshell-ai/melotts | text to speech MP3; en, es, fr, zh, ja, ko | $0.0002 per audio minute |
@cf/deepgram/aura-1 | text to speech (fallback, <600 chars) MP3, English | $0.015 per 1,000 input characters |
@cf/openai/whisper-large-v3-turbo | speech to text base64 audio in | $0.0005 per audio minute |
@cf/openai/whisper | speech to text (fallback, <=3 MB) byte-array audio in | $0.0005 per audio minute |
@cf/meta/m2m100-1.2b | translation 100 languages | $0.342 per M input tokens, $0.342 per M output tokens |
@cf/baai/bge-m3 | embeddings 1024 dims, multilingual | $0.012 per M input tokens |
@cf/baai/bge-base-en-v1.5 | embeddings (fallback) 768 dims, English | $0.067 per M input tokens |
@cf/meta/llama-3.1-8b-instruct-fp8 | chat, summarize, zero-shot classify, translate fallback 32k context | $0.152 per M input tokens, $0.287 per M output tokens |
@cf/meta/llama-3.3-70b-instruct-fp8-fast | chat ($0.02 tier) 24k context | $0.293 per M input tokens, $2.253 per M output tokens |
@cf/meta/llama-3.2-3b-instruct | summarize, chat 8B fallback | $0.051 per M input tokens, $0.335 per M output tokens |
@cf/huggingface/distilbert-sst-2-int8 | sentiment POSITIVE/NEGATIVE | $0.026 per M input tokens |
Three ids requested for this host are no longer in the catalog and were substituted: @cf/meta/llama-3.1-8b-instruct → @cf/meta/llama-3.1-8b-instruct-fp8; @cf/facebook/bart-large-cnn → @cf/meta/llama-3.1-8b-instruct-fp8 with a summarization prompt; @cf/unum/uform-gen2-qwen-500m → @cf/meta/llama-3.2-11b-vision-instruct as the caption fallback.
Today
| Route | 402s served | Paid calls | Succeeded | Failed (replayable) |
|---|---|---|---|---|
/image | 0 | 0 | 0 | 0 |
/caption | 0 | 0 | 0 | 0 |
/speech | 0 | 0 | 0 | 0 |
/transcribe | 0 | 0 | 0 | 0 |
/translate | 0 | 0 | 0 | 0 |
/summarize | 0 | 0 | 0 | 0 |
/embed | 0 | 0 | 0 | 0 |
/chat | 0 | 0 | 0 | 0 |
/classify | 0 | 0 | 0 | 0 |
/ocr | 0 | 0 | 0 | 0 |
/detect-language | 0 | 0 | 0 | 0 |
/batch | 0 | 0 | 0 | 0 |
/image-set | 0 | 0 | 0 | 0 |
Counts for 2026-10-02 UTC from KV; totals for the last days in live.json. Money is not counted here: settlements are on chain to 0xc91cE6291eDC0713ec753BAFBA002506ffb2b95c.
Machine access
/.well-known/x402 (every paid route with the same prices as the challenges) · /openapi.json (OpenAPI 3.1 with x-payment-info) · /.well-known/agent-card.json (A2A, one skill per route) · /a2a (A2A JSON-RPC: message/send, tasks/get; paid skills return the x402 terms as an input-required task) · /llms.txt · /mcp (Streamable HTTP MCP; paid tools return payment instructions) · /samples · /live.json · /health