How do I get token usage from a stream?
Add:
"stream_options": {"include_usage": true}
You'll get one extra chunk before data: [DONE] with usage (prompt_tokens, completion_tokens, total_tokens) and an empty choices array. The docs also note the last content chunk carries usage. That usage is what's billed.
Good to know#
- 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 - Every call shows in Console › Logs and Usage as Model API, with its price. See what you spent
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.