Skip to content
aichat logo

aichat via Tokonomix

Add a Tokonomix client to aichat’s config.yaml — give the Rust CLI, shell and REPL 130+ models and consensus on one key.

openai-compatible client (config.yaml)CLIMIT · open sourcemacOS · Windows · Linux
aichat — all-in-one Rust LLM CLI, shell and REPL, via Tokonomix

What is aichat?

aichat is an all-in-one LLM CLI written in Rust — a one-shot command, an interactive shell assistant and a REPL in one tool. It registers openai-compatible clients in config.yaml, which is how Tokonomix plugs in: one client block, 130+ models.

  • Runs as a one-shot CLI, a shell-integration assistant, or an interactive REPL.
  • Custom backends go under clients: as type: openai-compatible (name, api_base, api_key, models).
  • Per-model supports_function_calling enables tool calling.
  • Open source; address a model as <client>:<model>.

Why route aichat through Tokonomix?

  • One openai-compatible client block reaches 130+ models behind a single key.
  • Select tokonomix:tokonomix-consensus for hard reasoning turns; add a direct model to the client for high-volume edits.
  • Per-call spend caps bound usage, and region / origin routing keeps sensitive prompts compliant.
  • Cost is metered to the cent in your Tokonomix dashboard.

Connect Tokonomix in config.yaml

Add a Tokonomix client under clients: with type: openai-compatible, the api_base, your api_key and a models list.

# ~/.config/aichat/config.yaml
clients:
  - type: openai-compatible
    name: tokonomix
    api_base: https://tokonomix.ai/api/v1
    api_key: tok-your-key
    models:
      - name: anthropic/claude-sonnet-4-6
        supports_function_calling: true
      # Opt-in (planning/review only, no tool-calling): - name: tokonomix-consensus

# aichat -m tokonomix:anthropic/claude-sonnet-4-6 "refactor this"

Verify it works

  • Add the openai-compatible client block with your key to config.yaml.
  • Run a small prompt: aichat -m tokonomix:tokonomix-consensus "refactor this".
  • Confirm the call and token usage in your Tokonomix dashboard.

Model selection

Which model and endpoint should my agent use?

Pick by what your agent does, then swap the model id any time — every model in the catalog works through the same key.

What your agent doesUse this
Edits files / calls tools and streams responses (most coding agents)An Anthropic model via the Anthropic endpoint (tools + streaming both work)
Calls tools but does not need streaming (any model)The OpenAI-compatible endpoint with a single model id
Wants tools and streaming on a non-Anthropic modelRun non-streaming for now — streaming tool-calls on other providers is not enabled yet
Plain chat, no toolsEither endpoint; streaming is fine
Wants a cross-model verdict (consensus) on a high-stakes answerSet model to tokonomix-consensus on the OpenAI-compatible endpoint — note: consensus rejects tool requests (no tool-calling)
Endpoint & API reference (technical)

anthropic-messages → https://tokonomix.ai/api/anthropic — tools ✓, streaming ✓ (use an Anthropic model). openai-completions → https://tokonomix.ai/api/v1 — tools ✓ (single-model passthrough), streaming with tools not yet enabled. Plain chat: streaming works on both. Consensus: openai-completions, model tokonomix-consensus, no tools. Swap the model id to any slug returned by GET /api/v1/models.

Browse all models →

Related agents