Endpoint#
Endpoint
POST https://xpluse.plus/v1/chat/completionsCreate chat completion responses with support for text generation, multimodal input, function calling, and streaming responses.
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
Models | string | ✅ | Model identifier, such as openai/gpt-5.4-mini |
messages | array | ✅ | Message array |
temperature | number | — | Sampling temperature from 0 to 2; default is 1 |
max_tokens | number | — | Maximum generated token count |
stream | boolean | — | Whether to enable streaming responses |
top_p | number | — | Nucleus sampling parameter |
frequency_penalty | number | — | Frequency penalty from -2 to 2 |
presence_penalty | number | — | Presence penalty from -2 to 2 |
tools | array | — | Available tool definitions (Function Calling) |
tool_choice | string/object | — | Tool selection strategy |
response_format | object | — | ResponseFormat(JSON Mode) |
provider | object | — | DataMind AI extension: routing and fallback configuration |
Request example#
cURL
curl https://xpluse.plus/v1/chat/completions \
-H "Authorization: Bearer $DATAMIND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.4-mini",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain what an API Gateway is"}
],
"temperature": 0.7
}' Python
from openai import OpenAI
client = OpenAI(base_url="https://xpluse.plus/v1", api_key="<your DATAMIND_API_KEY>")
response = client.chat.completions.create(
model="openai/gpt-5.4-mini",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain what an API Gateway is"}
],
temperature=0.7
)
print(response.choices[0].message.content)TypeScript
const response = await client.chat.completions.create({
model: 'openai/gpt-5.4-mini',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Explain what an API Gateway is' }
],
temperature: 0.7
})
console.log(response.choices[0].message.content)Response example#
JSON
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1703123456,
"model": "openai/gpt-5.4-mini",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "An API Gateway is a..."},
"finish_reason": "stop"
}
],
"usage": {"prompt_tokens": 25, "completion_tokens": 150, "total_tokens": 175}
}Streaming response#
Set stream: true to enable SSE streaming.
SSE chunk
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hel"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"lo"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE]For new projects, we recommend the Responses API:
instructionsandinputare separated, and system instructions automatically benefit from Prompt Caching. Chat Completions remains fully supported, so migration is not required.
Last updated on June 22, 2026