Skip to main content
Choose your provider below and add its block to the .env file beside your Docker Compose file before you start the platform. Keep the RELAI_AGENT_*, RELAI_OPTIMIZER_*, and RELAI_MODEL_PROXY_* settings from the chosen block. They configure the different parts of RELAI that make model requests. Only edit the values in angle brackets — replace each <...> placeholder with your own value before starting the containers. Every other value is a fixed constant; leave it exactly as shown. .env.template already contains RELAI_MODEL_PROXY_MODEL and RELAI_MODEL_PROXY_CONTEXT_WINDOW_TOKENS. Replace those two lines with the ones from your block rather than adding a second copy.
Create a project API key in the OpenAI Platform, then add:
All three blocks are needed. The third configures the model proxy that relai init uses; without it, relai init stops with “The model proxy configuration is invalid”.
In case you want to change the provider block in .env on a running deployment, recreate the affected services to apply the change:

Model proxy settings

From backend version 1.72.0, the model proxy has no default model, so every provider block above includes these two settings:
  • RELAI_MODEL_PROXY_MODEL — the model or deployment the proxy calls.
  • RELAI_MODEL_PROXY_CONTEXT_WINDOW_TOKENS — that model’s context window, as a positive whole number of tokens (for example, 272000). Use the real limit of your deployment. RELAI passes this value to the CLI and never guesses it from the model name.

Reasoning effort

RELAI_MODEL_PROXY_REASONING_EFFORT sets how much the model reasons before it answers: none, minimal, low, medium, high, or xhigh. RELAI’s agent needs reasoning to plan multi-step work such as relai init. Default reasoning varies by model, and some models don’t reason at all unless you set it, so agent quality can drop sharply without it. From backend version 1.74.0, leaving it blank means medium for OpenAI and Azure OpenAI GPT-5 models, and the provider’s default for everything else. Set it explicitly when the model name doesn’t identify the model, such as an Azure deployment you named yourself.

Which API the proxy calls

RELAI_MODEL_PROXY_WIRE_API (backend 1.74.0 or later) chooses how the proxy reaches OpenAI-compatible providers:
  • auto (default) — leaves the choice to the proxy’s model library.
  • responses — calls the Responses API directly. Use this for Azure OpenAI. Reasoning models that call tools work best on the Responses API, and on Azure the default routing can return cut-off responses that relai init reports as “The configured model is unavailable”.
  • chat_completions — keeps every call on Chat Completions.
With responses, the proxy sends an output budget of 32,000 tokens (reasoning included). Set RELAI_MODEL_PROXY_MAX_OUTPUT_TOKENS to change it. If a required value is missing or invalid, relai init stops with “The model proxy configuration is invalid”. Fix the value in .env, then recreate the services as shown above.

Use Django Admin instead

You can configure the same values in Django Admin under Agent Studio. Add and enable a Generation Runtime Config and an Optimizer Runtime Config, using the provider and model values from the matching block above. An enabled Admin entry takes precedence over .env for that setting.

Verify the setup

With backend version 1.74.0 or later, check the model proxy before you run relai init:
It sends one small request with a tool through the proxy and prints the model, the API, and the reasoning effort in use, then OK tool_call=yes on success. On failure it prints the error code, for example FAIL code=provider_unavailable. After applying your changes, run a small task in RELAI. If it fails, check that the model or deployment name, endpoint, region, and credential are correct. Container logs identify the provider and model used, but should never contain the key itself.