Nebius TF Relay

NEBIUS TF RELAY / DOCS

Documentation

Everything you need to run your coding agents on Nebius Token Factory, with optional Tavily web search.

What it does

Nebius Token Factory serves open models over an OpenAI-compatible API. It does not speak the Anthropic Messages API that Claude Code uses, nor the OpenAI Responses API that Codex uses. The relay runs a small local daemon that translates those wire formats to Nebius /chat/completions on the fly - your agent believes it is talking to its native backend, while every token is served by Nebius.

Proxied harnesses

Claude Code and Codex. The daemon translates each request and response, tracks cost, retries transient failures, trims context to fit, and emulates native web search.

Spawned harnesses

Everything else. Launched with a generated provider config pointed at Nebius - no proxy needed, since they already speak the OpenAI-compatible format.

CLI launches use temporary provider settings. The optional Codex / ChatGPT Desktop integration manages a persistent config separately; nebiusrelay chatgpt offrestores that integration.

Install

The one-liner installs nebiusrelay plus a short alias per harness into ~/.nebiusrelay/bin/, and installs Bun for you if it is not already present.

curl -fsSL https://nebius-tf-relay.vercel.app/install.sh | bash

First run walks you through configuration, or run it directly:

nebiusrelay configure

You will be asked for two keys:

KeyWhere to get itRequired
Nebius API keytokenfactory.nebius.comYes
Tavily API keyapp.tavily.comOptional - enables web search
Keys are saved in ~/.nebiusrelay/config.json and used to authenticate requests to Nebius and Tavily. In an interactive terminal, a missing agent can be installed after you confirm its displayed install command. Non-interactive runs print installation instructions.

Harnesses

Launch any of them directly. Extra arguments are passed straight through to the underlying agent.

HarnessCommandModeNotes
Claude CodenclaudeProxiedAnthropic Messages API translated to Nebius.
Codex CLIncodexProxiedOpenAI Responses API translated to Nebius.
OpenCodenopencodeSpawnedNebius wired in as an OpenAI-compatible provider.
Pi CodenpiSpawnedCustom Nebius provider in a temporary config directory.
Prime AgentnprimeSpawnedPrimeIntellect's RLM agent on Nebius models.
Hermes AgentnhermesSpawnedNous Research's agent, isolated home overlay.
DeepSeek HarnessndeepseekSpawnedDeepSeek's web profile with Nebius layered in.
Grok BuildngrokSpawnedxAI's terminal harness; your key never reaches api.x.ai.
nclaude -p "explain this repo"

Commands

CommandWhat it does
nebiusrelayInteractive launcher - pick a harness.
nebiusrelay configureSet your API keys.
nebiusrelay usage --last 7dLocal spend by model and tool. Never uploaded.
nebiusrelay updateUpdate to the latest release now.
nebiusrelay daemon installStart the daemon at login (launchd / systemd).
nebiusrelay daemon statusShow auto-start status.
nebiusrelay daemon stopStop the running daemon.
nebiusrelay chatgpt offRestore your previous Codex / ChatGPT config.

ChatGPT / Codex Desktop (alpha)

The released CLI includes nebiusrelay chatgpt (alias: codex-app) for compatible desktop coding tasks. It configures a local Responses provider in ~/.codex/config.toml, writes a model catalog, and attempts to open the desktop app.

nebiusrelay chatgpt
This integration is explicitly alpha in the CLI. It uses a provider-auth workaround and changes persistent configuration shared with Codex CLI, unlike the temporary settings used by the harness wrappers. It does not change the model selection for ordinary ChatGPT web chats. Desktop compatibility depends on the installed app version.

Restore the backed-up configuration when you are finished:

nebiusrelay chatgpt off

Models

The model list is fetched live from Nebius at startup, so every model they serve is available and each model's vision support comes from the API's own modality field - never a hand-maintained list. Results are cached locally and fall back to a bundled snapshot when offline.

ModelBest forContextVision
GLM 5.3 FlashDEFAULTFast, very low cost, agentic1MNo
GLM 5.3Coding, reasoning, tool use1,024KNo
DeepSeek V4 Pro 0813Reasoning and agentic coding979KNo
Kimi K3Frontier coding + agentic1MNo
Kimi K2.6Vision flagship262KYes
Kimi K2.7 CodeCoding262KNo
MiniMax M3Fast, cheap196KNo
Qwen 3.5 397BGeneral / coding flagship262KNo
DeepSeek V4 FlashFast DeepSeek V41MNo
DeepSeek V4 ProLong-context reasoning1MNo
Qwen2.5-VL 72BVision fallback32KYes

Relay 0.15.4 adds bundled support for GLM 5.3 and DeepSeek V4 Pro 0813. GLM 5.3 Flash remains the default. Select either new model explicitly:

nebiusrelay --model zai-org/GLM-5.3 codex
nebiusrelay --model deepseek-ai/DeepSeek-V4-Pro-0813 codex
In Codex, select a vision-capable model before attaching images. Claude Code uses a separate vision-description path. Image input controls depend on your harness and terminal.

Images & vision

In Relay 0.15.3 and later, select a vision-capable model explicitly when launching Codex. The default GLM model is text-only. Image options belong to Codex, not every harness; other agents keep their native attachment controls.

ncodex --model moonshotai/Kimi-K2.6

Use Codex's clipboard-image shortcut where your terminal supports it. Normal terminal paste may paste text only; the relay does not monitor your clipboard. For a reliable file-based alternative, save the image on the machine running Codex:

ncodex --model moonshotai/Kimi-K2.6 --image "/path/to/screenshot.png" "Describe this image"
A plain file path in prompt text is not the same as attaching image bytes. Use the native image option and a model whose catalog lists image input. Clipboard access may be unavailable over SSH or in some terminal environments.

Cost metering

Claude and Codex are proxied, so the daemon meters every turn. The other harnesses hold the key and call Nebius directly, which is why they report $0.00. NEBIUSRELAY_METER=1 points them at the daemon instead:

NEBIUSRELAY_METER=1 npi --print "..."
Nebius TF Relay ▸ Launching Pi Code with Nebius Token Factory.
[nebiusrelay cost] session total: $0.0056 (1,518 in, 69 out)

They then share the same client as everyone else - automatic model fallback, the per-model circuit breaker, transient-fault retries - and the real Nebius key stays inside the daemon, since the harness only ever sees a local session token. If the daemon is unreachable the launcher says so and connects directly, so metering can never be the reason a session fails to start.

Environment

VariableEffect
NEBIUS_API_KEYNebius Token Factory key (or set it via configure).
TAVILY_API_KEYEnables web search (or set it via configure).
NEBIUS_BASE_URLOverride the API base. Default https://api.tokenfactory.nebius.com/v1.
NEBIUSRELAY_REASONING_EFFORTnone | low | medium | high | max. Default none for speed; raise it for harder tasks.
NEBIUSRELAY_FALLBACK_MODELModel to fail over to when the target returns no response headers. Default moonshotai/Kimi-K2.6; set off to disable.
NEBIUSRELAY_METER=1Route the spawned harnesses through the daemon so they get cost metering, model fallback and retries. Off by default.
NEBIUSRELAY_REASONING_HISTORYfull (default) | interleaved | off. How much prior reasoning is replayed each turn. off is cheapest on long sessions.
NEBIUSRELAY_CACHE_READ_RATIOPrice of a cached input token as a fraction of the input price. Default 1, since Nebius publishes no cached rate - so the total is an upper bound.
NEBIUSRELAY_CODEX_MEMORY_MODELModel that summarizes Codex traces for durable memory. Defaults to MiniMax M3.
NEBIUSRELAY_DISABLE_AUTOUPDATE=1Stop the installed binary from self-updating.
NEBIUSRELAY_TELEMETRY_URLOpt in to telemetry by pointing at your own collector. Off by default.

Troubleshooting

Configuration crashes or cannot read a key

Update the installed CLI, then run configuration again in an interactive terminal. Required keys cannot be blank; press Enter to skip the optional Tavily key.

nebiusrelay update
nebiusrelay configure
Command not found after installation

Open a new terminal so your shell picks up the installer's PATH change. You can also run the installed executable directly:

~/.nebiusrelay/bin/nebiusrelay configure
Web search says TAVILY_API_KEY is not set

Add a Tavily key with nebiusrelay configure, then launch a new agent session. A Nebius key alone does not enable web search.

A spawned agent reports zero cost

Enable daemon metering for that launch. See Cost metering for details.

NEBIUSRELAY_METER=1 npi

For AI agents

An LLM-readable doc is published at llms.txt. If you are an agent asked to install, configure or drive nebiusrelay - including headless - read that first. It covers install, configure, every command, the models, and headless usage patterns.