Every tool that speaks OpenAI, pointed at one endpoint
Nearly every AI coding tool and framework ships one assumption: you have an OpenAI key and you talk to OpenAI. Almost all of them also expose the one setting that breaks that assumption. Change it once and every model becomes reachable — without waiting for tool support to add the vendor you actually want to pay for.
The three values that decide everything
Every integration on this page is the same three values wearing different clothes. Learn them once and the per-tool instructions become trivial:
| Value | What it is | What breaks if you get it wrong |
|---|---|---|
| Base URL | https://aicomp.ai/v1 | Doubling the /v1 gives 404; leaving it empty sends your request to the vendor you were trying to avoid. |
| API key | One gateway key | Vendor keys are rejected by other vendors' models — that is the whole reason the endpoint exists. |
| Model ID | Exact string from GET /models | No fuzzy matching anywhere. A wrong suffix is a hard 404, not a fallback. |
curl https://aicomp.ai/v1/models \
-H "Authorization: Bearer sk-your-gateway-key"
A JSON list of model IDs means the key is good. Invalid token means it was copied wrong.
The one line every tool and framework needs
curl https://aicomp.ai/v1/chat/completions \
-H "Authorization: Bearer $GATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-pro","max_tokens":256,\
"messages":[{"role":"user","content":"Reply with the word ok."}]}'
Before touching any tool config, run that command. If it returns a completion, you have proven all three values work. Every tool-level failure from this point on is a configuration problem in the tool, not an API problem.
Tool matrix
| Tool | Where the setting lives | Exact name | Walkthrough |
|---|---|---|---|
| Claude Code | Environment variables | ANTHROPIC_BASE_URL | Guide |
| Cursor | Settings → Models | Override OpenAI base URL | Guide |
| OpenAI SDK (Python) | Constructor argument | base_url | Guide |
| OpenAI SDK (Node) | Constructor argument | baseURL (capitalised) | Guide |
| LangChain | Chat model constructor | configuration.baseURL | Guide |
| LiteLLM | Per-call argument or proxy YAML | api_base | Guide |
| Vercel AI SDK | Provider factory | createOpenAI({ baseURL }) | Guide |
| Cline | Settings → API Provider | Base URL field | Guide |
Menu labels move between versions; the configuration key or environment variable does not. Where the two disagree in our guides, trust the variable.
The three failures behind most support tickets
| Symptom | Cause | Fix |
|---|---|---|
| 404 on every request | Doubled path — the SDK appends /chat/completions to your base URL | Strip the trailing path so the URL ends at /v1 |
| Setting appears to do nothing | Wrong casing or wrong key name (baseUrl is silently ignored by the Node SDK, which wants baseURL) | Copy the exact name from the matrix above; several tools also only re-read it on a cold start |
| 401 with a key you just created | Trailing whitespace, or the tool is still using its own pooled quota | Re-copy the key, restart the tool, then confirm the request shows up in your usage log |
What it costs to run an agent all day
Coding agents are output-heavy: short prompts in, long diffs out. That is why the output column matters more than the input column everyone compares. The table below prices one heavy day of agent work — 200k input, 60k output — across twelve models that people actually route to from these tools.
| Model | Vendor | Rate in / out per 1M | Per day | Per month |
|---|---|---|---|---|
| gpt-5.6-luna | OpenAI | $0.1 / $0.6 | $0.06 | $1 |
| MiniMax-M3 | MiniMax | $0.15 / $0.6 | $0.07 | $1 |
| deepseek-v4-flash | DeepSeek | $0.22 / $0.66 | $0.08 | $2 |
| gemini-3.7-flash | $0.375 / $1.875 | $0.19 | $4 | |
| claude-haiku-4-5-20251001 | Anthropic | $0.5 / $2.5 | $0.25 | $5 |
| deepseek-v4-pro | DeepSeek | $0.66 / $1.98 | $0.25 | $5 |
| glm-5.3 | Zhipu | $0.7 / $2.2 | $0.27 | $5 |
| qwen3.8-max | Alibaba | $1 / $3 | $0.38 | $8 |
| claude-sonnet-5 | Anthropic | $1 / $5 | $0.50 | $10 |
| gpt-5.6-terra | OpenAI | $1 / $6 | $0.56 | $11 |
| kimi-k3 | Moonshot | $1.5 / $7.5 | $0.75 | $15 |
| claude-opus-5 | Anthropic | $2.5 / $12.5 | $1.25 | $25 |
Change models without touching credentials
The reason to keep one endpoint is that switching models stops being a project. Nothing about the key or the URL changes — only the string you send:
# Same key, same URL, different partner:
# change this one line and the entire bill changes shape
export MODEL=deepseek-v4-flash
curl "$GATEWAY_BASE_URL/chat/completions" \
-H "Authorization: Bearer $GATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d "{{\"model\":\"$MODEL\",\"max_tokens\":128,\
\"messages\":[{{\"role\":\"user\",\"content\":\"ok?\"}}]}}"
Put that environment variable somewhere every tool reads from and you can promote a failing call to a stronger model — or demote an expensive one to a cheaper tier — without opening a single settings panel. In practice this is how teams end up running three models at once: a strong one for anything touching production code, a mid-priced one for the daily grind, and an inexpensive one for summaries and autocomplete.
What "OpenAI-compatible" does not promise
The phrase is narrower than it sounds. It describes a request shape, not a guarantee that every feature survives the trip:
| Guaranteed by the wire format | Not guaranteed |
|---|---|
/chat/completions with messages and streaming | Identical tokenisation — the same prompt costs different amounts on different models |
| Tool / function calling messages | The same tool schemas being equally reliable across model families |
| Usage reporting and error codes | Identical rate limits, context windows or safety behaviour |
Model discovery via GET /models | Embeddings, image or audio routes being present at all |
Read that as: switching models through one endpoint is cheap, but it is not free. Budget ten minutes per new model to re-check tool reliability and cost behaviour rather than assuming the previous model's results transfer.
Rollout checklist
- Prove it with curl first. Every tool-level failure is cheaper to diagnose outside the tool.
- Put the three values in the environment. Base URL, key, model ID — never inline them in a file that gets committed.
- Confirm in your usage log, not in the UI. A green checkmark means a request succeeded, not that it billed to you.
- Pin the model ID explicitly. Anything defaulting to a snapshot will silently change behaviour when your endpoint's catalogue updates.
- Re-run your own evaluation prompt after switching. Tokenisation differs, so yesterday's cost per task is not today's.
https://aicomp.ai/v1).
Create one free →
FAQ
Which base URL do I use for all of these tools?
https://aicomp.ai/v1 — the same value everywhere. What changes per tool is only where you paste it: an environment variable, a constructor argument, or a settings field.
Why do my requests 404 after I paste the base URL?
Almost always a doubled path. The OpenAI SDKs append /chat/completions to whatever you give them, so if your base URL already ends in /v1 do not add another one. Watch for the opposite failure too: an empty base URL silently goes to the vendor's own endpoint.
The tool has a model dropdown and my model is not in it.
Dropdowns are usually a static list shipped with the tool, not a call to /models. Pick the manual or 'custom model' option and type the exact ID from GET /models. Vendor APIs reject model names they do not recognise — there is no fuzzy matching.
Can I switch models without reconfiguring the tool?
Yes, that is the point of one endpoint: only the model ID changes. Keep the base URL in an environment variable so reverting is instant, and keep one key instead of one per vendor.
How do I know the override actually took effect?
Send one request, then check your gateway usage log. A request appearing there is the only reliable proof — a 200 response can also come from the tool's own pooled quota if the setting was ignored.
Related
- LiteLLM: one interface, per-model api_base, and fallbacks
- Vercel AI SDK with a custom endpoint
- Cline with an OpenAI-compatible provider
- Claude Code against your own key
- Cursor with an overridden base URL
- What OpenAI-compatible actually guarantees
- No cheapest model — only a cheapest token mix
- Full price index