How do I count tokens before sending a request in Python?
Clatter Labs doesn't publish a tokenizer for SuperCosmos, so there's no exact way to count tokens offline. Practical approach:
- Send a representative request and read
usage.prompt_tokens. - Use the ratio of tokens to characters from that request to estimate similar texts.
- Keep a safety margin near limits (the 262K long-context threshold,
max_tokens).
usage on every response is the exact, billed count.
Good to know#
- Keep keys on your server, never in a browser or mobile app. Why
- Each key has its own limit: 10, 30 (default), 60 or 120 requests per minute. Rate limits
- Model ids:
supercosmos-flash,supercosmos-max,supercosmos-heavy(SuperCosmos 1.1). Which to call
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.