LLM chat completion
llm-chat_v1Returns 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).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messages | Yes | Conversation so far, oldest first; the last one is usually from the user | |
| maxTokens | No | Maximum tokens to generate (1-4096, 512 when omitted); billed as requested | |
| temperature | No | Sampling temperature (0-2); lower is more deterministic |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||