How do I switch existing OpenAI SDK code to the Model API?
Most Chat Completions code moves with four changes:
- Base URL:
https://api.gateway.clatterlabs.xyz/v1 - Key: a Clatter Labs
clsk_key withmodels:invoke - Header:
X-Clatter-Account: CL-...as a default header - Model:
supercosmos-flash,supercosmos-maxorsupercosmos-heavy
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"]},
)
Check these before you ship#
- Image inputs → not supported (text only).
n> 1,logprobs→ not supported.- Embeddings, images, audio, files, Responses API → not available.
response_format→ not documented; use tools with a schema.- Prices and limits differ; see How is a call billed?.
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
- Keep keys on your server, never in a browser or mobile app. Why
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.