Example Usage
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
background | boolean | :heavy_minus_sign: | N/A | |
completedAt | number | :heavy_check_mark: | N/A | |
createdAt | number | :heavy_check_mark: | N/A | |
error | models.ResponsesErrorField | :heavy_check_mark: | Error information returned from the API | {"code": "rate_limit_exceeded","message": "Rate limit exceeded. Please try again later."} |
frequencyPenalty | number | :heavy_check_mark: | N/A | |
id | string | :heavy_check_mark: | N/A | |
incompleteDetails | models.IncompleteDetails | :heavy_check_mark: | N/A | {"reason": "max_output_tokens"} |
instructions | models.BaseInputsUnion | :heavy_check_mark: | N/A | [{"content": "What is the weather today?","role": "user"}] |
maxOutputTokens | number | :heavy_minus_sign: | N/A | |
maxToolCalls | number | :heavy_minus_sign: | N/A | |
metadata | Record<string, *string*> | :heavy_check_mark: | 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"} |
model | string | :heavy_check_mark: | N/A | |
object | models.OpenResponsesResultObject | :heavy_check_mark: | N/A | |
output | models.OutputItems[] | :heavy_check_mark: | N/A | |
outputText | string | :heavy_minus_sign: | N/A | |
parallelToolCalls | boolean | :heavy_check_mark: | N/A | |
presencePenalty | number | :heavy_check_mark: | N/A | |
previousResponseId | string | :heavy_minus_sign: | N/A | |
prompt | models.StoredPromptTemplate | :heavy_minus_sign: | N/A | {"id": "prompt-abc123","variables": {"name": "John"}} |
promptCacheKey | string | :heavy_minus_sign: | N/A | |
reasoning | models.BaseReasoningConfig | :heavy_minus_sign: | N/A | {"effort": "medium","summary": "auto"} |
safetyIdentifier | string | :heavy_minus_sign: | N/A | |
serviceTier | string | :heavy_minus_sign: | N/A | |
status | models.OpenAIResponsesResponseStatus | :heavy_check_mark: | N/A | completed |
store | boolean | :heavy_minus_sign: | N/A | |
temperature | number | :heavy_check_mark: | N/A | |
text | models.TextExtendedConfig | :heavy_minus_sign: | Text output configuration including format and verbosity | {"format": {"type": "text"}} |
toolChoice | models.OpenAIResponsesToolChoiceUnion | :heavy_check_mark: | N/A | auto |
tools | models.OpenResponsesResultToolUnion[] | :heavy_check_mark: | N/A | |
topLogprobs | number | :heavy_minus_sign: | N/A | |
topP | number | :heavy_check_mark: | N/A | |
truncation | models.Truncation | :heavy_minus_sign: | N/A | auto |
usage | models.Usage | :heavy_minus_sign: | Token usage information for the response | {"cost": 0.0012,"cost_details": {"upstream_inference_cost": null,"upstream_inference_input_cost": 0.0008,"upstream_inference_output_cost": 0.0004},“input_tokens”: 10, “input_tokens_details”: {"cached_tokens": 0},“output_tokens”: 25, “output_tokens_details”: {"reasoning_tokens": 0},“total_tokens”: 35<br/>} |
user | string | :heavy_minus_sign: | N/A | |
openrouterMetadata | models.OpenRouterMetadata | :heavy_minus_sign: | N/A | {"attempt": 1,"endpoints": {"available": [{"model": "openai/gpt-4o","provider": "OpenAI","selected": true}], “total”: 1<br/>},“is_byok”: false, “region”: “iad”, “requested”: “openai/gpt-4o”, “strategy”: “direct”, “summary”: “available=1, selected=OpenAI” } |