Skip to content

Aider

Aider is a popular AI coding assistant that speaks the OpenAI Chat Completions API. The gateway is OpenAI-compatible, so Aider works without any Aider patches.

Verified configuration

This is the exact configuration used during the post-release evidence run (artifacts/POST-RELEASE-E3/, Aider 0.86.2, 27 real chat-completions, 0 privacy violations).

Environment

export SMART_GATEWAY_BASE_URL="https://smart-openrounter.bee1x.one"
export SMART_GATEWAY_API_KEY="$YOUR_GATEWAY_KEY"

.aider.model.settings.yml

- name: smart-supervisor
  chat_model:
    api_base: https://smart-openrounter.bee1x.one/v1
    api_key: env:SMART_GATEWAY_API_KEY
    model: smart-router
    stream: true
  weak_model:
    api_base: https://smart-openrounter.bee1x.one/v1
    api_key: env:SMART_GATEWAY_API_KEY
    model: smart-router-flash

stream: true is supported but see User guide → Streaming for the reasoning-normalization caveat. If you see empty Aider replies, switch to --no-stream.

Run

aider --model smart-supervisor path/to/file.py

Aider will:

  • use smart-router for the chat completions (auto-routed),
  • use smart-router-flash as the weak model for commit messages and prompt summarization.

Both models resolve to real OpenRouter IDs on the server side; Aider never sees the OpenRouter key.

Streaming caveat (DeepSeek extended thinking)

DeepSeek V4 can emit "extended thinking" reasoning deltas. The gateway folds them into the first content delta so Aider does not see an empty chunk, but if you want byte-perfect reasoning passthrough, use --no-stream.

Force-Pro from inside Aider

Aider cannot send custom headers. To force Pro, change the model field in .aider.model.settings.yml to smart-router-pro, or pass --model smart-router-pro on the command line.

To force Pro for a single message, use the instruction marker that the policy recognizes:

/pro explain this function in detail

The /pro marker is in frozen-v3/config/routing-policy.yaml under high_reasoning_markers.

Aider session identity

The evidence run used an SSH tunnel from the local machine to the staging gateway and ran Aider against it. For real production usage, run Aider directly against the public URL:

aider \
  --openai-api-base https://smart-openrounter.bee1x.one/v1 \
  --openai-api-key "$SMART_GATEWAY_API_KEY" \
  --model smart-router

The CLI flags take precedence over .aider.model.settings.yml.

Per-task sensitivity

There is no Aider-native way to mark a request as sensitive. The gateway treats every request as sensitive: true by default. If you are working on a public open-source repo and want to opt in to the free Scout for cheap summarization, set metadata.sensitive = false via the OpenAI SDK — but in the Aider context that means dropping down to a Python script that uses the OpenAI SDK to call the gateway.

For ordinary Aider sessions, leave sensitive at its default. The free model will not be used on private code, which is the safe default.

Commit-message model

Aider's commit-message generator uses the weak_model. If you set that to smart-router-flash (recommended), commits are produced by DeepSeek Flash — fast and cheap.

Evidence

The full Aider evidence is preserved in artifacts/POST-RELEASE-E3/:

  • RESULT.json — verdict PASS, 27 chat-completions, fixture diff 4,617 bytes.
  • raw/aider-session.log — Aider's own stdout.
  • raw/staging-gateway.log — Gateway access log.
  • raw/routing-events.jsonl — Structured routing decisions.
  • raw/fixture-diff.patch — Real file modifications captured.

This is the canonical example of a working integration.