Clatter LabsHelp Center

How do I pick Flash, Max or Heavy from Python?

How-toUpdated

The simplest way is the model id. You can also send the family id with an effort, which is handy if your code already sets reasoning_effort.

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"]},
)

# 1. model id
client.chat.completions.create(model="supercosmos-heavy", messages=msgs)

# 2. family id + effort (an extra field, so pass it via extra_body)
client.chat.completions.create(model="supercosmos", messages=msgs, extra_body={"effort": "max"})

# 3. family id + reasoning_effort: low -> Flash, medium -> Max, high -> Heavy
client.chat.completions.create(model="supercosmos", messages=msgs, reasoning_effort="medium")

The family id without an effort runs Flash. An unknown effort answers 400 invalid_effort. Billing follows the effort that ran.

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
  • Retry only 429 and 5xx errors, with backoff; honour Retry-After when it's sent. Which errors to retry
  • Model ids: supercosmos-flash, supercosmos-max, supercosmos-heavy (SuperCosmos 1.1). Which to call

Still need help?#

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.xyz
For deleting your whole account or the data of one service.