Overview
beta.responses endpointsAvailable Operations
- Send - Create a response
Send
Creates a streaming or non-streaming response using OpenResponses API formatExample Usage: guardrail-blocked
Example Usage: insufficient-permissions
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
responsesRequest | components.ResponsesRequest | :heavy_check_mark: | N/A | { “input”: [ { “content”: “Hello, how are you?”, “role”: “user”, “type”: “message” } ], “model”: “anthropic/claude-4.5-sonnet-20250929”, “temperature”: 0.7, “tools”: [ { “description”: “Get the current weather in a given location”, “name”: “get_current_weather”, “parameters”: { “properties”: { “location”: { “type”: “string” } }, “type”: “object” }, “type”: “function” } ], “top_p”: 0.9 } |
xOpenRouterMetadata | *components.MetadataLevel | :heavy_minus_sign: | Opt-in to surface routing metadata on the response under openrouter_metadata. Defaults to disabled. The legacy header X-OpenRouter-Experimental-Metadata is also accepted for backward compatibility. | enabled |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*operations.CreateResponsesResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.PaymentRequiredResponseError | 402 | application/json |
| sdkerrors.ForbiddenResponseError | 403 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.RequestTimeoutResponseError | 408 | application/json |
| sdkerrors.PayloadTooLargeResponseError | 413 | application/json |
| sdkerrors.UnprocessableEntityResponseError | 422 | application/json |
| sdkerrors.TooManyRequestsResponseError | 429 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.BadGatewayResponseError | 502 | application/json |
| sdkerrors.ServiceUnavailableResponseError | 503 | application/json |
| sdkerrors.EdgeNetworkTimeoutResponseError | 524 | application/json |
| sdkerrors.ProviderOverloadedResponseError | 529 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |