Sionic Opengateway
    • Default module
      • Overview
        • Getting Started With OpenGateway
        • Model Compatible
      • Apis
        • /chat/completions
        • /v1/chat/completions
    • og-onprem
      • Chat Completions
        • Create chat completion
      • Responses
        • Create a model response
      • Messages
        • Create a message (Anthropic Messages format)
      • Embeddings
        • Create embeddings
      • Images
        • Create image
        • Edit image
      • Models
        • List models
      • Schemas
        • ModelId
        • DebugCategory
        • FallbackModels
        • DebugCategories
        • Extra
        • Debug
        • OpenAIError
        • OpenAIErrorResponse
        • AnthropicErrorResponse
        • CacheControl
        • ChatContentPart
        • ChatTextPart
        • ChatImagePart
        • ToolCall
        • ChatMessage
        • FunctionDefinition
        • ChatTool
        • ToolChoice
        • ChatCompletionRequest
        • ChatCompletionUsage
        • LogprobToken
        • ChatCompletion
        • ChatCompletionChunk
        • ResponsesInputItem
        • ResponsesMessageItem
        • ResponsesFunctionCallItem
        • ResponsesFunctionCallOutputItem
        • ResponsesTool
        • ResponsesRequest
        • ResponseObject
        • MessagesRequest
        • AnthropicMessage
        • EmbeddingsRequest
        • EmbeddingsResponse
        • ImageGenerationRequest
        • ImageEditRequest
        • ImagesResponse
        • ModelStatus
        • CatalogEndpoint
        • Model
        • ModelList

    ChatCompletionChunk

    One SSE data: payload. Text arrives in choices[].delta.content; tool calls in
    choices[].delta.tool_calls (accumulate by index). The final choice chunk includes
    finish_reason. With stream_options.include_usage a usage-only chunk is added. In Chat
    Completions streaming, debug appears on the final chunk with a finish reason.

    {
        "id": "string",
        "object": "chat.completion.chunk",
        "choices": [
            {
                "index": 0,
                "delta": {
                    "content": "string",
                    "tool_calls": [
                        {
                            "property1": "string",
                            "property2": "string"
                        }
                    ]
                },
                "finish_reason": "string"
            }
        ],
        "usage": {
            "prompt_tokens": 0,
            "completion_tokens": 0,
            "total_tokens": 0,
            "prompt_tokens_details": {
                "cached_tokens": 0
            },
            "completion_tokens_details": {
                "reasoning_tokens": 0
            }
        },
        "debug": {
            "normalizations": [
                {
                    "param": "string",
                    "action": "add",
                    "before": null,
                    "after": null
                }
            ],
            "deprecations": [
                {
                    "param": "string",
                    "message": "string"
                }
            ],
            "routing": [
                {
                    "provider": "string",
                    "region": "string",
                    "status": "failed",
                    "target": "string"
                }
            ]
        }
    }
    Built with