Skip to main content
This quickstart calls the OpenAI-compatible POST /v1/chat/completions at https://api.runinfra.ai/v1 with a workspace API key.
Using a coding agent? Your agent can set up RunInfra’s open models for you. Copy the prompt from Set up with your coding agent.
1

Get a workspace API key

Open the Model Library, pick a model that is not marked Paused, and select Get API key. If you already have a key you can copy, the page highlights that key’s copy button instead of making another one.
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.

List the live models

Run GET /v1/models for the current list; a model that is temporarily paused is reported there and on its Model Library page.

How usage is counted

The usage counts in the response are the billed counts; a local tokenizer can count differently. Cached input is part of prompt_tokens, shows in usage.prompt_tokens_details.cached_tokens on models with a cached-input price, and bills at that rate.

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 settle at zero.max_tokens: 16384answer deliveredreasoninganswerMeasured 2026-08-14: at 2,048 tokens the answer came back empty or truncated. 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 settle at zero.max_tokens: 16384answer deliveredreasoninganswerMeasured 2026-08-14: at 2,048 tokens the answer came back empty or truncated. Segment widths are illustrative.
You pay for what is generated, not for the ceiling, so a generous ceiling costs nothing extra and a small one can leave you without an answer.

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.

Coding agents

Paste one prompt. Your coding agent sets up RunInfra’s open models for you.