Skip to main content
DeepInfra accepts gzip-compressed request bodies. For large payloads — long chat histories, big embeddings batches, sizable inputs — compressing the request shrinks the bytes you upload (JSON and text typically compress 4–8×), which lowers your egress and can speed up requests over slower or metered connections. To use it, gzip the request body and set the Content-Encoding: gzip header. It works on every endpoint (chat completions, embeddings, and the rest), including requests whose response streams back — the request body is a single upload regardless of how the response is returned.

When it helps

Request compression pays off in proportion to how large your request body is:
  • Worth it for large bodies — long conversations, large embeddings batches, big inputs — where trimming the upload meaningfully cuts bandwidth and transfer time.
  • Not worth it for small requests (a short prompt). gzip adds a small header and a little CPU on both ends, so for tiny bodies there’s nothing to gain.
gzip only. Content-Encoding: gzip is the only supported request compression. Other codings (deflate, br, zstd) are not decompressed — a body compressed with those will fail to parse. Use gzip.