Skip to content

Engines and costs

An engine is the coding agent a run uses. Kedalio drives each through its official CLI with its own login: a subscription’s token is never used against an API by Kedalio’s code. API keys are a separate, explicit kind of account.

Engine Logins What to know
Claude Code Claude subscription, or an Anthropic API key Its permission prompts become requests. It runs in its own sandbox, with a network allowlist.
Codex ChatGPT subscription, or an OpenAI API key Runs in its own sandbox without network and never asks, so it makes no requests. Its costs are not priced yet: they show as $0.
OpenCode An API key: Anthropic, OpenAI, OpenRouter, DeepSeek, or a local Ollama Runs in the host’s bubblewrap jail; its permission prompts become requests.
Pi An API key, as OpenCode Runs in the host’s bubblewrap jail, as OpenCode; its permission prompts become requests.

Hosts install the engines into their cache at the versions the server pins in its code (Claude Code at the version the plugin needs); KEDALIO_ENGINES (for example claude-code@2.1.0,codex@0.50.0) overrides an engine. No engine adds AI credit lines to the commits it makes.

Your agent and squads can use any engine above.

An engine account has a name (lower case, at most 40 characters), an engine, a kind (subscription or api-key) and its value, which goes to the vault and never comes out.

  • Claude subscription: the token claude setup-token prints on a computer where you use Claude Code.
  • ChatGPT subscription for Codex: the contents of Codex’s auth.json, after codex login.
  • An API key: the key, and for OpenCode the provider (anthropic, openai, openrouter, deepseek, or ollama with its address).

In the app: System → Accounts and costs → Add account. Pick the kind (Claude subscription, ChatGPT / Codex, or API key), follow the steps shown (for Claude, run claude setup-token in a terminal, sign in with that account in the browser it opens, and paste the token it prints), and save. The value is sealed in the vault and never shown again. The form offers Anthropic, OpenAI and OpenRouter keys; DeepSeek or a local Ollama for OpenCode and Pi are set through the API (PUT /api/engines/<name> with provider, and baseUrl for Ollama). Logins without a terminal (Claude’s token flow and Codex’s device code from the app) are not built yet.

Subscriptions have usage windows (5 hours, 7 days). Kedalio reads them from the engines’ own output during runs (Claude Code’s rate-limit events, Codex’s session log), and keeps the newest reading per account.

  • An account takes no new run only when the engine says its limit is reached (a window at 100%, until it resets), or when you set a cap on it and a fresh window is at or above it. The cap is off by default. Placement says why («Takes no new work»).
  • Priority: you order the accounts. When a run names no account, it goes to the first account in that order that the project’s data rules allow and that is not blocked. It is a preference: a brief can name another.
  • Pace: for each window the page shows how much you would have used if you spread it evenly until the reset, and whether you are under, on or over that pace. It is advice for spending the room about to reset; nothing is enforced by it.
  • A reading older than 30 minutes is stale. Before an unattended firing on a stale account, a tiny probe run («reply ok», the cheapest model) reads the windows again.
  • You get a notification when an account is blocked, when a window is about to expire, and when it resets.

In the app, Accounts and costs shows each account with its windows, pace, cap and the age of its reading, moves it up or down the order, sets its cap, and has Read now to probe one. From Claude or ChatGPT: limits shows windows, states and model tests; kedalio.limits_refresh probes the stale accounts.

Every project has a data class, and every engine account a destination, from its provider:

Class Its data may go to
client (the default) Anthropic, local
personal Anthropic, OpenAI, local, third parties
public Anthropic, OpenAI, local, third parties

Claude Code goes to Anthropic, Codex to OpenAI, Ollama is local, OpenRouter and DeepSeek are third parties. A project may also name the only accounts it may use. The server checks it wherever a run is placed. A project’s class is set with kedalio.project_set (dataClass, accounts); the table itself with kedalio.engine_rules_set.

OpenCode and Pi can run any model, and some models corrupt tool calls. So a model must pass a test before it may edit files: on a host, it writes a file, edits another and runs a command in a scratch repository. Placement refuses an editing run on a model that has not passed, and a new engine version tests it again. Claude Code and Codex are the reference and need no test. kedalio.engine_admit starts a test.

Every run records its usage and cost: the engine’s own figure when it gives one, zero for a local model, otherwise the list price of the model. A model with no known price is marked unpriced and counted as zero. The ledger is summed by run, squad, project, account, model or day with the costs tool. In the app you see the cost of each agent and of the squad against its budget, and in Accounts and costs what the runs cost each day, over the last seven days, split by project.

Kedalio ships orchestration skills that spend the cheapest model that passes the job:

  1. a router, a small model, answers with one label (haiku, sonnet, opus or fable) and one line of why;
  2. the chosen model works;
  3. a verifier checks the result against objective criteria (tests, build, the brief’s «done»): ok goes on, doubtful is checked again by a stronger model, failed climbs one step, with the failure as context.

The ladder is Claude’s: Haiku, Sonnet, Opus, Fable; a step the data rules or the limits refuse is skipped. A squad uses it when its leader is started with the cascade recipe. A model card skill says what each model is good at, its cost and how to instruct it.

Not built yet: a button for the model test in the app (it is kedalio.engine_admit), prices for OpenAI’s and third-party models, and a measure of what the cascade saved.