Beta.Responses - TypeScript SDK

Beta.Responses method reference

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Overview

beta.responses endpoints

Available Operations

  • send - Create a response

send

Creates a streaming or non-streaming response using OpenResponses API format

Example Usage

Standalone function

The standalone function version of this method:

Parameters

ParameterTypeRequiredDescription
requestmodels.OpenResponsesRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.CreateResponsesResponse>

Errors

Error TypeStatus CodeContent Type
errors.BadRequestResponseError400application/json
errors.UnauthorizedResponseError401application/json
errors.PaymentRequiredResponseError402application/json
errors.NotFoundResponseError404application/json
errors.RequestTimeoutResponseError408application/json
errors.PayloadTooLargeResponseError413application/json
errors.UnprocessableEntityResponseError422application/json
errors.TooManyRequestsResponseError429application/json
errors.InternalServerResponseError500application/json
errors.BadGatewayResponseError502application/json
errors.ServiceUnavailableResponseError503application/json
errors.EdgeNetworkTimeoutResponseError524application/json
errors.ProviderOverloadedResponseError529application/json
errors.OpenRouterDefaultError4XX, 5XX*/*