Skip to content

Error-only 200 body is documented but not in the OpenAPI, so the generated SDKs reject it #582

Description

@ishankaul1

The errors page says a request that fails after the provider returned headers gets "a 200 OK
whose JSON body holds only an error object and no choices"
(https://openrouter.ai/docs/api/reference/errors-and-debugging#non-streaming-requests).

The OpenAPI (https://openrouter.ai/openapi.json, schema ChatResult) models the
/chat/completions 200 only as ChatResult, with id, choices, created, model, object
and system_fingerprint required, and no alternative for the error-only body. The generated SDKs
follow the spec, so they reject the documented body:

Which shape do buyers actually receive for this case, and could the spec model it so the SDKs can
surface the error?

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions