LLM Gateway Docs: What to Look For Before You Integrate
Good LLM gateway docs answer one question fast: can I get from "I have an API key" to "I have a working request" in under ten minutes? If the docs make you hunt for the base URL, guess at auth headers, or reverse-engineer the response shape from a Postman collection, that's a signal about the product itself, not just the writing.
This article covers what to check for when you're reading LLM gateway documentation — whether you're evaluating a provider before signing up or trying to get unstuck mid-integration. We'll use SubToAPI's docs structure as a concrete example, since the same checklist applies to any gateway you're considering.
Why gateway docs matter more than usual
An LLM gateway sits between your application and a model provider. It's infrastructure — if the docs are vague about authentication, rate limits, or error codes, you'll find out in production, not in a sandbox. Unlike a UI product where bad docs mean a support ticket, bad gateway docs mean a debugging session at 2am when a stream drops mid-response and you don't know why.
The core question good docs answer is: what exactly does a request and response look like, byte for byte? Everything else — pricing, dashboards, marketing copy — is secondary to that.
What a complete set of LLM gateway docs should cover
1. Authentication, in one code block
You should be able to copy one curl command, swap in your key, and get a 200 response. Not a 40-line OAuth flow explanation. Look for:
- The exact header format (
Authorization: Bearer sub_live_...,x-api-key, etc.) - Whether keys are scoped per-application or per-account
- What a 401 response body actually looks like
2. A single canonical endpoint reference
Most gateways funnel everything through a small number of endpoints — typically one for messages/completions and one for listing models. Docs should show the full request schema, not just a happy-path example:
curl https://api.subtoapi.app/v1/messages \
-H "Authorization: Bearer $SUBTOAPI_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Summarize this changelog in two sentences."}
]
}'
If the docs don't show required vs. optional fields clearly, you'll end up making trial-and-error requests to find out.
3. Streaming behavior
Streaming is where most gateway docs fall short. You need to know the event format (SSE, chunked JSON, something custom), how to detect stream completion, and how errors surface mid-stream. A JavaScript snippet is usually more useful here than a curl example:
const res = await fetch("https://api.subtoapi.app/v1/messages", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
"content-type": "application/json"
},
body: JSON.stringify({
model: "claude-sonnet-4",
max_tokens: 1024,
stream: true,
messages: [{ role: "user", content: "Draft a release note." }]
})
});
const reader = res.body.getReader();
// read and parse SSE chunks here
Full streaming reference belongs in a dedicated page — see /docs/streaming for how SubToAPI documents this.
4. Tool use / function calling
If the gateway supports tool calls, the docs need to show the full round trip: how you declare a tool schema, how the model's tool-call response looks, and how you feed the tool result back in. This is usually the most-skipped section in gateway docs, and it's the one developers need most once they move past basic chat. SubToAPI documents this at /docs/tools with the request/response pairs shown side by side.
5. Errors and rate limits
Docs should list actual HTTP status codes and what triggers them — not just "handle errors gracefully." At minimum you want to know: what does a rate-limit response look like, does it include a retry-after header, and are error bodies consistent across endpoints.
6. A quickstart that's actually quick
The best test of any gateway's docs is the quickstart page. It should get a working request out in one copy-paste, using a real key format and a real model name — not YOUR_MODEL_HERE. SubToAPI's /docs/quickstart is built around exactly that: create an application key at /signup, paste one curl command, see a real response.
A quick checklist for evaluating any gateway's docs
- Can you find the base URL and auth header in under 30 seconds?
- Does the reference page show full request/response JSON, not truncated examples?
- Is streaming documented separately with a working code sample?
- Are tool/function-calling docs present if the gateway supports it?
- Do error responses include example bodies, not just a table of status codes?
- Is there a changelog or version note so you know if the docs are current?
If a gateway's public docs fail more than two of these, expect friction once you're past the demo stage.
Where SubToAPI fits
SubToAPI turns your existing Claude access into a standard HTTPS API — application keys (sub_live_...), streaming, tool use, and usage metadata in one dashboard. The docs are organized the same way the checklist above suggests: /docs/quickstart for the first request, /docs/messages for the full endpoint reference, /docs/streaming for SSE handling, and /docs/tools for function-calling. Plans start at €9/month for solo use, with team and scale tiers at /pricing for shared workspaces and seat-based billing.
questions
Do LLM gateway docs differ much between providers? The core shape — auth header, a messages endpoint, streaming support — is fairly standard across gateways. The differences show up in error detail, tool-use documentation, and whether streaming examples actually work when copy-pasted.
What's the fastest way to test a gateway's docs before committing? Open the quickstart page and try to get a real response in under five minutes using only what's on that page. If you need to open a second tab to find the base URL or auth format, the docs have a gap.
Are streaming and tool-use docs usually separate from the main API reference? Yes, in well-structured docs they're broken out into their own pages, since both involve response formats that differ from a single JSON reply. If a gateway buries streaming inside a general FAQ instead of a dedicated reference, treat that as a red flag.