Verified 2026-11-18 · rates follow the live catalog
An OpenAI-compatible LLM proxy accepts the requests your client already sends and forwards them to a model somewhere else. Adopting one should not mean rewriting anything. Three values change, and almost every failed first attempt traces back to one of them.
| Setting | Before | After |
|---|---|---|
| Base URL | https://api.openai.com/v1 | https://api.openference.com/v1 |
| Credential | Your provider key | Your Openference API key, sent as a bearer token |
| Model id | The provider's model name | An exact catalog name from the model list |
from openai import OpenAI
client = OpenAI(
base_url="https://api.openference.com/v1",
api_key="YOUR_API_KEY",
)
reply = client.chat.completions.create(
model="GLM-5.3",
messages=[{"role": "user", "content": "ping"}],
)
Clients that speak the OpenAI format, including the OpenAI SDKs, Cursor, Cline, OpenCode and Codex, take https://api.openference.com/v1. Claude Code speaks the Anthropic Messages format and adds /v1/messages itself, so it takes the host without /v1: https://api.openference.com. Give it a base URL that already ends in /v1 and it requests /v1/v1/messages, which fails.
Claude Code also wants the credential in ANTHROPIC_AUTH_TOKEN. ANTHROPIC_API_KEY sends the key in an x-api-key header instead, and Openference authenticates with the bearer token.
The proxy does not guess. A model is selected by its catalog name, listed by GET /v1/models and on the models page. Names can include spaces and version suffixes, so copy them rather than retype them. Anthropic-style ids such as claude-sonnet-4-6 do not select a model and the request is rejected with a "model is not configured" error. That one trips up Claude Code in particular, because it sends Anthropic-style ids unless you set the three tier variables to catalog names.
/v1/v1/messages: the base URL includes /v1.streaming_required: a free model was called without "stream": true.Retry-After header, then retry.resets_at: the plan allowance is used up and the account has no credits; the timestamp says when it returns.To confirm the connection before debugging anything else, call GET https://api.openference.com/v1/models with the key. A model list back means the URL and credential are right.
A proxy only forwards, while a gateway also routes, bills and scopes keys. Openference is the second kind, which is why a failed upstream does not have to become a failed request.
Model catalog · Pricing · Comparisons · Cost guides · Integration guides · FAQ
Guides: GLM coding plan alternative · Free AI API · LLM gateway · LLM proxy · Cheap AI API · OpenAI-compatible API
Model APIs: GLM API · DeepSeek API · Kimi API · Qwen API · MiniMax API