# Aider

Run Aider from your project with a uRouter model and your own API key.

Create a key in API Keys. Eligible requests use your Plan usage first and then paid credit from Billing. You can set spending limits on each key.

Choose an available model with function tools. The examples use its exact model ID.

Install Aider, set your key, and save the settings file below in your project directory. Run the launcher from that directory.

Replace YOUR_MODEL_ID with an available, tool-capable model from the current catalog. Context/output limits are examples; use the selected model’s published limits.

export UROUTER_API_KEY="YOUR_UROUTER_API_KEY"

Save the output settings as `.aider.urouter.model.settings.yml` in your project.

- name: aider/extra_params
  extra_params:
    max_tokens: 4096

export OPENAI_API_BASE='https://urouter.net/gateway/v1'
export OPENAI_API_KEY="$UROUTER_API_KEY"
aider --model 'openai/YOUR_MODEL_ID' --weak-model 'openai/YOUR_MODEL_ID' --editor-model 'openai/YOUR_MODEL_ID' --model-settings-file '.aider.urouter.model.settings.yml' --no-stream

$env:OPENAI_API_BASE = 'https://urouter.net/gateway/v1'
$env:OPENAI_API_KEY = $env:UROUTER_API_KEY
aider --model 'openai/YOUR_MODEL_ID' --weak-model 'openai/YOUR_MODEL_ID' --editor-model 'openai/YOUR_MODEL_ID' --model-settings-file '.aider.urouter.model.settings.yml' --no-stream

Choose a model that Aider sends through Chat Completions. Use the Codex guide for GPT-5 Codex models, which Aider routes through Responses.

The openai/ prefix selects Aider’s OpenAI-compatible connection. Main, weak and editor tasks use the same model. The launcher waits for complete replies so Aider surfaces an explicit unknown-outcome error without resending it. Check uRouter Usage before retrying.

Check the model name shown when Aider starts. Aider may warn that it does not know the model’s context window or cost. You can check the actual charge in uRouter’s Usage page.

Key rejected

Check that your key is active in API Keys. If you no longer have the full key, create a new one. Update your agent’s key and restart it.

Not enough credit or a spending limit reached

Check available Plan usage and paid credit in Billing, and check limits in API Keys. A request can require more available credit than its final charge.

Model unavailable

Choose another available model above and update your agent’s configuration. Model availability can change after setup.

Request rejected

Use the exact base URL and model ID shown here. Check the selected model's supported inputs, output limit and available credit. Save the request ID if you contact support.

My agent stopped mid-edit

Check the agent's log for a length limit. Increase its output limit within the model's published maximum and available credit, or split the edit into smaller steps. If the input hit the context window, compact the conversation. Check the working tree before resuming so the agent can build on edits already applied.

curl --fail --silent --show-error 'https://urouter.net/gateway/v1/models'
