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.