Chat and completions
POST /v1/chat/completions accepts OpenAI-compatible chat requests. Set the SDK base URL to https://api.sociaro.com/v1 and authenticate with a Sociaro API key.
Send a request
Send a chat model ID and a messages array. The examples below use minimax/minimax-m3. Replace it with the ID of the chat model you want to call.
curl https://api.sociaro.com/v1/chat/completions \
-H "Authorization: Bearer $SOCIARO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax/minimax-m3",
"messages": [{"role": "user", "content": "Explain a hash join in two sentences."}]
}'
# Requires Python 3 and requests (pip install requests).
import os
import requests
payload = {'model': 'minimax/minimax-m3',
'messages': [{'role': 'user',
'content': 'Explain a hash join in two sentences.'}]}
response = requests.post(
'https://api.sociaro.com/v1/chat/completions',
headers={
'Authorization': 'Bearer ' + os.environ['SOCIARO_API_KEY'],
'Content-Type': 'application/json',
},
json=payload,
timeout=120,
)
response.raise_for_status()
print(response.text)// Run as an .mjs file with Node.js 22 or later.
const payload = {
"model": "minimax/minimax-m3",
"messages": [
{
"role": "user",
"content": "Explain a hash join in two sentences."
}
]
};
const response = await fetch("https://api.sociaro.com/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.SOCIARO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.text());The same request with the OpenAI Python SDK:
from openai import OpenAI
client = OpenAI(api_key="sk-...", base_url="https://api.sociaro.com/v1")
reply = client.chat.completions.create(
model="minimax/minimax-m3",
messages=[{"role": "user", "content": "Explain a hash join in two sentences."}],
)
print(reply.choices[0].message.content)
Streaming
Set stream to true to receive server-sent events as the response is generated. In the Python SDK, iterate over the stream and read choices[0].delta.content when present.
Model discovery
Use GET /v1/models to discover model IDs for your API key. The catalogue documents each model's parameters and public rates. Send the exact model ID, including its prefix.
Request parameters
Parameter support depends on the selected model. For example, check support for temperature, top_p, max_tokens, tools and response_format before including them.