Decorative Curve
Back to Resources

What LLMs Tend to Hallucinate When API Docs Are Incomplete

A checklist of the most common invented details, useful when reviewing a reference for gaps.

March 19, 20262 min read

When an API reference is missing information, models do not stop. They fill in. The substitutions are predictable enough to be useful as a review checklist.

Endpoint paths

If you document GET /users/{id} and GET /accounts/{id} but never mention /billing, a model asked about billing will often invent GET /billing/{id}. The convention is so consistent across REST APIs that the model assumes yours follows it.

The fix is to list every resource at least once in a top-level index, even if some of them are read-only or undocumented for other reasons.

Auth headers

The default guess is Authorization: Bearer <token>. If your scheme is different, say so on the page that introduces auth and on every example that uses it. Models trained on the public web have seen Bearer auth more than any other format, and that prior is hard to override with a single mention.

Pagination parameters

The common guesses are page, limit, offset, cursor, and per_page. If your params are named anything else, you need an example. Even if the names match, an example removes the ambiguity between offset-based and cursor-based pagination.

Status codes

Models will assume 200 for success, 400 for bad input, 401 for missing auth, 403 for forbidden, 404 for missing, 500 for server error. If your API returns something else, you need to say so on the error page and in the examples. 422 for validation, for instance, is common but not assumed.

Default values

When a field is optional and the default is not stated, models tend to pick 10, 20, or 100 for limits, false for booleans, and null for objects. Sometimes the guess matches your real default. Often it does not.

Spell out every default. One column in the parameters table is enough.

Field name pluralization

Models will switch between singular and plural based on context. If your field is tags and your prose calls it "the tag," a later call might use tag. Keep both the schema name and the prose consistent.

Using this as a review

Open your reference and look for each of the things above. Anywhere the page does not state the thing explicitly, a model is filling in the gap. Sometimes correctly. Often not.

Connector
Everything to Build Great Docs
Connector
The Full Documentation Stack
Decorative CurveReady?
Get a preview
of your docs
ConnectorConnector
Decorative Curve
Terms of ServicePrivacy Policy
MSA