Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Example Usage

import { ChatStreamingResponse } from "@openrouter/sdk/models";

let value: ChatStreamingResponse = {
  data: {
    choices: [
      {
        delta: {},
        finishReason: null,
        index: 0,
      },
    ],
    created: 1677652288,
    id: "chatcmpl-123",
    model: "openai/gpt-4",
    object: "chat.completion.chunk",
  },
};

Fields

FieldTypeRequiredDescriptionExample
datamodels.ChatStreamChunk:heavy_check_mark: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”
}