Skip to content
WRAITHERIXDocsENRU

Chat completions

POST /v1/chat/completions is OpenAI-compatible and works with every chat model in the catalogue, including Claude and Gemini models.

from openai import OpenAI
import os
client = OpenAI(base_url="https://api.wraitherix.com/v1",
api_key=os.environ["WRAITHERIX_API_KEY"])
r = client.chat.completions.create(
model="claude-opus-5-5",
messages=[
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "What is the capital of Australia?"},
],
temperature=0.2,
max_tokens=200,
)
print(r.choices[0].message.content)
print(r.usage)
Parameter Description
model Model ID, e.g. gpt-5.6-luna, claude-opus-5-5. See the catalogue.
messages Conversation history: system / user / assistant / tool messages.
max_tokens Upper bound on generated tokens.
temperature, top_p Sampling controls.
stop String or array of stop sequences.
stream true to stream tokens — see Streaming.
tools, tool_choice Function calling — see Tool calling.
response_format JSON mode / JSON schema — see Structured outputs.
reasoning_effort low / medium / high for reasoning models — see Reasoning.

The full schema is in the API reference.

{
"id": "resp_01fc…",
"object": "chat.completion",
"model": "claude-opus-5-5",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Canberra." },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 24, "completion_tokens": 4, "total_tokens": 28 }
}

finish_reason is stop (natural end), length (hit max_tokens) or tool_calls (the model wants to call a tool).

The API is stateless. Send the full history with every request:

history = [{"role": "user", "content": "My name is Ana."}]
r = client.chat.completions.create(model="gpt-5.6-luna", messages=history)
history.append({"role": "assistant", "content": r.choices[0].message.content})
history.append({"role": "user", "content": "What is my name?"})
r = client.chat.completions.create(model="gpt-5.6-luna", messages=history)