Model API
The OpenAI-compatible Model API: base URL, model ids, streaming, errors and rate limits.
Top articles
- How do I set up the OpenAI Python SDK for the Model API?
- How do I pick Flash, Max or Heavy in JavaScript?
- How do I set up the OpenAI JavaScript SDK for the Model API?
- What does model_unavailable mean?
- How do I create an API key for the Model API?
- Why are Model API responses slow?
- How do I stream a reply in Python?
- What is the Clatter Labs Model API?
- How do I use tool calling in Python?
- How do I call the Model API with cURL?
Topics
Getting startedWhat the Model API is and how to make your first call.Keys and authenticationAPI keys, the models:invoke permission and the X-Clatter-Account header.Model idsWhich model ids to call, efforts, and the models endpoints.Request parametersMessages, max_tokens, temperature, stop, seed and other parameters.StreamingServer-sent events, usage in streams and streams that fail midway.Tool callingFunction tools, tool_choice and the tool loop.Python examplesUsing the Model API with the OpenAI Python SDK.JavaScript examplesUsing the Model API with the OpenAI JavaScript / TypeScript SDK.cURL and raw HTTPCalling the Model API with cURL or any HTTP client.Error codesEvery Model API error code, what it means and what to do.Rate limitsPer-key requests per minute, headers and backing off.Billing and creditsPer-token billing, the $5 free credit, top-ups and running out.Moving to the Model APISwitching from another OpenAI-compatible API or from Line Code.Security and responsible useKeeping keys safe and the abuse policy for apps that send user text.Production and companiesRunning the Model API in production and across a team.TroubleshootingWhen a call doesn't behave the way you expect.Unusual questionsOdd and edge-case questions about the Model API.
Still need help?
Can’t find your Model API answer? 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.