{"version":1,"resources":["https://inference402.worlddata402.workers.dev/v1/chat/small","https://inference402.worlddata402.workers.dev/v1/chat/large","https://inference402.worlddata402.workers.dev/v1/chat/json","https://inference402.worlddata402.workers.dev/v1/summarize","https://inference402.worlddata402.workers.dev/v1/translate","https://inference402.worlddata402.workers.dev/v1/translate/ar","https://inference402.worlddata402.workers.dev/v1/extract","https://inference402.worlddata402.workers.dev/v1/classify","https://inference402.worlddata402.workers.dev/v1/sentiment","https://inference402.worlddata402.workers.dev/v1/keywords","https://inference402.worlddata402.workers.dev/v1/rewrite","https://inference402.worlddata402.workers.dev/v1/embed","https://inference402.worlddata402.workers.dev/v1/moderate","https://inference402.worlddata402.workers.dev/v1/image/describe","https://inference402.worlddata402.workers.dev/v1/audio/transcribe"],"ownershipProofs":[],"tags":["llm","chat","inference","json","nlp","tasks","summarization","translation","arabic","extraction","classification","sentiment","keywords","seo","writing","embeddings","rag","moderation","safety","vision","image","audio","speech","transcription"],"instructions":"# Inference402\n\nPay-per-call AI inference for agents: chat (Llama 3.3 70B / 3.1 8B), structured JSON, summarize, translate (incl. Egyptian Arabic), extract, classify, sentiment, keywords, rewrite, embeddings, moderation, vision and speech-to-text. USDC on Base mainnet over x402. No API key, no account.\n\nAll paid endpoints are `POST` with a JSON body (`Content-Type: application/json`). Call without payment → HTTP 402 with x402 payment requirements → pay USDC on Base mainnet (eip155:8453) → retry with the payment header. Payment is only settled when the call succeeds (status < 400); validation errors, oversize inputs (413) and model/capacity errors (502/503) are never charged.\n\n## Endpoints\n- POST /v1/chat/small — $0.002 — Fast chat completion with Llama 3.1 8B (≤512 output tokens). Example body: `{\"messages\":[{\"role\":\"user\",\"content\":\"Give me 3 name ideas for a coffee shop.\"}],\"max_tokens\":128}`\n- POST /v1/chat/large — $0.01 — High-quality chat completion with Llama 3.3 70B (≤1024 output tokens). Example body: `{\"messages\":[{\"role\":\"system\",\"content\":\"You are a concise senior engineer.\"},{\"role\":\"user\",\"content\":\"Explain idempotency keys in payment APIs in 3 sentences.\"}],\"max_tokens\":256}`\n- POST /v1/chat/json — $0.01 — Structured output: returns valid JSON matching your JSON Schema (Llama 3.3 70B, one automatic retry). Example body: `{\"messages\":[{\"role\":\"user\",\"content\":\"Extract the person: 'Sara Ahmed, 34, lives in Alexandria.'\"}],\"schema\":{\"type\":\"object\",\"required\":[\"name\",\"age\",\"city\"],\"properties\":{\"name\":{\"type\":\"string\"},\"age\":{\"type\":\"integer\"},\"city\":{\"type\":\"string\"}}}}`\n- POST /v1/summarize — $0.005 — Summarize text (≤8000 chars) at short / medium / long length, in any language. Example body: `{\"text\":\"Cloudflare Workers is a serverless platform ... (long article text)\",\"length\":\"short\",\"lang\":\"en\"}`\n- POST /v1/translate — $0.003 — Machine translation between 100 languages with m2m100-1.2b (≤5000 chars). Example body: `{\"text\":\"The meeting is moved to Thursday morning.\",\"source\":\"en\",\"target\":\"fr\"}`\n- POST /v1/translate/ar — $0.005 — Arabic ⇄ English translation tuned for Modern Standard Arabic or Egyptian dialect (Llama 3.3 70B). Example body: `{\"text\":\"انا مش فاهم انت عايز ايه بالظبط، ممكن توضحلي تاني؟\",\"direction\":\"ar-en\",\"dialect\":\"egyptian\"}`\n- POST /v1/extract — $0.008 — Extract requested fields (names, dates, amounts, entities, or any custom field) from text as JSON. Example body: `{\"text\":\"Invoice #4471 from Nile Tech LLC to Omar Khaled, issued 2026-03-02, total EGP 12,500, due within 30 days.\",\"fields\":[\"names\",\"organizations\",\"dates\",\"amounts\",\"invoice_number\"]}`\n- POST /v1/classify — $0.003 — Zero-shot classification of text into one of your labels, with confidence. Example body: `{\"text\":\"My card was charged twice for the same order.\",\"labels\":[\"billing\",\"shipping\",\"technical\",\"other\"]}`\n- POST /v1/sentiment — $0.002 — Sentiment analysis (positive / negative / neutral + score), multilingual incl. Arabic. Example body: `{\"text\":\"The delivery was late but the support team fixed everything quickly. Very happy!\"}`\n- POST /v1/keywords — $0.002 — Top 10 keywords / keyphrases from text, ranked by importance. Example body: `{\"text\":\"Cloudflare Workers runs JavaScript at the edge, close to users. Developers deploy serverless functions that scale automatically and pay only for what they use...\"}`\n- POST /v1/rewrite — $0.005 — Rewrite text in a formal, casual, marketing, or simple tone (≤4000 chars). Example body: `{\"text\":\"hey, the app is down again, we r fixing it, give us an hour\",\"tone\":\"formal\",\"lang\":\"en\"}`\n- POST /v1/embed — $0.002 — Multilingual 1024-dim embeddings (bge-m3) for up to 32 texts per call. Example body: `{\"texts\":[\"How do I reset my password?\",\"ازاي اغير الباسورد؟\"]}`\n- POST /v1/moderate — $0.002 — Content safety check with Llama Guard 3 (safe / unsafe + MLCommons hazard categories). Example body: `{\"text\":\"How do I bake sourdough bread at home?\"}`\n- POST /v1/image/describe — $0.01 — Describe an image from a URL and list the objects in it (LLaVA 1.5 7B, image ≤5MB). Example body: `{\"image_url\":\"https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg\"}`\n- POST /v1/audio/transcribe — $0.02 — Speech-to-text from an audio URL (mp3/wav/m4a/ogg/flac ≤10MB, ≤20 min) with Whisper large-v3-turbo; returns text + segments. Example body: `{\"audio_url\":\"https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac\",\"language\":\"en\"}`\n\nFree: GET /v1/models (models & limits), GET /openapi.json, GET /SKILL.md.\nPayments to 0xDfaF78148F6dA580A0c3d0FA56d11B138aDbB157. Contact: muarafa91@gmail.com"}