> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqwish.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Requests

> The rules every request follows, from content types and compression to pagination.

This page covers the rules every request follows: content types, JSON bodies, compression and pagination. Before you start a workflow, check what your account and deployment support:

```bash theme={null}
curl --fail-with-body https://api.sqwish.ai/v1/onehot \
  -H "Authorization: Bearer $SQWISH_API_KEY"
```

Read `training_available`, `labeling_available`, `prompt_tuning`, `models` and `limits` in the answer. Availability can change. An entry in the catalogue doesn't promise that it can serve requests at the moment.

## Content types

| Body | `Content-Type` |
| - | - |
| Ordinary operations | `application/json` |
| Raw JSONL uploads | `application/x-ndjson` |
| Dataset JSONL files in a form | `multipart/form-data` |

A content type the route doesn't accept gets `415`.

`/v1/systemone` also takes a `multipart/form-data` body, which carries each image as a file. [Images](https://docs.sqwish.ai/guides/jev-migration.md#images) explains its parts.

## JSON bodies

Unknown request fields, duplicate JSON keys and invalid numeric values, such as `NaN` and `Infinity`, can be rejected.

Keep the order of each decision's outcomes the same from one request to the next. Changing the order can change the probabilities.

## Compression

You can compress the body of an authenticated request to a route that needs authentication. Compress it once, with `Content-Encoding: gzip` or `Content-Encoding: zstd`.

The body's size limits hold both as sent and decompressed ([Request size](https://docs.sqwish.ai/guides/limits.md#request-size)). A zstd frame's window can be at most 8 MiB.

A route that needs no authentication takes its body uncompressed. `/v1/systemone/translate` and `/v1/lint` are two such routes.

| Body | Answer |
| - | - |
| Compressed once with `gzip` or `zstd`, in an authenticated request to a route that needs authentication | Accepted |
| Not valid data for its `Content-Encoding` | `400` |
| Encoded with something other than `gzip` or `zstd`, or with more than one encoding | `415` |
| Compressed, in an unauthenticated request or to a route that needs no authentication | `415` with `Accept-Encoding: identity` |

Compression shortens long text the most. A request with images gains far more when you shrink each image to the size the model reads ([Send images fast](https://docs.sqwish.ai/guides/images.md#send-images-fast)).

## Pagination

| List | Fields |
| - | - |
| Resource lists with cursors | `data`, `has_more` and `next_cursor`. Pass `next_cursor` as `cursor` on the next request, with the same filters. Stop when `has_more` is false |
| Model and recipe catalogues | A complete `object: "list"` list |
| Dataset rows, held-out records | `offset`, `limit`, `total` and `has_more` |
| Labelling results | `offset`, `limit` and `total`. Advance the offset by the number of rows returned |
| Job events | A `data` list in event order |

## Moved routes

The organisation's own routes moved from under `/v1/account` to under `/v1/organization`. Until 00:00 UTC on 10 December 2026, each old path still works as its new one. Its answers carry a `Deprecation` header, a `Sunset` header with that date, and a `Link` to the new path. From then on, an old path gets `410 route_gone`, which names the new one.

| Old path | New path |
| - | - |
| `/v1/account/usage` and `/v1/account/usage/requests` | `/v1/organization/usage` and `/v1/organization/usage/requests` |
| `/v1/account/keys` and `/v1/account/keys/{key_id}` | `/v1/organization/keys` and `/v1/organization/keys/{key_id}` |
| `/v1/account/spending` | `/v1/organization/spending` |
| `/v1/account/wallet` | `/v1/organization/wallet` |
| `/v1/account/payments` and `/v1/account/payments/{purchase_id}` | `/v1/organization/payments` and `/v1/organization/payments/{purchase_id}` |
| `/v1/account/automatic-topup` and `/v1/account/automatic-topup/card` | `/v1/organization/automatic-topup` and `/v1/organization/automatic-topup/card` |

Until then, `user` in `GET /v1/account` still has the organisation's `status`, `financial_blocked`, `zero_data_retention_since` and other deprecated fields. Read `organization.status`, `wallet.financial_blocked`, `tier` and `organization.zero_data_retention` instead.

## API reference

The [API reference](https://docs.sqwish.ai/api-reference/overview.md) lists the customer operations. It links the spec the service serves at `/openapi.json`, which lists the same operations. Its try-it requests go to `https://api.sqwish.ai` through Mintlify's proxy, and can spend credit.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.