{"service":"llm-chat","version":"1.0.0","title":"LLM chat completion","description":"Returns JSON with a chat completion from IBM Granite 4.0 Micro on Workers AI, with token usage. Use when you need an llm chat completion for summaries, extraction or classification and can poll an async job. Do not use when you need a frontier model, tool calling or streaming. Price: 0.002 USDC per thousand tokens, up to 0.03 USDC per call (clients without upto pay the cap). Asynchronous: the paid call returns a jobId and a free pollUrl; typical job time: 8000 ms (p95).","paid":{"method":"POST","url":"https://x402-gateway.blackwoodstate8.workers.dev/v1/llm-chat","scheme":"upto","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"30000","amountUsdc":"0.03","payTo":"0xB7EEC07C045c7Be0C65e0b0526E1afD333e0fa7e","maxTimeoutSeconds":60,"pollUrl":"https://x402-gateway.blackwoodstate8.workers.dev/v1/llm-chat/jobs/:jobId","unit":"thousand tokens","unitAmount":"2000","unitUsdc":"0.002","exactFallback":"30000"},"input":{"schema":{"type":"object","properties":{"messages":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"],"description":"Who wrote the message"},"content":{"type":"string","minLength":1,"maxLength":32000,"description":"Message text"}},"required":["role","content"]},"description":"Conversation so far, oldest first; the last one is usually from the user"},"maxTokens":{"description":"Maximum tokens to generate (1-4096, 512 when omitted); billed as requested","type":"integer","minimum":1,"maximum":4096},"temperature":{"description":"Sampling temperature (0-2); lower is more deterministic","type":"number","minimum":0,"maximum":2}},"required":["messages"]},"example":{"messages":[{"role":"user","content":"In one sentence, what is the x402 payment protocol?"}],"maxTokens":80}},"output":{"schema":{"type":"object","properties":{"jobId":{"type":"string","minLength":1,"maxLength":100},"pollUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","description":"ISO 8601: depois disso o resultado deixa de existir"},"status":{"type":"string","const":"queued"}},"required":["jobId","pollUrl","expiresAt","status"],"additionalProperties":false},"example":{"jobId":"job_00000000000000000000000000000000","pollUrl":"https://gateway.example/v1/llm-chat/jobs/job_00000000000000000000000000000000","expiresAt":"2026-01-31T00:00:00.000Z","status":"queued"}},"mcp":{"url":"https://x402-gateway.blackwoodstate8.workers.dev/mcp","tool":"llm-chat_v1"},"openapi":"https://x402-gateway.blackwoodstate8.workers.dev/openapi.json"}