ChatStreamingResponse - TypeScript SDK

ChatStreamingResponse type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Example Usage

1import { ChatStreamingResponse } from "@openrouter/sdk/models";
2
3let value: ChatStreamingResponse = {
4 data: {
5 choices: [
6 {
7 delta: {},
8 finishReason: null,
9 index: 0,
10 },
11 ],
12 created: 1677652288,
13 id: "chatcmpl-123",
14 model: "openai/gpt-4",
15 object: "chat.completion.chunk",
16 },
17};

Fields

FieldTypeRequiredDescriptionExample
datamodels.ChatStreamChunk✔️Streaming chat completion chunk{"choices": [{"delta": {"content": "Hello","role": "assistant"},
“finish_reason”: null,
“index”: 0<br />}
],
“created”: 1677652288,
“id”: “chatcmpl-123”,
“model”: “openai/gpt-4”,
“object”: “chat.completion.chunk”
}