How to evaluate an LLM API relay
I run qcode.cc, an independent API service (not official Anthropic, OpenAI or Google). The examples use QCode paths; swap the host for any compatible gateway.
Every API relay claims to be fast and stable. The useful question is whether you can measure that yourself, on the protocols your tools actually use, and whether billing is published in a form you can check. This page is a method, not a ranking, and it does not name or disparage other providers.
I run qcode.cc, an independent API service. The open tools linked here were written so people can test relays — including ours — from their own network. They ship with no built-in provider list.
1. Latency, from where you sit
Time to first token (TTFT) on a short streamed request is the number coding tools feel. Measure it yourself:
- Use the same small prompt and a tiny
max_tokenseverywhere, with streaming on. - Give each run a unique nonce so a response cache cannot make the relay look faster than it is.
- Report the median and p90, never the best run, and report the error rate next to latency.
- Label the city, ISP, and whether you were on wired or Wi-Fi. A number from another continent is a different test.
llm-relay-bench is a one-file, standard-library Python probe that does this for Anthropic Messages, OpenAI Chat Completions, and OpenAI Responses (the API Codex CLI uses with wire_api = "responses"). For a quicker "is the path even right?" pass, use llm-endpoint-check.
curl -fsSLO https://raw.githubusercontent.com/ethan-cur/llm-relay-bench/main/relay_bench.py
export LLM_API_KEY="YOUR_API_KEY" # read from the environment, never passed on the command line
# Anthropic path (what Claude Code uses). Use a model id the endpoint actually serves.
python3 relay_bench.py --anthropic https://gateway.example.com --anthropic-model MODEL_ID \
--runs 10 --label "city, ISP, wired-or-wifi" --out result.json
# OpenAI Chat Completions + Codex Responses
python3 relay_bench.py --openai https://gateway.example.com/v1 --openai-model MODEL_ID \
--responses https://gateway.example.com/v1 --responses-model MODEL_ID \
--runs 10 --label "city, ISP, wired-or-wifi" --out result.json
2. Protocol coverage
A relay can be healthy on one path and missing on another. Check the ones your tools need:
| Tool family | Protocol to probe |
|---|---|
| Claude Code, Cline Anthropic, many Claude clients | Anthropic Messages POST /v1/messages |
| Codex CLI | OpenAI Responses POST /responses (wire_api = "responses" only, in current official Codex docs) |
| OpenAI SDKs, Cursor OpenAI override, Cline OpenAI Compatible | Chat Completions POST /chat/completions and usually GET /models |
Gemini CLI, Antigravity CLI, OpenCode google | Gemini native path (often /v1beta/models/…) |
Also look at failure shape: a wrong path should return JSON 404, not an HTML landing page with HTTP 200. Redirects (http → https, trailing slash) matter because many clients drop the POST body. See troubleshooting.
3. Model IDs and "authenticity"
Two separate questions get mixed together:
- Is this id served on this path? That is a directory problem. If
GET /models(or the vendor's model page) does not list the id, or a request returnsmodel not found/model_not_available_on_endpoint, you have the wrong protocol or a typo. On some relays, including QCode, Claude IDs work only on the Anthropic path. - Is the model behind that id what the name suggests? A matching
modelfield in the JSON, working prompt-cache usage fields, and consistent token accounting are signals. They are not proof. The llm-relay-bench README states this explicitly: fidelity results cannot prove a genuine upstream model, and a single test that claims to prove authenticity is overselling.
When you publish a comparison, publish the raw JSON and say if you work for the relay you tested.
4. Billing transparency
Prefer a provider that lets you reconcile a bill without a slogan:
- A public per-model input / output / cache rate, with a stated service multiplier against the official vendor price when one is used.
- A usage log or invoice line that you can match to an individual request (model, tokens, cache writes and reads).
- Clear product rules: daily quota vs a one-off pack, what happens at month end, concurrency, and how upgrades work.
- Prompt-cache accounting that includes cache writes and reads, not only
input_tokens. On Anthropic-style caching,input_tokensis often only the uncached part; a self-check that ignores cache fields will flag honest providers. llm-relay-bench sums the cache fields for that reason.
Worked example for the service I operate: QCode publishes per-model rates and a service rate of ×1.0 for Anthropic Claude, OpenAI / Codex, and Google Gemini (official price × service rate, checked on qcode.cc/en/models on 2026-12-05). Plan shapes and pack prices are on qcode.cc/en/pricing (Starter is listed at $9.00/mo for $5 of quota per day; a small pay-as-you-go pack is listed at $4 for $30 of quota). Those figures will change — read the live pages. This is not a comparison against anyone else.
5. What this page will not do
It will not rank named competitors, quote unnamed benchmarks as fact, or claim that any relay is official, authorized, or a partner of Anthropic, OpenAI or Google. If you need a client config after you have picked an endpoint, use the cheat sheet, the environment variable reference, or the config generator.
Facts checked against docs.qcode.cc on 2026-12-05. I run qcode.cc. Pricing: qcode.cc/pricing (no free quota). Contact: hi@qcode.cc.