Guides14 min readPublished 2026-07-26

How Do You Connect Aider to LumeAPI for GPT, Claude and Gemini?

Point Aider at LumeAPI’s OpenAI-compatible endpoint, choose a catalog model, and estimate API cost before starting a coding session.

By LumeAPI Engineering Team

Cheap LLM API hub → Compare Lower-Cost API Routes →

Short path: Cheap LLM API · OpenAI-compatible API · AI API pricing · Models

Last verified: July 26, 2026

Set Aider’s OPENAI_API_BASE to https://api.lumeapi.site/v1, put a LumeAPI key in OPENAI_API_KEY, and prefix the selected LumeAPI catalog id with openai/. For example, start with aider --model openai/gpt-5.6-terra. Aider officially documents this pattern for OpenAI-compatible endpoints. LumeAPI currently lists Terra at $0.75/$4.50 per 1M input/output tokens, so a transparent 20,000-input and 4,000-output-token calculation is about $0.033 before retries and repeated repository-map context.

LumeAPI is an independent third-party OpenAI-compatible gateway. It is not OpenAI, Anthropic, Google, or Aider.

Quick answer

QuestionAnswer
What base URL should Aider use?https://api.lumeapi.site/v1
Which environment variables are required?OPENAI_API_BASE and OPENAI_API_KEY
How should the model be named?openai/<LumeAPI catalog id>
What is a practical default?openai/gpt-5.6-terra for routine coding; promote difficult work to Sol
Is the cost estimate an observed Aider bill?No. It is token arithmetic using the July 26 catalog, not a billable session benchmark

In short

Set Aider’s OPENAI_API_BASE to https://api.lumeapi.site/v1, put a LumeAPI key in OPENAI_API_KEY, and prefix the selected LumeAPI catalog id with openai/. For example, start with aider --model openai/gpt-5.6-terra.

What most setup guides get wrong

Changing only the model name is insufficient. Aider will still target its default provider unless the base URL and credential are set. The openai/ prefix also matters because it tells Aider to use its OpenAI-compatible transport for an otherwise unfamiliar catalog id.

The endpoint includes /v1. Pointing Aider at https://api.lumeapi.site without the version path can produce a 404 or an unexpected route. A model warning is different from an API error: Aider may warn that it does not know a new model’s metadata even when the endpoint accepts that model.

Configure LumeAPI in Aider

Keep the key outside source control. A project-level .aider.conf.yml can store the endpoint and default model while .env holds the secret.

yaml
# .aider.conf.yml
openai-api-base: https://api.lumeapi.site/v1
model: openai/gpt-5.6-terra
# Store OPENAI_API_KEY in .env, not here.
bash
export OPENAI_API_BASE=https://api.lumeapi.site/v1
export OPENAI_API_KEY=sk-your-lumeapi-key

aider --model openai/gpt-5.6-terra

On Windows PowerShell, set the variables only for the current shell when testing:

powershell
$env:OPENAI_API_BASE = "https://api.lumeapi.site/v1"
$env:OPENAI_API_KEY = "sk-your-lumeapi-key"
aider --model openai/gpt-5.6-terra

Verify the model id against the live LumeAPI model catalog before committing a shared configuration.

Which model should an Aider workflow start with?

Coding taskFirst routeWhy
Small edits, formatting, simple testsgpt-5.4-miniLowest listed token rate in this routing set
Routine feature work and repository Q&Agpt-5.6-terraBalanced default at half the Sol token rate
Difficult refactor or agentic debugginggpt-5.6-solHigher-capability route when failure cost matters
Claude-based coding experimentclaude-sonnet-4-6Mid-tier Claude route exposed through the same Chat Completions surface
Highest-cost escalation in the current Claude catalogclaude-opus-4-8Use only after the task justifies the premium

Do not route by model brand alone. Store task type, model id, input/output tokens, retries, and accepted commit outcome so your team can compare cost per accepted change.

How much does one Aider coding turn cost?

The formula is:

cost = input_tokens / 1,000,000 × input_rate + output_tokens / 1,000,000 × output_rate

ModelLumeAPI input/output rate20k input + 4k output
GPT-5.4 mini$0.225 / $1.35$0.0099
GPT-5.6 Terra$0.75 / $4.50$0.0330
GPT-5.6 Sol$1.50 / $9.00$0.0660
Claude Sonnet 4.6$1.50 / $7.50$0.0600
Claude Opus 4.8$2.50 / $12.50$0.1000

These are single-equivalent-turn calculations. Aider may resend repository context, call a weak/editor model, retry edits, or run many turns. A small 8k/1.5k Terra change calculates to about $0.0128; an 80k/12k Terra refactor calculates to about $0.114. Neither number predicts acceptance rate.

A realistic team workflow

A five-person team can make Terra the shared default, let developers choose mini for mechanical work, and require Sol escalation only after a failed routine attempt or for explicitly high-risk changes. The application should capture the selected model and LumeAPI usage record beside the commit or ticket. That turns “the coding agent feels expensive” into a measurable cost-per-accepted-commit decision.

For broader controls, use the multi-model production checklist and review agent API cost controls.

Troubleshooting

Why does Aider return 401?

Confirm that OPENAI_API_KEY contains a valid LumeAPI key in the same shell that launches Aider. Do not paste the Research publishing secret into this variable.

Why does Aider report model not found?

Use the exact id from /models, keep the openai/ prefix in Aider, and confirm the account can access that route.

Why do I receive a 404?

Check that the base URL ends in /v1. Do not append /chat/completions to OPENAI_API_BASE; the client adds the resource path.

Why does Aider warn about unknown model metadata?

A newly listed gateway id may not yet exist in Aider’s metadata table. Treat a warning separately from a failed request and add explicit model metadata only after checking Aider’s current documentation.

What most guides get wrong

The usual mistake on How Do You Connect Aider to LumeAPI for GPT, Claude and Gemini? is to chase the lowest posted per-million-token rate while ignoring orchestration: repeated context, oversized tool output, silent retries, and premium-model defaults often dominate the invoice.

A cheaper list price does not help when every agent hop resends the same repository map or when failed tests trigger unbounded re-runs. Optimize cost per successful task—not the price of a single completion—before you renegotiate vendor contracts or swap gateways.

A realistic production scenario

A six-person platform team standardized on one premium model for How Do You Connect Aider to LumeAPI for GPT, Claude and Gemini? after a strong demo score. Early invoices looked fine; by week three, failing test loops had doubled input tokens without more accepted output.

They kept the orchestrator but tightened routing: a lower-cost catalog model handled exploration, a mid-tier model handled implementation, and premium routes required a logged failure condition. They truncated test logs and stopped attaching full diffs on every retry.

The breakthrough was reconciling LumeAPI usage records with task ids. Token list price mattered less than eliminating duplicate context across retries.

Expert take

LumeAPI is an independent third-party OpenAI-compatible gateway—not OpenAI, Anthropic, or Google. Published catalog rates can be materially below official reference pricing, but compatibility does not guarantee identical behavior for every native feature, streaming edge case, tool schema, Batch workflow, or prompt-cache semantics.

Follow this advice when you control prompts, retries, and routing and need auditable USD billing across GPT, Claude, and Gemini on one key. Do not cut over blindly if you depend on provider-native capabilities your stack has not tested end to end.

Run a bounded smoke test on your exact SDK, model id, streaming mode, and tool path; reconcile usage logs with orchestrator task ids; and keep a fallback route until error rates and latency are acceptable.

FAQ

Does this guide apply to every LumeAPI model?

Verify the exact model id and rate on /models before production use for How Do You Connect Aider to LumeAPI for GPT, Claude and Gemini?.

What base URL should I use with the OpenAI SDK?

Use https://api.lumeapi.site/v1 with a LumeAPI API key and a catalog model id.

Is LumeAPI affiliated with OpenAI or Anthropic?

No. LumeAPI is an independent third-party OpenAI-compatible gateway.

What should I log besides token counts?

Log request id, model id, latency, status code, and retry count for each call.

Sources and testing boundary

No billable Aider-to-LumeAPI request was run for this report. The setup follows Aider's documented OpenAI-compatible pattern, but readers should still smoke-test their exact Aider version, model route, usage log, and accepted file edit before production use.

Ready to call these models?

Create a LumeAPI key in under a minute — one OpenAI-compatible gateway for GPT, Claude, Gemini, and more.