Skip to main content
Model APIs are open-weight models we host for you. Chat completions and Responses are OpenAI-compatible. Messages is Anthropic-compatible. This quickstart uses 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

A normal completion. Token counts and ids are illustrative; reasoning carries the model’s thinking, and content carries the answer.
Check 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 response usage 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 toward max_tokens.
Reasoning models: output budgetreasoning tokens count toward max_tokensmax_tokens: 2048budget exhaustedThe whole budget went to reasoning: no answer. No-answer responses now settle at zero.max_tokens: 16384answer deliveredreasoninganswerEach reasoning model’s page publishes its recommended minimum.Measured 2026-08-14: at 2,048 tokens both public models returned an empty or truncated answer.Those probes billed output. DeepSeek V4 Flash: use 16,384. Segment widths are illustrative.
Reasoning models: output budgetreasoning tokens count toward max_tokensmax_tokens: 2048budget exhaustedThe whole budget went to reasoning: no answer. No-answer responses now settle at zero.max_tokens: 16384answer deliveredreasoninganswerEach reasoning model’s page publishes its recommended minimum.Measured 2026-08-14: at 2,048 tokens both public models returned an empty or truncated answer.Those probes billed output. DeepSeek V4 Flash: use 16,384. Segment widths are illustrative.
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.