API reference
Create a chat completion
POST /v1/chat/completions generates the next message in a conversation, as JSON or as a stream.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://lyber-paid-acceptance-gateway-production.up.railway.app/v1",
api_key=os.environ["LYBER_API_KEY"],
)
response = client.chat.completions.create(
model="minimax-m3.1-flash-abliterated",
messages=[{"role": "user", "content": "Explain abliteration in two sentences."}],
max_tokens=1024,
)
print(response.model)
print(response.choices[0].message.content)Request body
| Field | Type | Description |
|---|---|---|
model required | string | minimax-m3.1-flash-abliterated or deepseek-v4.1-flash-1017-abliterated. |
messages required | array | 1–4,096 messages with role system, user, assistant or tool. User content is a string or an array of text and image_url parts. |
max_tokens | integer | Most output tokens, reasoning included. Defaults to the model's maximum. max_completion_tokens is accepted as an alias. |
temperature | number | 0–2. Defaults per model; see Models. |
top_p | number | 0–1. |
stop | string or array | Up to 4 sequences where generation stops. |
stream | boolean | Send the reply as server-sent events. See Streaming. |
stream_options | object | Only include_usage (boolean). |
tools | array | Up to 32 function tools. See Tool calling. |
tool_choice | string or object | auto, none, required, or a named function. |
reasoning_effort | string | Per model; see Thinking. |
thinking_token_budget | integer | DeepSeek only. Cap on reasoning tokens. |
max_cost_micro_usdc | integer | Lyber only. Refuse the request if its credit hold would exceed this. See Spending controls. |
Response
{
"id": "chatcmpl-6f1c…",
"object": "chat.completion",
"created": 1793491200,
"model": "minimax-m3.1-flash-abliterated",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Abliteration removes the direction in a model's activations…",
"reasoning_content": "The user wants two sentences…"
},
"finish_reason": "stop"
}],
"usage": {"prompt_tokens": 18, "completion_tokens": 96, "total_tokens": 114}
}| finish_reason | Meaning |
|---|---|
stop | The model finished, or hit a stop sequence. |
length | The reply reached max_tokens. Raise it, or continue in a new request. |
tool_calls | The model is waiting for tool results. |
Response headers
| Header | Value |
|---|---|
x-request-id | Lyber's ID for the request. Quote it when you contact support. |
x-lyber-model | The model that answered. |
x-lyber-revision | The exact checkpoint revision that answered. |