---
title: "Backends"
id: "1696"
type: "page"
slug: "backends"
published_at: "2026-09-20T19:50:18+00:00"
modified_at: "2026-09-21T01:36:28+00:00"
url: "https://xedant.com/agents/agent/docs/backends"
markdown_url: "https://xedant.com/agents/agent/docs/backends.md"
excerpt: "Xedant Agent has the concept of a backend — the “engine”, the program that actually…"
---

# Backends

[https://xedant.com/agents/agent/docs/backends.md](https://xedant.com/agents/agent/docs/backends.md)

Xedant Agent has the concept of a **backend** — the “engine”, the program that actually executes your tasks: reads files, edits code, runs commands. The application is not tied to one engine: it wraps any such agent and turns it into a full web interface with chat, files, version comparison (diff), builds, sessions, and analytics. **Ten built-in backends** are available out of the box — **Claude Code** (the default), **Codex**, **OpenCode**, **Pi**, **Oh My Pi**, **Reasonix**, **DeepSeek Harness**, **Kimi Code**, **MiniAgent**, and **Command Code** — and hooking up any new one takes about a day on request. MiniAgent is the only backend without an external program: it is built directly into Xedant Agent, so there is nothing to install.

All backends are built the same way (a single internal `IAgentBackend` interface), so they all look the same to you: the same chat interface, the same skills, hooks, builds, and statistics. Only the “engine” under the hood changes — which executable actually runs for each message. Skills still load automatically: the requirement is delivered to every backend over its own out-of-band channel — a system prompt line, a launch flag, an environment variable, or a file bound to the chat (details on the [Skills](/agents/agent/docs/skills)
 page).

## How it works

The backend is chosen by the `AGENT_BACKEND` variable, which is set in the **model’s** configuration (see [Models](/agents/agent/docs/models)
). The choice follows the same rules as the other variables:

1. The model selected for the chat is taken;
2. If none is set, the `selectedModel` setting is used;
3. If that is missing too, the `default` model is taken;
4. `AGENT_BACKEND` is read from the resulting set of variables. If it is missing, `claude-code` is used.

Allowed values: `claude-code` (the default), `codex`, `opencode`, `pi`, `oh-my-pi`, `reasonix`, `deepseek-harness`, `kimi-code`, `mini`, `command-code`. So you can switch the engine per chat — just change the chat’s model.

**Automatic installation.** If the required executable is not on the machine, Xedant Agent installs it itself on the first message (through the npm package manager) and streams the progress live right into the chat. You usually do not need to install anything manually. The exception is MiniAgent: it needs no external program at all, because it is built into Xedant Agent itself.

## Built-in backends

- **Claude Code** — package `@anthropic-ai/claude-code`. The base backend, and the default. Full support: internal proxy, subagents, skills, model switching.
- **Codex** — package `@openai/codex`. GPT-5 models from OpenAI. Sign in with a ChatGPT subscription (Go/Plus/Pro, flat-rate) or use a prepaid API key. *Tested as excellent — works fully.*
- **OpenCode** — package `opencode-ai`. The universal engine: connect any provider you like (Anthropic, OpenAI, Gemini, a local model).
- **Pi** — package `@earendil-works/pi-coding-agent`. A minimal, extensible agent from pi.dev. Works with any provider on your own key.
- **Oh My Pi** — package `@oh-my-pi/pi-coding-agent`. An extended Pi from omp.sh: the same capabilities plus ready presets and tools out of the box.
- **Reasonix** — package `reasonix`. An agent built for DeepSeek (reasonix.io): DeepSeek-V4 Flash/Pro models, a huge context — 1 million tokens. DeepSeek key, no subscription. *Tested as excellent — works fully.*
- **DeepSeek Harness** — DeepSeek’s own open agent (deepseek-harness). An “everything is a plugin” architecture: the core loop, tools, and the DeepSeek adapter all plug in. DeepSeek-V4 Flash/Pro models, 1 million tokens of context. DeepSeek key, no subscription.
- **Kimi Code** — package `@moonshot-ai/kimi-code`. An agent from Moonshot AI (kimi.com). Works with Kimi models or any compatible provider on your own key.

## How to connect a backend

Connecting one comes down to creating a model with the right `AGENT_BACKEND` variable and the target engine’s credentials:

1. Open **Settings → Models** and press “Create”;
2. Pick a ready provider template — **Codex**, **Reasonix**, **OpenCode**, **Pi**, **Oh My Pi**, **DeepSeek Harness**, or **Kimi Code**; for MiniAgent — a provider template that supports this backend (Anthropic, DeepSeek, z.ai, and others), and for Command Code — a **Custom** type model (it has no ready template). The templates already carry `AGENT_BACKEND` and the variables you need;
3. Fill in the API key (the secret access key) or sign in (for Codex — the `/login` button with a ChatGPT subscription);
4. Select that model for a chat — the executable installs automatically on the first message.

Or create a **Custom** model and set the variables manually — this gives you full control. Example for Codex:

```
AGENT_BACKEND=codex
CODEX_API_KEY=$CODEX_API_KEY      # or sign in with ChatGPT instead of a key
MODEL=gpt-5.6-sol
```

## Claude Code (the default)

The base backend everything else runs on. Package `@anthropic-ai/claude-code` (2.1.217 by default), executable `claude`. Supports the internal proxy server for traffic logging and cost accounting, subagents, skills, and switching between Opus/Sonnet/Haiku models on the fly.

**Two ways to sign in**, controlled by the `ANTHROPIC_AUTH` variable:

- **Claude subscription** (`ANTHROPIC_AUTH=claude`) — runs on your Claude plan (Pro/Max) with no per-token billing. No key needed: when a chat uses such a model, a **“Sign in with Claude”** prompt appears at the bottom of the chat with the explanation “Use your Claude plan (Pro/Max) with Claude Code”. Click it, open the “Open Claude sign-in” link, sign in to your Claude account, and paste the code you receive into the field — after a successful login you will see “Signed in with Claude”, and chats start running on the subscription;
- **Access key** — `ANTHROPIC_API_KEY` (a direct Anthropic key) or `ANTHROPIC_AUTH_TOKEN` (a token for compatible proxies, z.ai for example); the provider address is set with `ANTHROPIC_BASE_URL`.

## Codex

Codex CLI from OpenAI — GPT-5 models. Package `@openai/codex` (0.146.0 by default), executable `codex`, launched as `codex exec --json`: one process per message, events arrive as a stream in the NDJSON text format (one record per line), and the run ends when the process exits. Sessions are saved and resumed through `resume`.

**Two ways to sign in**, controlled by the `CODEX_AUTH` variable (`auto` by default):

- **ChatGPT subscription** (`CODEX_AUTH=chatgpt`) — flat-rate use on the Go/Plus/Pro plan. You sign in with the `/login` command: the `auth.openai.com` link opens, you enter a code, and the account is stored in `~/.codex/auth.json`. Subscription usage is tracked by a built-in service.
- **API key** (`CODEX_AUTH=apikey`, or when there is no login) — prepaid credits. The variables `OPENAI_API_KEY`/`CODEX_API_KEY` and optionally `OPENAI_BASE_URL` for a proxy.

In `auto` mode (the default) Xedant Agent picks by itself: if a ChatGPT login exists, the subscription is used; otherwise — the API key.

Available models: `gpt-5.6-sol` (flagship), `gpt-5.6-terra` (balanced), `gpt-5.6-luna` (fast and affordable). Set with the `MODEL` variable.

**Codex is tested as excellent and works fully** — chat, tools, sessions, analytics, and subscription quota tracking.

## OpenCode

The universal engine from opencode.ai. Package `opencode-ai` (current version), executable `opencode`, launched as `opencode run --format json`. An alternative one-script install: `curl -fsSL https://opencode.ai/install | bash`.

Sign-in — **your own provider key** (no subscriptions):

- `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY` — the key of the provider you need;
- `LOCAL_ENDPOINT` — for a local model;
- any variable with the `OPENCODE_` prefix.

The model is set in the “provider/model” format, for example `MODEL=anthropic/claude-sonnet-4-20250514`.

## Pi

A minimal, extensible agent from pi.dev. Package `@earendil-works/pi-coding-agent` (current version), executable `pi`, launched in `pi --mode rpc` mode — Xedant Agent talks to it over an RPC protocol (commands like `set_model`), sessions are saved in the JSONL text format (one record per line) and resumed after a restart.

Sign-in — **your own provider key**, as with OpenCode:

- `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `LOCAL_ENDPOINT`;
- any variable with the `PI_` prefix.

The model — in the “provider/model:thinking” format, for example `MODEL=anthropic/claude-sonnet-4-20250514:medium` (the `:thinking` suffix sets the reasoning level).

## MiniAgent

MiniAgent is the **built-in backend**: not an external program but a C# library compiled right into Xedant Agent (a minimal Pi-style coding agent fully rewritten in C#). No external process is launched and no npm package is installed — the backend is always “at hand” for the server. Selected with `AGENT_BACKEND=mini`.

Its capabilities are like Pi’s: the tools `read`, `write`, `edit`, `bash`, `grep`, `find`, `ls` plus `glob` and skill loading with `load_skill`, JSONL sessions that resume after a restart, model and reasoning-level switching on the fly, automatic context compaction, retries on transient failures, and cost accounting. Tools run sequentially, as in Claude Code. On top of that, MiniAgent supports named settings profiles (the `miniagent.yml` file, overridden by the `MINI_PROFILE_*` variables) and the `parallel_bash` tool for running commands in parallel — see the [MiniAgent](/agents/agent/docs/mini-agent)
 page for details.

The model is set in the “provider/model:thinking” format, for example `MODEL=anthropic/claude-sonnet-5:medium` (the `:thinking` suffix sets the reasoning level: `off`, `minimal`, `low`, `medium`, `high`). The ready provider templates — Anthropic, DeepSeek, z.ai, BigModel, OpenRouter, xAI, MiniMax, Moonshot, OpenAI, OpenCode Go/Zen — already carry the MiniAgent backend and its parameters: `MINI_BASE_URL` (the address), `MINI_API` (the protocol format — `anthropic-messages` or `openai-completions`), `MINI_AUTH` (`api-key` or `bearer`), and `MINI_API_KEY` (the key). Any model the templates do not know is assembled automatically from these parameters, or — when a `~/.mini/models.json` file exists — from it (a format compatible with Pi). If no model is set at all, `deepseek/deepseek-v4-flash` is used by default.

MiniAgent’s data lives in the `~/.mini` folder (overridable with the `MINI_AGENT_DIR` variable): `models.json` — the model configuration, `agent-sessions` — sessions (JSONL, resumed after a restart), `skills` — extra skills and the global `CLAUDE.md`.

Out of the box, MiniAgent does by itself what other backends need configured: it reads the project’s `CLAUDE.md`/`AGENTS.md` (`CLAUDE.md` takes priority), finds the `.claude/skills` skills on its own, and documents the interactive forms and buttons (`agent.form`/`agent.button`) right in the system prompt. Passing images into the chat is not wired up yet — images are ignored on send with a warning in the log.

**[Full overview of MiniAgent’s capabilities and setup →](/agents/agent/docs/mini-agent)**

## Reasonix

A coding agent built for DeepSeek (reasonix.io). Package `reasonix` (current version), executable `reasonix`, launched as `reasonix run --output-format stream-json --auto`: one process per message, events arrive as a stream (NDJSON), and the run ends when the process exits. Sessions are saved as JSONL and resumed with `--resume`.

Sign-in — **a DeepSeek key** (no subscription, prepaid credits):

- `DEEPSEEK_API_KEY` — the key for `api.deepseek.com`;
- for any OpenAI-format provider (OpenRouter and the like) — `REASONIX_BASE_URL`, `REASONIX_API_KEY`, and the model (`REASONIX_MODEL` or `MODEL`).

Reasonix reads provider keys **only** from its own config (`<REASONIX_HOME>/.env`), not from environment variables — but Xedant Agent writes the permitted keys there itself before launch, so you never configure anything by hand.

The DeepSeek models — Flash (fast, the default) and Pro. The context is 1 million tokens. Set with the `MODEL` variable in the “provider/model” format (for example `deepseek/deepseek-v4-pro`); the ready Reasonix environment templates already carry the right value.

**Reasonix is tested as excellent and works fully** — chat, tools, reasoning, sessions, and analytics.

## Oh My Pi

An extended version of Pi from omp.sh. Package `@oh-my-pi/pi-coding-agent`, executable `omp`, launched in `omp --mode rpc` mode — the same RPC protocol as Pi, so the capabilities are identical: sessions, model switching, tools. The differences are the set of ready presets and tools “out of the box”, plus it stores sessions in its own folder `~/.omp/agent/sessions`.

Sign-in — **your own provider key**, as with Pi:

- `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `LOCAL_ENDPOINT`;
- any variable with the `OMP_` prefix (for example `OMP_PROVIDER` — the default provider when the model does not name one).

The default model is `anthropic/claude-sonnet-5`. The reasoning level is set separately after the process starts, so the `:thinking` suffix in the model name is not needed.

## DeepSeek Harness

DeepSeek’s own open agent (github.com/deepseek-ai/deepseek-harness, dsh for short). Its signature trait is the “everything is a plugin” architecture: the core loop, tools, and the DeepSeek adapter all plug in. Xedant Agent runs it as one persistent process per chat and talks to it over the JSON-RPC protocol (function calls in text form): tokens, tool calls, task lists, and cost arrive in the chat in real time.

**First launch.** The executable is not installed through npm: on first use Xedant Agent provisions a managed runtime folder itself (`~/.dsh/agent-runtime` under the server user’s home), installs a pinned set of packages, and generates the config. Node.js 22.19+ or 24+ is required — the installer checks this up front.

Sign-in — **a DeepSeek key** (no subscription, prepaid credits):

- `DEEPSEEK_API_KEY` — the key for `api.deepseek.com`;
- `DEEPSEEK_BASE_URL` — the address of another OpenAI-format provider (by default — DeepSeek directly).

The models — `deepseek-v4-flash` (fast, the default) and `deepseek-v4-pro` (deeper) — are set with the `DSH_MODEL` variable. The context is 1 million tokens. Switching the model restarts the agent process.

DeepSeek Harness subagents open as separate child chats (as with Claude Code), task lists render as checklists, and cost is computed from DeepSeek’s prices with caching accounted for. After a pause or restart, the agent receives a short recap of the previous dialog — the files on disk remain the main result of the work.

*DeepSeek Harness is in active development (a preview version). Package versions are pinned, so updating is a deliberate act — through the `DSH_RUNTIME_VERSION` variable.*

## Kimi Code

A coding agent from Moonshot AI (kimi.com). Package `@moonshot-ai/kimi-code`, executable `kimi`, launched as `kimi -p "<prompt>" --output-format stream-json`: one process per message, events arrive as a stream (NDJSON), and the run ends when the process exits. Sessions are saved and resumed through `--session`. Node.js 22.19+ is required.

Sign-in — through **the model channel variables** (this is the only way Kimi Code accepts a key from environment variables — it ignores a plain `KIMI_API_KEY`):

- `KIMI_MODEL_NAME` — the model name (this variable’s presence turns the channel on);
- `KIMI_MODEL_API_KEY` — the provider key;
- `KIMI_MODEL_BASE_URL` — the provider address (by default — the Kimi provider);
- `KIMI_MODEL_PROVIDER_TYPE` — the protocol format: `kimi`, `anthropic`, or `openai`;
- `KIMI_MODEL_MAX_CONTEXT_SIZE` — the context size in tokens (262144 by default).

Instead of a key, you can use an existing OAuth login (browser authorization) stored in `~/.kimi-code`. The ready provider templates (Anthropic, DeepSeek, Moonshot, and so on) already carry the right values — nothing to configure by hand.

## Command Code

A coding agent from Langbase (commandcode.ai) — a cross-platform terminal agent with closed source. Package `command-code`, executable `cmd` (on Windows — `cmdc`), launched as `cmd -p "prompt" --output-format json`: one process per message, events arrive as a stream (NDJSON), and the run ends on the result line. Node.js 22+ is required.

Writing, editing files, and shell commands in headless mode are **forbidden** by default — Xedant Agent launches Command Code with the `--yolo` flag, which enables them. Sessions are not saved to disk: the dialog context travels inside every new message.

Sign-in — **only through a Command account** (a subscription or a prepaid API key; Anthropic/OpenAI/DeepSeek keys are not accepted):

- `cmd login` — sign-in through the browser (OAuth); the account is stored in `~/.commandcode`;
- `COMMAND_CODE_API_KEY` — the Command Code API key; set in the model configuration and takes priority over the login.

The model is set with the `MODEL` variable (a Command account gives you 30+ models). If no model is set, `cmd` uses its own default; an unknown model name is an error, so check the spelling. Tokens and cost arrive in each reply’s result line and land in the chat and analytics.

Command Code looks for its own skills in the `.commandcode/skills` and `.agents/skills` folders, so Xedant Agent adds a pointer to the `.claude/skills` skills to the prompt itself — “call the skill” works as usual.

## Variable reference

- **AGENT_BACKEND** — backend selection: `claude-code` (the default), `codex`, `opencode`, `pi`, `oh-my-pi`, `reasonix`, `deepseek-harness`, `kimi-code`, `mini`, `command-code`
- **CLAUDE_PATH / CODEX_PATH / OPENCODE_PATH / PI_PATH / OMP_PATH / REASONIX_PATH / KIMI_CODE_PATH / COMMAND_CODE_PATH** — the path to a specific executable (overrides auto-discovery)
- **CLAUDE_CODE_VERSION / CODEX_VERSION / OPENCODE_VERSION / PI_VERSION / OMP_VERSION / REASONIX_VERSION / KIMI_CODE_VERSION / COMMAND_CODE_VERSION** — pin a version for auto-installation
- **CODEX_AUTH** — how Codex signs in: `auto` (the default), `chatgpt`, `apikey`
- **OPENAI_API_KEY / CODEX_API_KEY** — a prepaid OpenAI key for Codex (+ `OPENAI_BASE_URL` for a proxy)
- **DEEPSEEK_API_KEY** — the DeepSeek key for Reasonix and DeepSeek Harness; or `REASONIX_BASE_URL` + `REASONIX_API_KEY` for an OpenAI-format provider (OpenRouter and the like)
- **DSH_MODEL** — the DeepSeek Harness model: `deepseek-v4-flash` (the default) or `deepseek-v4-pro`
- **DSH_RUNTIME_VERSION / DSH_RUNTIME_DIR / DSH_AGENT_PATH** — control of the dsh runtime (package version, runtime folder, an explicit executable path)
- **DSH_PERMISSION_MODE** — the dsh access mode: `danger-full-access` (the default) or `workspace-write` (stricter, with permission requests)
- **KIMI_MODEL_NAME / KIMI_MODEL_API_KEY / KIMI_MODEL_BASE_URL / KIMI_MODEL_PROVIDER_TYPE / KIMI_MODEL_MAX_CONTEXT_SIZE** — the Kimi Code model channel (see the section above)
- **COMMAND_CODE_API_KEY** — the Command Code API key (takes priority over the `cmd login` sign-in)
- **MINI_PROVIDER** — MiniAgent’s default provider when the model has no `provider/` prefix
- **MINI_BASE_URL / MINI_API / MINI_AUTH / MINI_API_KEY** — MiniAgent connection parameters for automatic model assembly: the provider address, the protocol format (`anthropic-messages` or `openai-completions`), the authorization type (`api-key` or `bearer`), and the access key
- **MINI_AGENT_DIR** — MiniAgent’s data folder (`~/.mini` by default): sessions, `models.json`, skills, the global `CLAUDE.md`
- **MODEL** — the model in the backend’s own format (a name for Codex and Command Code, `provider/model` for OpenCode, Pi, Reasonix, and MiniAgent)

## Installation and versions

By default the executables install automatically through npm on first use. If you need to install manually:

```
npm install -g @anthropic-ai/claude-code   # Claude Code
npm install -g @openai/codex               # Codex
npm install -g reasonix                    # Reasonix (or: brew install esengine/reasonix/reasonix)
npm install -g opencode-ai                 # OpenCode (or: curl -fsSL https://opencode.ai/install | bash)
npm install -g @earendil-works/pi-coding-agent  # Pi
curl -fsSL https://omp.sh/install | sh            # Oh My Pi (the npm package alone does not run)
npm install -g @moonshot-ai/kimi-code            # Kimi Code
npm install -g command-code                    # Command Code (executable cmd, on Windows — cmdc; Node.js 22+ required)
# DeepSeek Harness — no manual install: the runtime is provisioned automatically (Node.js 22.19+ or 24+ required)
# MiniAgent — nothing to install: it is built into Xedant Agent
```

You can pin the version with an environment variable (for example `CODEX_VERSION=0.146.0`) or point to the exact executable path with `*_PATH` — then auto-installation is not needed at all.

MiniAgent never needs installing: it is built into Xedant Agent itself, so it has no npm package, no version variable, and no separate executable.

## Status and support

- **Claude Code** — the default backend, works perfectly: full functionality without limits.
- **Codex is tested as excellent** — stable, fully functional: chat, tools, sessions, analytics, ChatGPT quota tracking.
- **Reasonix is tested as excellent** — stable, fully functional: chat, tools, DeepSeek reasoning, sessions, and analytics.
- **Kimi Code is tested as excellent** — stable work: chat, tools, sessions, analytics from the traffic log.
- **OpenCode, Pi, and Oh My Pi** are implemented and connect, but as newer backends they may have small rough edges. Any bugs in them are fixable within a couple of hours on request.
- **Command Code** — implemented and connects; as a new backend it may have small rough edges, and full testing with a live key is still ahead.
- **DeepSeek Harness** — a preview version from DeepSeek: in active development, versions pinned. Works: chat, tools, subagents, task lists, cost.
- **MiniAgent** — the built-in backend: works immediately, with no installation; chat, tools, sessions, cost, and analytics. It has passed a full test cycle — model switching, stop and resume, context compaction.
- **A new backend on request** — need to hook up another agent (Gemini CLI, Cursor, Aider, and the like)? The `IAgentBackend` architecture allows it: connecting any new backend takes about a day.

**← Back:** [Models](/agents/agent/docs/models)

**Next:** [MiniAgent](/agents/agent/docs/mini-agent)
 →
