Skip to content

[DOCS] Messages API stop_reason is nullable and gains model_context_window_exceeded #1262

Closed

Description

Summary

inference-gateway/schemas#329 changes the Anthropic-compatible MessagesResponse.stop_reason field: it is now nullable (null in the streaming message_start event, non-null otherwise) and the enum gains model_context_window_exceeded. Any docs page describing the Messages API response or streaming events should reflect this.

Acceptance Criteria

Activity

  1. added
    documentation
    on Nov 17, 2026
  2. edenreich commented on Nov 17, 2026

    @edenreich
    Contributor

    @claude can you document this?

  3. inference-gateway-maintainer commented on Nov 17, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Claude finished @edenreich's task in 1m 47s —— View job • docs/issue-1262-20261117-2021 • [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-1262-20261117-2021?quick_pull=1&title=Issue%20%231262%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%231262%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Documented nullable stop_reason

    • Tracked the issue on the Roadmap board (now QA)
    • Looked for pages covering the Messages API: there were none, only a passing mention in observability.md
    • Documented the nullable stop_reason and model_context_window_exceeded
    • Ran lint:md, format:check and build: all three pass
    • Committed and opened PR docs(api): document messages api and nullable stop_reason #1268

    What changed: I added a new Messages API section to api-reference.md, between the Responses API and Decisions API sections. It covers:

    • POST /v1/messages with a request example and a MessagesResponse example.
    • A Stop reasons section. stop_reason is always present but can be null:
      • It is set in non-streaming responses.
      • It is null in the first streaming event, message_start.
      • The final value arrives in the message_delta event.
    • A table of every stop reason, including the new model_context_window_exceeded.
    • A Streaming subsection that lists the stream event types, with a message_start / message_delta example.

    One criterion is partly met: the link to inference-gateway/schemas#329 is in the PR body, not on the docs page. AGENTS.md doesn't allow issue or PR references in doc content.

    The examples' IDs, token counts and model version string are made up for illustration. All field names and enum values come from the current openapi.yaml.
    | Branch | PR #1268

  4. moved this from In progress to QA in 2026on Nov 17, 2026
  5. inference-gateway-releaser commented on Nov 17, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.27 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

  6. moved this from QA to Done in 2026on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions