OpenAI Compatible

OpenAI Compatible Chat Completions (Simple Chatbots)

post

Provides a drop-in replacement for the OpenAI Chat Completions API, designed specifically for Simple Chatbots built in Waterflai. This endpoint is not intended for executing Chatflows or Workflows. You can use this for both streaming and non-streaming responses.

Authorizations
Body
modelstringRequired

The ID of the Simple Chatbot to use for this completion.

conversation_idstringOptional

A unique identifier for the conversation session.

Default: UID
streambooleanOptional

If set, partial message deltas will be sent, like in ChatGPT.

Default: false
temperaturenumber · floatOptionalDefault: 0.7
top_pnumber · floatOptionalDefault: 1
nintegerOptionalDefault: 1
max_tokensintegerOptionalDefault: 4096
stopone ofOptional
stringOptional
or
string[]Optional
presence_penaltynumber · floatOptionalDefault: 0
frequency_penaltynumber · floatOptionalDefault: 0
Responses
200

Successful response. The format depends on the stream parameter in the request.

post
POST /v1/chat/completions HTTP/1.1
Host: api.waterflai.ai
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 212

{
  "model": "text",
  "messages": [
    {
      "role": "system",
      "content": "text"
    }
  ],
  "conversation_id": "UID",
  "stream": false,
  "temperature": 0.7,
  "top_p": 1,
  "n": 1,
  "max_tokens": 4096,
  "stop": "text",
  "presence_penalty": 0,
  "frequency_penalty": 0
}
{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1,
  "model": "text",
  "choices": [
    {
      "index": 1,
      "message": {
        "role": "assistant",
        "content": "Waterflai is a generative AI platform."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1,
    "completion_tokens": 1,
    "total_tokens": 1
  }
}