{"slug":"quickbuild-quynguyenbac-workers-dev-api-chat-bddc2a","title":"One-shot LLM completion on Cloudflare Workers AI with a minimal interface","host":"quickbuild.quynguyenbac.workers.dev","method":"POST","resource":"https://quickbuild.quynguyenbac.workers.dev/api/chat","category":"other","description":"One-shot LLM completion on Cloudflare Workers AI with a minimal interface: give `prompt` (and optionally `system`, or OpenAI-style `messages`), get {text, model, finish_reason, usage}. Models: llama-3.1-8b (default), llama-3.2-3b, llama-3.2-1b, mistral-7b, granite-4.0-micro. max_tokens capped at 512","price_listed":0.003,"price_asked":0.003,"state":"answering","state_label":"Answering","checked_on":"2026-12-01","checks_7d":2,"answered_7d":2,"latency_ms_median":38,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"prompt":"Write a one-line tagline for a pay-per-call API."},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"properties":{"max_tokens":{"description":"Max output tokens (default/cap 512).","maximum":512,"minimum":1,"type":"integer"},"messages":{"description":"Optional OpenAI-style history (POST JSON).","items":{"properties":{"content":{"type":"string"},"role":{"type":"string"}},"type":"object"},"type":"array"},"model":{"description":"Model alias (default llama-3.1-8b).","enum":["llama-3.1-8b","llama-3.2-3b","llama-3.2-1b","mistral-7b","granite-4.0-micro"],"type":"string"},"prompt":{"description":"User message. Optional: defaults to a short sample question.","type":"string"},"system":{"description":"Optional system instruction.","type":"string"},"temperature":{"description":"Sampling temperature.","maximum":2,"minimum":0,"type":"number"}},"required":[],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"properties":{"finish_reason":{"type":"string"},"model":{"type":"string"},"modelId":{"type":"string"},"text":{"type":"string"},"usage":{"properties":{"completion_tokens":{"type":"integer"},"prompt_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}},"type":"object"}},"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-12-01","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.003,"price_match":true,"latency_ms":38,"error":null},{"day":"2026-11-30","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.003,"price_match":true,"latency_ms":39,"error":null}],"description_full":"One-shot LLM completion on Cloudflare Workers AI with a minimal interface: give `prompt` (and optionally `system`, or OpenAI-style `messages`), get {text, model, finish_reason, usage}. Models: llama-3.1-8b (default), llama-3.2-3b, llama-3.2-1b, mistral-7b, granite-4.0-micro. max_tokens capped at 512, input up to 24000 chars, Llama Guard 3 safety check, 503 \"capacity\" when the daily budget is used up. Errors are never charged. All params optional: with none it answers a short sample question....","last_updated":"2026-11-29T19:47:15.319Z","schemes":["exact"]}