Skip to main content
Model APIs are open-weight models we host for you, called over an OpenAI-compatible HTTP API. Base URL 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

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 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 at usage.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 toward max_tokens.
Reasoning models: output budgetreasoning tokens are billed outputmax_tokens: 2048budget exhaustedThe whole budget went to reasoning. content comes back empty, and the tokens are still billed.max_tokens: 16384answer deliveredreasoninganswerEach reasoning model’s page publishes its recommended minimum.Measured 2026-08-14 on this endpoint: at 2,048 tokens both public models returned an empty ortruncated answer, still billed. DeepSeek V4 Flash needs 16,384. Segment widths are illustrative.
Reasoning models: output budgetreasoning tokens are billed outputmax_tokens: 2048budget exhaustedThe whole budget went to reasoning. content comes back empty, and the tokens are still billed.max_tokens: 16384answer deliveredreasoninganswerEach reasoning model’s page publishes its recommended minimum.Measured 2026-08-14 on this endpoint: at 2,048 tokens both public models returned an empty ortruncated answer, still billed. DeepSeek V4 Flash needs 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.

Errors

What each refusal means and whether to retry.