OpenAI Compatible
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.
The ID of the Simple Chatbot to use for this completion.
A unique identifier for the conversation session.
UID
If set, partial message deltas will be sent, like in ChatGPT.
false
0.7
1
1
4096
0
0
Successful response. The format depends on the stream
parameter in the request.
API key is missing or invalid.
Client Closed Request. This custom status code indicates an internal inference error occurred. It is used to prevent client-side retries for errors that have already been handled or retried internally.
An unexpected error occurred on the server.
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
}
}