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?
The errors page says a request that fails after the provider returned headers gets "a
200 OKwhose JSON body holds only an
errorobject and nochoices"(https://openrouter.ai/docs/api/reference/errors-and-debugging#non-streaming-requests).
The OpenAPI (https://openrouter.ai/openapi.json, schema
ChatResult) models the/chat/completions200 only asChatResult, withid,choices,created,model,objectand
system_fingerprintrequired, and no alternative for the error-only body. The generated SDKsfollow the spec, so they reject the documented body:
ChatResultinhttps://github.com/OpenRouterTeam/python-sdk/blob/main/src/openrouter/components/chatresult.py
has all of those as required fields;
client.chat.send(stream=False)raisesResponseValidationError("6 validation errors for ChatResult").ChatResultinhttps://github.com/OpenRouterTeam/go-sdk/blob/main/models/components/chatresult.go has no
Errorfield, so the body unmarshals to an empty result and the error is dropped.Which shape do buyers actually receive for this case, and could the spec model it so the SDKs can
surface the error?