Clatter LabsHelp Center

How do I stream Model API output through nginx or another proxy?

How-toUpdated

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 longer proxy_read_timeout (Heavy can think for a while). Your app can also send the header X-Accel-Buffering: no.
  • Other proxies and CDNs: look for "response buffering" or "streaming" settings.
  • Use Content-Type: text/event-stream if you forward raw server-sent events.

Good to know#

  • Base URL: https://api.gateway.clatterlabs.xyz/v1, with Authorization: Bearer clsk_... and X-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?#

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.xyz
For deleting your whole account or the data of one service.