https://api.runinfra.ai/v1, a workspace API key, POST /chat/completions. You pay per token from your workspace balance, and new accounts start with $1 of credit.
1
Get a workspace API key
Open the Model Library, pick a model, and create or reveal a workspace key on its page. 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 model ids
deepseek-v4-flash, deepseek-v4-pro, qwen3-8-27b, qwen3-8-2-4t-a95b, nemotron-3-5-lightning-30b, ornith-1-5-35b.
Any of these goes in the model field. GET /v1/models is the authoritative live list, each model’s page in the Model Library carries its prices and limits, and what each model supports is one table.
How usage is counted
The serving engine’s own token count is the billing count. For chat completions, cached input appears atusage.prompt_tokens_details.cached_tokens when the engine reports it. 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 engine because it may use a different tokenizer revision or omit the exact chat template, special tokens, and media preprocessing applied by the serving stack. 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.
Errors
What each refusal means and whether to retry.