Skip to content

Integration guide

Aider Custom API & Architect/Editor Setup (.aider.conf.yml)

Point Aider at https://proxystacks.com/v1 using the openai/<model> prefix and .aider.model.metadata.json to eliminate unknown-context warnings — pairing claude-opus-5-5 (-50% vs official USD) as --architect with deepseek-v4.1-flash ($0.18/1M peak · $0.0895/1M off-peak) as --editor-model and --weak-model.

Setup

  1. 1

    Export OPENAI_API_KEY="sk-relay-..." from your ProxyStacks Relay console (prepaid USD balance from US$5, 0% top-up fee, non-expiring).

  2. 2

    Create ~/.aider.conf.yml (or repo-root .aider.conf.yml) with openai-api-base: "https://proxystacks.com/v1" and prefix custom model IDs with openai/ (e.g. openai/claude-sonnet-5-5).

  3. 3

    Save .aider.model.metadata.json to register 1,000,000 input / 64,000 output limits and enable architect: true with deepseek-v4.1-flash as editor-model and weak-model.

Configuration

deepseek-v4.1-flash
~/.aider.conf.yml
# ~/.aider.conf.yml or ./.aider.conf.yml (Git repo root)
# Export your Relay API key first:
#   export OPENAI_API_KEY="sk-relay-your-key"
# APAC / CN low-latency endpoint: "https://hk.proxystacks.com/v1"

openai-api-base: "https://proxystacks.com/v1"
model: "openai/deepseek-v4.1-flash"
model-metadata-file: ".aider.model.metadata.json"

Prefix custom models with openai/ in .aider.conf.yml and pair claude-opus-5-5 (--architect) with deepseek-v4.1-flash (--editor-model & --weak-model).

Advanced config: environment variable API key, multi-model routing & max output tokens

Use a project-specific config or multi-profile setup with environment variable keys, flagship and fast models — Claude Opus/Sonnet 5.5 (-50%), GPT-6.1 Sol / GPT-6 Luna (-30%), DeepSeek V4.1 Flash (-40%), GLM-5.3 & Kimi K3.1 Pro (-30%) — and explicit context/output token limits.

.aider.conf.yml & .aider.model.metadata.json
# 1) ./.aider.conf.yml — 3-tier Architect + Editor + Weak routing
# Run: export OPENAI_API_KEY="sk-relay-your-key" && aider
openai-api-base: "https://proxystacks.com/v1"
architect: true
auto-accept-architect: false

# High-reasoning planner (-50% vs official Anthropic USD list):
model: "openai/claude-opus-5-5"

# Fast diff applier ($0.18/1M peak · $0.0895/1M UTC+8 off-peak):
editor-model: "openai/deepseek-v4.1-flash"

# Commit messages & repo-map summaries:
weak-model: "openai/deepseek-v4.1-flash"
model-metadata-file: ".aider.model.metadata.json"

# -------------------------------------------------------------------
# 2) ./.aider.model.metadata.json — Silences "Unknown context window"
# -------------------------------------------------------------------
# {
#   "openai/claude-opus-5-5": {
#     "max_tokens": 64000,
#     "max_input_tokens": 1000000,
#     "max_output_tokens": 64000,
#     "input_cost_per_token": 0.0000025,
#     "output_cost_per_token": 0.0000125,
#     "mode": "chat"
#   },
#   "openai/claude-sonnet-5-5": {
#     "max_tokens": 64000,
#     "max_input_tokens": 1000000,
#     "max_output_tokens": 64000,
#     "input_cost_per_token": 0.0000015,
#     "output_cost_per_token": 0.0000075,
#     "mode": "chat"
#   },
#   "openai/deepseek-v4.1-flash": {
#     "max_tokens": 64000,
#     "max_input_tokens": 1000000,
#     "max_output_tokens": 64000,
#     "input_cost_per_token": 0.00000018,
#     "output_cost_per_token": 0.00000028,
#     "mode": "chat"
#   },
#   "openai/glm-5.3": {
#     "max_tokens": 64000,
#     "max_input_tokens": 1000000,
#     "max_output_tokens": 64000,
#     "input_cost_per_token": 0.00000098,
#     "output_cost_per_token": 0.0000028,
#     "mode": "chat"
#   }
# }

Troubleshooting

  • 401: check the Relay key and authentication header. Never paste a secret into a support ticket.
  • 404: use an exact published model ID and the documented base URL, not an upstream alias.
  • For streaming use stream: true. Codex uses Responses; keep disable_response_storage = true.

Common questions

How do I fix Aider's "Unknown context window size and costs" warning on custom OpenAI endpoints?

Prefix the model ID with "openai/" (for example "openai/claude-sonnet-5-5") and point "model-metadata-file" in .aider.conf.yml to a .aider.model.metadata.json file whose keys include the exact "openai/" prefix plus max_input_tokens (1000000), max_output_tokens (64000), and per-token USD rates.

What is the lowest-cost Architect + Editor setup in Aider?

Enable "architect: true" in .aider.conf.yml, set "model: openai/claude-opus-5-5" (-50% vs official Anthropic USD list) for planning, and set both "editor-model" and "weak-model" to "openai/deepseek-v4.1-flash" ($0.18/1M peak · $0.0895/1M UTC+8 off-peak) for diff application and commit summaries.

All docs