How do I stream Model API output through nginx or another proxy?
Reverse proxies often buffer responses, which turns a stream into one late blob. For the route that relays the stream:
- nginx:
proxy_buffering off;and a longerproxy_read_timeout(Heavy can think for a while). Your app can also send the headerX-Accel-Buffering: no. - Other proxies and CDNs: look for "response buffering" or "streaming" settings.
- Use
Content-Type: text/event-streamif you forward raw server-sent events.
Good to know#
- Base URL:
https://api.gateway.clatterlabs.xyz/v1, withAuthorization: Bearer clsk_...andX-Clatter-Account: CL-...on every call. Quick reference - Every call shows in Console › Logs and Usage as Model API, with its price. See what you spent
- 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.