OpenResponsesResult - TypeScript SDK
OpenResponsesResult - TypeScript SDK
OpenResponsesResult type definition
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Complete non-streaming response from the Responses API
Example Usage
1 import { OpenResponsesResult } from "@openrouter/sdk/models"; 2 3 let value: OpenResponsesResult = { 4 completedAt: 831625, 5 createdAt: 1704067200, 6 error: null, 7 frequencyPenalty: 9553.57, 8 id: "resp-abc123", 9 incompleteDetails: null, 10 instructions: null, 11 metadata: null, 12 model: "gpt-4", 13 object: "response", 14 output: [ 15 { 16 content: [ 17 { 18 text: "Hello! How can I help you today?", 19 type: "output_text", 20 }, 21 ], 22 id: "msg-abc123", 23 role: "assistant", 24 type: "message", 25 }, 26 ], 27 parallelToolCalls: true, 28 presencePenalty: 9626.13, 29 status: "completed", 30 temperature: null, 31 toolChoice: "auto", 32 tools: [], 33 topP: null, 34 };
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
background | boolean | ➖ | N/A | |
completedAt | number | ✔️ | N/A | |
createdAt | number | ✔️ | N/A | |
error | models.ResponsesErrorField | ✔️ | Error information returned from the API | {"code": "rate_limit_exceeded","message": "Rate limit exceeded. Please try again later."} |
frequencyPenalty | number | ✔️ | N/A | |
id | string | ✔️ | N/A | |
incompleteDetails | models.IncompleteDetails | ✔️ | N/A | {"reason": "max_output_tokens"} |
instructions | models.BaseInputsUnion | ✔️ | N/A | [{"content": "What is the weather today?","role": "user"}] |
maxOutputTokens | number | ➖ | N/A | |
maxToolCalls | number | ➖ | N/A | |
metadata | Record<string, *string*> | ✔️ | 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 | ✔️ | N/A | |
object | models.OpenResponsesResultObject | ✔️ | N/A | |
output | models.OutputItems[] | ✔️ | N/A | |
outputText | string | ➖ | N/A | |
parallelToolCalls | boolean | ✔️ | N/A | |
presencePenalty | number | ✔️ | N/A | |
previousResponseId | string | ➖ | N/A | |
prompt | models.StoredPromptTemplate | ➖ | N/A | {"id": "prompt-abc123","variables": {"name": "John"}} |
promptCacheKey | string | ➖ | N/A | |
reasoning | models.BaseReasoningConfig | ➖ | N/A | {"effort": "medium","summary": "auto"} |
safetyIdentifier | string | ➖ | N/A | |
serviceTier | string | ➖ | N/A | |
status | models.OpenAIResponsesResponseStatus | ✔️ | N/A | completed |
store | boolean | ➖ | N/A | |
temperature | number | ✔️ | N/A | |
text | models.TextExtendedConfig | ➖ | Text output configuration including format and verbosity | {"format": {"type": "text"}} |
toolChoice | models.OpenAIResponsesToolChoiceUnion | ✔️ | N/A | auto |
tools | models.OpenResponsesResultToolUnion[] | ✔️ | N/A | |
topLogprobs | number | ➖ | N/A | |
topP | number | ✔️ | N/A | |
truncation | models.Truncation | ➖ | N/A | auto |
usage | models.Usage | ➖ | 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 | ➖ | N/A | |
openrouterMetadata | models.OpenRouterMetadata | ➖ | 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” } |