{"slug": "how-to-verify-a-gateway-is-not-a-shell-five-checks-from-the-outside", "title": "How to verify a gateway is not a shell: five checks from the outside", "summary": "A developer published a five-check method for verifying whether an OpenAI-compatible API gateway actually routes requests to the advertised model rather than acting as a shell. The checks test whether the usage block's prompt_tokens scale with input length, whether time-to-first-token reflects genuine streaming rather than a buffered relay, whether provider-specific edge cases like tool_calls and reasoning_content behave correctly, whether the model catalogue lists per-model context limits, prices and source links, and whether error responses match upstream fingerprints.", "body_md": "Anyone can put an OpenAI-compatible endpoint in front of a queue and answer requests. The hard part is proving that a specific request actually reached the model whose name is in the `model` field, at the context length and price the seller advertised. The difference between a reseller and a shell is invisible in the happy path — both return a plausible paragraph — so verification has to come from the edges.\n\nBelow are the five checks we use before trusting a gateway, each runnable in a few minutes with curl and a spreadsheet.\n\nEvery OpenAI-compatible response carries a `usage` block. A real upstream metered its own tokens; a shell either hardcodes a plausible number or estimates with a crude word count. The test is simple: send the same question with a 200-token prompt and again with a 2,000-token prompt padded with harmless filler.\n\n```\ncurl -s https://your-gateway.example/v1/chat/completions \\\n  -H \"Authorization: Bearer $KEY\" -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"gpt-5.4\",\"messages\":[{\"role\":\"user\",\"content\":\"'$PAD' Summarise the padding above in one line.\"}]}' \\\n  | jq '.usage'\n```\n\nExpect `prompt_tokens` to move roughly tenfold and `completion_tokens` to stay close to constant. If the count barely moves, the gateway is not tokenising what it received. If the numbers are identical across two different prompts, they are generated, not measured.\n\nTime to first token (TTFT) is where shells give themselves away. A shell that waits for the upstream to finish and then relays the whole body looks fine in total latency but arrives as one burst: TTFT is almost equal to total duration. A real streaming upstream sent the first token seconds before the last.\n\nMeasure it by timestamping each SSE chunk. On a 500-token answer, genuine streaming shows a first delta well ahead of completion and steady increments; a buffered relay shows every delta inside the final 200 milliseconds. This check needs no access to the seller's infrastructure and catches the most common cheap implementation.\n\nShells route everything to one underlying model and paper over the differences. Edge cases expose it:\n\n`tool_calls`, the id format, and how parallel calls are numbered differ per provider. A translator that rewrites one schema into another leaks artefacts.`reasoning_content` field exists, whether image input is accepted at all, and what `finish_reason` appears on a refusal are all model-specific.\nPick two cheap checks per provider family and run them once. A shell passes neither.\n\nThis is the check that takes the longest to fake, because it is cumulative. A gateway that carries 336 models has to publish, per model, the context window, capability flags, the official price and its tiers, and a source link — otherwise its buyers cannot price anything. Our own [model reference pages](https://ai.dijinlong.com/model-docs) are the version of that surface we are willing to be judged on: one page per model, official price with tiers, and a source link per entry.\n\n| What a shell shows | What a real gateway shows | \n|---|---|\n| A model list that stops at the popular 20 | Every model it can actually route, with a page each | \n| One price per model, no tiers | Input and output priced separately, plus per-image / per-second units | \n| No source links | A link back to the provider's own documentation per model | \n| Context limits copied into marketing copy | Context limits stated on the model's own page, next to the price | \n\nCross-check three models from the list against the provider's official docs. If the context window, the unit and the tier all match, the catalogue is maintained by someone reading primary sources.\n\nError behaviour is a fingerprint. A real upstream returns a 429 with `Retry-After` and a provider-shaped message, a 400 that names the offending parameter, a 401 that distinguishes \"bad key\" from \"key lacks this model\". A shell returns a generic body, often a 500 for everything, because it has only one code path.\n\nAvailability claims deserve the same scepticism. An uptime figure that is 100% for every model is marketing. What we publish on the [status page](https://ai.dijinlong.com/status) is availability derived from real buyer calls per model family, and it shows \"no data\" where no buyer has called — which is the honest answer, and not one a dashboard vendor would choose to print.\n\nThey catch shells. They do not prove that a price is fair, that a seller's margin is reasonable, or that a model is good. Those are separate questions, answered by comparing published per-model prices side by side and by reading each model's own reference page. Nor do they prove a specific request was billed at the price shown — only your invoice can do that.\n\nA gateway is a scheduling and billing system, not a name in a JSON field. The five checks above test the parts that a shell cannot fake cheaply: metering, streaming shape, per-model edges, a maintained catalogue, and honest failure reporting. If a seller passes all five and still quotes a price you like, you are probably buying something real. The [FAQ](https://ai.dijinlong.com/faq) covers the billing questions that usually follow.", "url": "https://wpnews.pro/news/how-to-verify-a-gateway-is-not-a-shell-five-checks-from-the-outside", "canonical_source": "https://dev.to/longai/how-to-verify-a-gateway-is-not-a-shell-five-checks-from-the-outside-2cce", "published_at": "2026-12-01 09:04:48+00:00", "updated_at": "2026-12-01 09:14:39.373571+00:00", "lang": "en", "topics": ["ai-infrastructure", "large-language-models", "ai-tools", "developer-tools"], "entities": ["OpenAI"], "also_reported_by": [], "takeaway": "Send the same prompt padded to roughly 200 and 2,000 tokens and confirm prompt_tokens scales about tenfold while completion_tokens stays flat, and timestamp SSE chunks to catch buffered relays where time-to-first-token nearly equals total latency.", "recommendation": {"advice": "Before trusting an OpenAI-compatible gateway, compare usage token counts across padded prompts, timestamp SSE chunks for real streaming, and cross-check three catalogue entries against provider docs.", "playbook": "production-ops", "playbook_url": "https://wpnews.pro/playbooks/production-ops"}, "alternates": {"html": "https://wpnews.pro/news/how-to-verify-a-gateway-is-not-a-shell-five-checks-from-the-outside", "markdown": "https://wpnews.pro/news/how-to-verify-a-gateway-is-not-a-shell-five-checks-from-the-outside.md", "text": "https://wpnews.pro/news/how-to-verify-a-gateway-is-not-a-shell-five-checks-from-the-outside.txt", "jsonld": "https://wpnews.pro/news/how-to-verify-a-gateway-is-not-a-shell-five-checks-from-the-outside.jsonld"}}