1. Chat Completions
Sionic Opengateway
  • Default module
    • Overview
      • Getting Started With OpenGateway
      • Model Compatible
    • Apis
      • /chat/completions
      • /v1/chat/completions
  • og-onprem
    • Chat Completions
      • Create chat completion
        POST
    • 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
  1. Chat Completions

Create chat completion

POST
/chat/completions
Creates a model response for the given chat conversation. Compatible with the OpenAI API.
With stream: true the response is a server-sent event stream of chat.completion.chunk
objects that ends with data: [DONE]. Supported parameters differ by model.

Request

Header Params

Body Params application/jsonRequired

Examples
{
    "model": "openai/gpt-4o-mini",
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "Hello!"
        }
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location '/chat/completions' \
--header 'x-opengateway-user-id;' \
--header 'x-opengateway-session-id;' \
--header 'x-sionic-task-id;' \
--header 'Content-Type: application/json' \
--data '{
    "model": "openai/gpt-4o-mini",
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "Hello!"
        }
    ]
}'

Responses

🟢200OK
application/json
A chat completion object (stream false/omitted) or an SSE stream of chat completion
chunks (stream: true). Each SSE data: line carries one ChatCompletionChunk JSON
object; the stream ends with data: [DONE].
Headers

Body

Example
{
    "id": "string",
    "object": "chat.completion",
    "created": 0,
    "model": "openai/gpt-5-mini",
    "system_fingerprint": "string",
    "service_tier": "string",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "string",
                "tool_calls": [
                    {
                        "id": "string",
                        "type": "function",
                        "function": {
                            "name": "string",
                            "arguments": "string"
                        }
                    }
                ],
                "reasoning_content": "string",
                "reasoning_details": [
                    null
                ],
                "function_call": {}
            },
            "finish_reason": "stop",
            "logprobs": {
                "content": [
                    {
                        "top_logprobs": [
                            {
                                "token": "string",
                                "logprob": 0,
                                "bytes": [
                                    0
                                ]
                            }
                        ],
                        "token": "string",
                        "logprob": 0,
                        "bytes": [
                            0
                        ]
                    }
                ],
                "refusal": null
            }
        }
    ],
    "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"
            }
        ]
    }
}
🟠400Bad Request
🟠401Unauthorized
🟠402
🟠429
🔴500Server Error
🔴503Service Unavailable
🔴529
Modified at 2026-10-27 15:03:30
Previous
/v1/chat/completions
Next
Create a model response
Built with