HTTP SSE API (/v1/chat/completions)

Bitseek provides an OpenAI-style HTTP endpoint with SSE streaming response.

This is suitable for OpenAI SDK clients and raw curl integrations.

Endpoint

  • URL: https://chat-proxy.bitseek.ai/v1/chat/completions
  • Method: POST
  • Response: text/event-stream
  • Auth Header: Authorization: Bearer <API-KEY-OR-TOKEN>

Request Headers

Header Required Value
Content-Type Yes application/json
Authorization Yes Bearer <API-KEY-OR-TOKEN>
Accept Recommended text/event-stream
X-Conversation-Id Optional existing conversation id

Request Body (Supported Fields)

Only the following fields are currently supported by this endpoint.

Field Type Required Description
messages Array<{ role, content }> Yes Chat messages. content should be string.
temperature number No Clamped to 0 ~ 2.
tools OpenAI tool[] No Passed through to downstream OpenAI-compatible path; used for tool-call streaming.
enableWebSearch boolean or 0/1 or "true"/"false" No Web search switch (quick flag).
webSearch.enabled boolean or 0/1 or "true"/"false" No Same purpose as enableWebSearch.
webSearch.mode "auto" or "force" No Default: auto.
webSearch.maxResults number No Normalized to 1 ~ 8, default 5.
webSearch.freshness "day" or "week" or "month" or "any" No Default: week.
webSearch.lang "zh" or "en" or "auto" No Default: auto.

Minimal Request Example

{
  "messages": [
    {
      "role": "user",
      "content": "Hello, please introduce yourself."
    }
  ]
}

Tool Calling Example (SSE)

{
  "messages": [
    {
      "role": "user",
      "content": "What's the weather in Singapore?"
    }
  ],
  "temperature": 0.2,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get weather by city",
        "parameters": {
          "type": "object",
          "properties": {
            "city": { "type": "string" }
          },
          "required": ["city"]
        }
      }
    }
  ]
}

Streaming Behavior

  • Response chunks are OpenAI-style JSON under data: ....
  • choices[0].delta.content carries text deltas.
  • choices[0].delta.tool_calls may appear when tools are used.
  • Final chunk sets choices[0].finish_reason to:
    • stop, or
    • tool_calls.
  • Stream ends when the server closes the HTTP response.

For exact SSE chunk schema and examples, see SSE Response Format.

results matching ""

    No results matching ""