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
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.List the live models
RunGET /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
Theusage 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 towardmax_tokens.
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.