POST /v1/chat/completions at https://api.runinfra.ai/v1 with a workspace API key.
1
Get a workspace API key
Open the Model Library, pick a model, and select Get API key. The secret is shown once.
2
Put the key in your environment
3
Make the call
What comes back
What comes back
A normal completion. Token counts and ids are illustrative; Check
reasoning carries the model’s thinking, and content carries the answer.finish_reason before you use content. stop means the model finished on its own. length means it hit the output budget, and on a reasoning model that can leave content empty with the budget spent on thinking, which is what the next section is about.The live chat model ids
deepseek-v4-flash, deepseek-v4-pro, glm-5-3-flash, nemotron-3-5-lightning-30b, ornith-1-5-35b, qwen3-8-27b, qwen3-8-2-4t-a95b, qwen3-8-flash-next.
Any of these goes in the chat model field. GET /v1/models is the authoritative live list. Each model’s page in the Model Library carries its accepted input, prices, and limits.
How usage is counted
The token counts in the responseusage object are the billing counts. For chat completions, cached input is reported at usage.prompt_tokens_details.cached_tokens on models that publish a cached-input price, when a cached count is available for the request. Those tokens remain part of prompt_tokens and are billed at the model’s cached-input rate.
A client-side tokenizer can disagree with the billed count because it may use a different tokenizer revision or omit the exact chat template, special tokens, and media preprocessing that are applied when the request is served. Use the response usage fields and the usage dashboard for reconciliation.
Why max_tokens is 16,384
These models reason before they answer, and reasoning tokens are billed output that count towardmax_tokens.
You pay for what is generated, not for the ceiling you allow, so a generous ceiling costs nothing and a small one can cost you a whole request.
Next steps
Chat completions
Every field the gateway forwards, validates, or drops.
Streaming
Read deltas and ask for the usage frame.
Models
Discover the ids your key can call.
Claude Code
Run Claude Code through the Anthropic-compatible API.