Skip to content
Source
Sign inSign up
TanStack/schemas

Generation OpenAPI describes streams and file uploads as JSON #559

Send to my agent
Closedtombeckenham opened this issue 0 comments
tombeckenhamcommented

GET /v1/openapi/{provider} is the document we want to feed to @hey-api/openapi-ts. The operations that stream, and the operations that upload a file, are described as a JSON body and a JSON 200.

Fetched 2026-11-04.

OpenAI (GET /v1/openapi/openai, 38 paths). No path uses text/event-stream, multipart/form-data, an audio type, or application/octet-stream.

OperationRequest content200 content
POST /chat/completionsapplication/jsonapplication/json
POST /responsesapplication/jsonapplication/json
POST /audio/transcriptionsapplication/jsonapplication/json

Transcriptions take a file. The document has a JSON file property.

Anthropic POST /v1/messages: the 200 content is application/json only. stream is a boolean on the JSON body. The SSE event stream is not a response content type. Required header anthropic-version is present, which is right.

A client generated from this document calls JSON.parse on an SSE body and sends audio as JSON.

Ask

When the upstream operation streams, put the real stream media type on the 200 response (text/event-stream, or whatever that provider returns). When the call uploads a file, declare multipart/form-data.

  1. tombeckenham added labelsbug

  2. tombeckenham closed this

Sign in to join this conversation.