cURL Example

Use this example for direct SSE testing from terminal.

Minimal Request

curl -N https://chat-proxy.bitseek.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -H "Authorization: Bearer <API-KEY>" \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "Hello, please introduce yourself."
      }
    ]
  }'

With temperature + tools

curl -N https://chat-proxy.bitseek.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -H "Authorization: Bearer <API-KEY>" \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "What is 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"]
          }
        }
      }
    ]
  }'

With enableWebSearch + webSearch.mode

curl -N https://chat-proxy.bitseek.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -H "Authorization: Bearer <API-KEY>" \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "Latest AI regulations in EU this week"
      }
    ],
    "enableWebSearch": true,
    "webSearch": {
      "enabled": true,
      "mode": "force",
      "maxResults": 5,
      "freshness": "week",
      "lang": "auto"
    }
  }'

Notes

  • -N disables curl buffering so chunks print immediately.
  • Response is a stream of data: {json} events.
  • Completion is indicated by final chunk finish_reason (stop or tool_calls) and connection close.

results matching ""

    No results matching ""