The TypeScript SDK and docs are currently in beta.
Report issues on GitHub.
Example Usage
import { StreamEventsResponseFailed } from "@openrouter/sdk/models";
let value: StreamEventsResponseFailed = {
response: {
completedAt: 671654,
createdAt: 1704067200,
error: null,
frequencyPenalty: 7790.29,
id: "resp-abc123",
incompleteDetails: null,
instructions: null,
metadata: null,
model: "gpt-4",
object: "response",
output: [],
parallelToolCalls: true,
presencePenalty: null,
status: "in_progress",
temperature: null,
toolChoice: "auto",
tools: [],
topP: null,
},
sequenceNumber: 0,
type: "response.failed",
};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
response | models.OpenResponsesResult | :heavy_check_mark: | Complete non-streaming response from the Responses API | {"created_at": 1704067200,"error": null,"id": "resp-abc123","incomplete_details": null,"instructions": null,"max_output_tokens": null,"metadata": null,"model": "gpt-4","object": "response","output": [{"content": [{"annotations": [],"text": "Hello! How can I help you today?","type": "output_text"}], “id”: “msg-abc123”, “role”: “assistant”, “status”: “completed”, “type”: “message” } ], “parallel_tool_calls”: true, “status”: “completed”, “temperature”: null, “tool_choice”: “auto”, “tools”: [], “top_p”: null, “usage”: {"input_tokens": 10,"input_tokens_details": {"cached_tokens": 0},“output_tokens”: 25, “output_tokens_details”: {"reasoning_tokens": 0},“total_tokens”: 35<br/>}} |
sequenceNumber | number | :heavy_check_mark: | N/A | |
type | ”response.failed” | :heavy_check_mark: | N/A |