How do I read Max or Heavy's reasoning in Python?
Max and Heavy think before answering. Their reasoning comes back as reasoning_content, next to the normal content. The OpenAI SDK keeps unknown fields, so you can read it with getattr.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.gateway.clatterlabs.xyz/v1",
api_key=os.environ["CLATTER_API_KEY"],
default_headers={"X-Clatter-Account": os.environ["CLATTER_ACCOUNT_ID"]},
)
resp = client.chat.completions.create(
model="supercosmos-max",
messages=[{"role": "user", "content": "Is 221 prime?"}],
)
msg = resp.choices[0].message
print("reasoning:", getattr(msg, "reasoning_content", None))
print("answer:", msg.content)
# streaming: chunk.choices[0].delta has reasoning_content too
Flash has no extended thinking, so it doesn't return reasoning. Reasoning tokens are counted in completion_tokens.
The client setup above (base URL, key and the X-Clatter-Account header) is the same in every Python example; see Set up the Python SDK. Full parameter list: Create a chat completion.
Good to know#
- Every call shows in Console › Logs and Usage as Model API, with its price. See what you spent
- New accounts get $5 of free credit; top up from $1 to $800 per purchase in Console › Billing › Credits. Billing
- Each key has its own limit: 10, 30 (default), 60 or 120 requests per minute. Rate limits
Still need help?#
- General support: support@clatterlabs.com or team@clatterlabs.xyz
- Infrastructure questions, or permanent deletion of your data (your whole account or one service): infrastructure@clatterlabs.xyz
We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Related articles
Still need help?
Tried the steps above and still stuck? Email us. We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Infrastructure questions, or permanent deletion of your data
infrastructure@clatterlabs.xyzFor deleting your whole account or the data of one service.