Skip to content

docs(api): document messages api and nullable stop_reason - #1268

Merged
edenreich merged 1 commit into
mainfrom
docs/issue-1262-20261117-2021
Nov 17, 2026
Merged

edenreich merged 1 commit into
mainfrom
docs/issue-1262-20261117-2021

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Summary

Documents the Anthropic-compatible Messages API (POST /v1/messages) in api-reference.md, reflecting inference-gateway/schemas#329.

  • New "Messages API" section with request and MessagesResponse examples (there was no Messages API section before)
  • "Stop reasons" table, including the new model_context_window_exceeded value
  • Explains stop_reason is always present but nullable: null in the message_start stream event, final value delivered in message_delta, non-null in non-streaming responses
  • Streaming subsection listing MessagesStreamEvent types with a message_start / message_delta example

The schemas PR link lives in this PR body only, since AGENTS.md forbids tracker references in doc content.

Validated with bun run lint:md, bun run format:check and bun run build.

Closes #1262

Generated with Claude Code

@edenreich

Copy link
Copy Markdown
Contributor

@claude CI is failing, can you fix this?

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 27s —— View job


CI failure: Cloudflare preview upload, not the docs change

  • Find failing CI job
  • Diagnose
  • Re-run the failed job

The only failing check is Preview → Deploy preview, at the Upload preview version step. The main CI workflow (lint, format and build) passed on this commit.

Wrangler built the site and began uploading assets. Every upload attempt failed, five retries each, and then the call ended with:

POST /accounts/***/workers/assets/upload?base64=true -> 401 Unauthorized

The Cloudflare upload endpoint rejected the credentials, so the PR content didn't cause this. No commit was needed. I re-ran the failed job (gh run rerun 44168797323 --failed), which will clear it if the 401 was a temporary Cloudflare problem.

If the re-run fails with the same 401, the CLOUDFLARE_API_TOKEN secret (or whichever secret the preview workflow uses) has probably expired or lost its Workers write permission. Someone with access to the repo or org secrets will need to rotate it. I can't do that from here.

@inference-gateway-releaser

inference-gateway-releaser Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🗑️ Preview environment destroyed.

@edenreich
edenreich merged commit 02e10df into main Nov 17, 2026
1 check passed
@edenreich
edenreich deleted the docs/issue-1262-20261117-2021 branch November 17, 2026 20:29
inference-gateway-releaser Bot added a commit that referenced this pull request Nov 17, 2026
## [0.9.27](0.9.26...0.9.27) (2026-11-17)

### ♻️ Improvements

* **scripts:** use Bun.YAML.parse in generate-provider-docs ([#1241](#1241)) ([bdfad7c](bdfad7c))
* **vitepress:** derive Mermaid lazy-chunk regexes from one constant ([#1243](#1243)) ([65de689](65de689))

### 🐛 Bug Fixes

* **ci:** reuse generate:check in the drift job and cover sdks.md ([#1245](#1245)) ([b34ee2d](b34ee2d))

### 👷 CI

* align Dependabot schedule and grouping ([#1231](#1231)) ([40f417f](40f417f))
* set up orchestrators from repos.yaml ([#1246](#1246)) ([6e03863](6e03863))

### 📚 Documentation

* **api:** document messages api and nullable stop_reason ([#1268](#1268)) ([02e10df](02e10df))
* **api:** document nullable and optional stream chunk fields ([#1267](#1267)) ([a0923a4](a0923a4))
* **cli:** cover plan-mode web tools and the WebFetch scratchpad redirect ([#1248](#1248)) ([cdfa57e](cdfa57e))
* **cli:** surface the skills, plugins and hooks runnable examples ([#1258](#1258)) ([78c2686](78c2686))
* document bash path-check text exemptions ([#1234](#1234)) ([395c17c](395c17c))
* document kernel-confined bash writes in CLI sandbox ([#1235](#1235)) ([2a78ac0](2a78ac0))
* document the Video, PreserveSpeech and StartOffsetSeconds inputs on the Go SDK CreateVideo ([#1223](#1223)) ([264018f](264018f))
* dubbing a video with mirelo through the videos api ([#1214](#1214)) ([cf0141c](cf0141c))
* dubvideo tool and the video_to_sfx dub switch ([#1222](#1222)) ([ac93910](ac93910))
* elevenlabs video scoring on the sfx endpoint ([#1215](#1215)) ([8469b96](8469b96))
* go sdk CreateSFX and CreateMusic are shipped ([#1225](#1225)) ([48d348f](48d348f))
* image edits through elevenlabs and avatars with one key ([#1211](#1211)) ([df745fc](df745fc))
* link the CLI media-audio and media-video examples ([#1228](#1228)) ([aee7e9e](aee7e9e))
* link the subagents and ag-ui runnable examples ([#1256](#1256)) ([534af1c](534af1c))
* **observability:** add gateway tracing walkthrough with Jaeger ([#1250](#1250)) ([54951f7](54951f7))
* **operator:** document Gateway server and MCP request timeouts ([#1254](#1254)) ([aff281e](aff281e))
* **operator:** mirelo provider block for spec.audio ([#1209](#1209)) ([c3f03b8](c3f03b8))
* **operator:** wire GPU runtime as openai provider, drop custom ([#1253](#1253)) ([7334cdf](7334cdf))
* repoint example links to domain-first layout ([#1217](#1217)) ([d596bb5](d596bb5))
* resending a prompt and conversation rewind frames ([#1203](#1203)) ([63a42b2](63a42b2))
* scoring a video on the sound-effects endpoint ([#1210](#1210)) ([1d03ef9](1d03ef9))
* **sdks:** bump TypeScript SDK to 0.30.0 and note pin upgrade ([#1265](#1265)) ([bd42f1a](bd42f1a))
* **sdks:** document Go SDK audio modes, keys and examples ([#1266](#1266)) ([98601de](98601de))
* **sdks:** read python stream chunks as plain json ([#1264](#1264)) ([93276e5](93276e5))
* speech through the gateway and spec.audio ([#1201](#1201)) ([979ae1e](979ae1e))
* videotosfx tool and the sfx scoring budget ([#1221](#1221)) ([4e08dc8](4e08dc8))
* wav output for elevenlabs speech ([#1208](#1208)) ([d36e358](d36e358))

### 🔧 Miscellaneous

* **deps-dev:** bump prettier from 3.9.10 to 3.10.1 in the bun group ([#1226](#1226)) ([d82d26e](d82d26e))
* **deps:** bump bun to 1.4.4 ([#1242](#1242)) ([f5cf0fc](f5cf0fc))
* **deps:** bump flox dependencies to latest ([#1229](#1229)) ([c0b5858](c0b5858))
* **deps:** bump flox dependencies to latest ([#1230](#1230)) ([1cf291c](1cf291c))
* **deps:** resolve wrangler via devDependencies instead of pinned bunx literals ([#1244](#1244)) ([35c4c29](35c4c29))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.9.27 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS] Messages API stop_reason is nullable and gains model_context_window_exceeded

1 participant