> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter-d02e98a0-mintlify-7021d5f4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ResponsesRequest - Go SDK

> ResponsesRequest type definition

<Warning>
  The Go SDK and docs are currently in beta.
  Report issues on [GitHub](https://github.com/OpenRouterTeam/go-sdk/issues).
</Warning>

Request schema for Responses endpoint

## Fields

| Field                 | Type                                                                                                                                           | Required             | Description                                                                                                                                                                                                                                                                                                                                                                                                          | Example                                                                                                            |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `Background`          | optionalnullable.OptionalNullable\[`bool`]                                                                                                     | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `CacheControl`        | [\*components.AnthropicCacheControlDirective](/client-sdks/go/api-reference/models/anthropiccachecontroldirective)                             | :heavy\_minus\_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.                                                                                                                                                                                                          | `{"type": "ephemeral"}`                                                                                            |
| `FrequencyPenalty`    | optionalnullable.OptionalNullable\[`float64`]                                                                                                  | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `ImageConfig`         | map\[string][components.ImageConfig](/client-sdks/go/api-reference/models/imageconfig)                                                         | :heavy\_minus\_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See [https://openrouter.ai/docs/guides/overview/multimodal/image-generation](https://openrouter.ai/docs/guides/overview/multimodal/image-generation) for more details.                                                                                                                                                        | `{"aspect_ratio": "16:9","quality": "high"}`                                                                       |
| `Include`             | optionalnullable.OptionalNullable\[\[][components.ResponseIncludesEnum](/client-sdks/go/api-reference/models/responseincludesenum)]            | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `Input`               | [\*components.InputsUnion](/client-sdks/go/api-reference/models/inputsunion)                                                                   | :heavy\_minus\_sign: | Input for a response request - can be a string or array of items                                                                                                                                                                                                                                                                                                                                                     | \[<br />`{"content": "What is the weather today?","role": "user"}`<br />]                                          |
| `Instructions`        | optionalnullable.OptionalNullable\[`string`]                                                                                                   | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `MaxOutputTokens`     | optionalnullable.OptionalNullable\[`int64`]                                                                                                    | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `MaxToolCalls`        | optionalnullable.OptionalNullable\[`int64`]                                                                                                    | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `Metadata`            | optionalnullable.OptionalNullable\[map\[string]`string`]                                                                                       | :heavy\_minus\_sign: | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.                                                                                                                                                                                                                                                         | `{"session_id": "abc-def-ghi","user_id": "123"}`                                                                   |
| `Modalities`          | \[][components.OutputModalityEnum](/client-sdks/go/api-reference/models/outputmodalityenum)                                                    | :heavy\_minus\_sign: | Output modalities for the response. Supported values are "text" and "image".                                                                                                                                                                                                                                                                                                                                         | \[<br />"text",<br />"image"<br />]                                                                                |
| `Model`               | `*string`                                                                                                                                      | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `Models`              | \[]`string`                                                                                                                                    | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `ParallelToolCalls`   | optionalnullable.OptionalNullable\[`bool`]                                                                                                     | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `Plugins`             | \[][components.ResponsesRequestPlugin](/client-sdks/go/api-reference/models/responsesrequestplugin)                                            | :heavy\_minus\_sign: | Plugins you want to enable for this request, including their settings.                                                                                                                                                                                                                                                                                                                                               |                                                                                                                    |
| `PresencePenalty`     | optionalnullable.OptionalNullable\[`float64`]                                                                                                  | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `PreviousResponseID`  | optionalnullable.OptionalNullable\[`string`]                                                                                                   | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `Prompt`              | optionalnullable.OptionalNullable\[[components.StoredPromptTemplate](/client-sdks/go/api-reference/models/storedprompttemplate)]               | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  | `{"id": "prompt-abc123","variables": {"name": "John"}`<br />}                                                      |
| `PromptCacheKey`      | optionalnullable.OptionalNullable\[`string`]                                                                                                   | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `Provider`            | optionalnullable.OptionalNullable\[[components.ProviderPreferences](/client-sdks/go/api-reference/models/providerpreferences)]                 | :heavy\_minus\_sign: | When multiple model providers are available, optionally indicate your routing preference.                                                                                                                                                                                                                                                                                                                            | `{"allow_fallbacks": true}`                                                                                        |
| `Reasoning`           | optionalnullable.OptionalNullable\[[components.ReasoningConfig](/client-sdks/go/api-reference/models/reasoningconfig)]                         | :heavy\_minus\_sign: | Configuration for reasoning mode in the response                                                                                                                                                                                                                                                                                                                                                                     | `{"enabled": true,"summary": "auto"}`                                                                              |
| `SafetyIdentifier`    | optionalnullable.OptionalNullable\[`string`]                                                                                                   | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `ServiceTier`         | optionalnullable.OptionalNullable\[[components.ResponsesRequestServiceTier](/client-sdks/go/api-reference/models/responsesrequestservicetier)] | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `SessionID`           | `*string`                                                                                                                                      | :heavy\_minus\_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. |                                                                                                                    |
| `StopServerToolsWhen` | \[][components.StopServerToolsWhenCondition](/client-sdks/go/api-reference/models/stopservertoolswhencondition)                                | :heavy\_minus\_sign: | Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`.                                                                                                                                                                                                                                                                           | \[<br />`{"step_count": 5,"type": "step_count_is"}`,<br />`{"max_cost_in_dollars": 0.5,"type": "max_cost"}`<br />] |
| `Store`               | `*bool`                                                                                                                                        | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `Stream`              | `*bool`                                                                                                                                        | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `Temperature`         | optionalnullable.OptionalNullable\[`float64`]                                                                                                  | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `Text`                | [\*components.TextExtendedConfig](/client-sdks/go/api-reference/models/textextendedconfig)                                                     | :heavy\_minus\_sign: | Text output configuration including format and verbosity                                                                                                                                                                                                                                                                                                                                                             | `{"format": {"type": "text"}`<br />}                                                                               |
| `ToolChoice`          | [\*components.OpenAIResponsesToolChoiceUnion](/client-sdks/go/api-reference/models/openairesponsestoolchoiceunion)                             | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  | auto                                                                                                               |
| `Tools`               | \[][components.ResponsesRequestToolUnion](/client-sdks/go/api-reference/models/responsesrequesttoolunion)                                      | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `TopK`                | `*int64`                                                                                                                                       | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `TopLogprobs`         | optionalnullable.OptionalNullable\[`int64`]                                                                                                    | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `TopP`                | optionalnullable.OptionalNullable\[`float64`]                                                                                                  | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                    |
| `Trace`               | [\*components.TraceConfig](/client-sdks/go/api-reference/models/traceconfig)                                                                   | :heavy\_minus\_sign: | Metadata for observability and tracing. Known keys (trace\_id, trace\_name, span\_name, generation\_name, parent\_span\_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.                                                                                                                                                                       | `{"trace_id": "trace-abc123","trace_name": "my-app-trace"}`                                                        |
| `Truncation`          | optionalnullable.OptionalNullable\[[components.OpenAIResponsesTruncation](/client-sdks/go/api-reference/models/openairesponsestruncation)]     | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                                                                                                                                                                  | auto                                                                                                               |
| `User`                | `*string`                                                                                                                                      | :heavy\_minus\_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters.                                                                                                                 |                                                                                                                    |
