# HIPS

> HIPS runs a centrally managed AI inference marketplace on a distributed GPU network. It connects people buying inference with independently supplied GPU time.

## Queue deployments
Route: https://hips.com/docs/deployments/queue
Updated 2026-12-06

**A queue deployment takes jobs rather than HTTP requests. You submit a job's input to the deployment's queue on `api.hips.run`, one of its workers runs it, and you read the result, wait for it, stream it, or receive it at a webhook. The routes, the bodies and the job states keep the names existing serverless queue clients already use.**

> Queue deployments are being switched on. Until HIPS switches them on, a create with `type` `QUEUE` answers 400 `type_not_offered`, and the queue routes on this page answer 404. `health` is not a queue route: it answers for every container deployment.

### Create a queue deployment

Create it as any [container deployment](/docs/deployments), with `type` `QUEUE` ([Deployment settings](/docs/deployments/settings)). It has no host of its own: its jobs go through `api.hips.run`. The deployment's `timeout` is each job's execution timeout and its `jobTtl` each job's time to live unless a job sets its own. A deployment that is stopped, or whose `workers.max` is 0, queues no job.

### Call the queue

Queue a job:

```
POST https://api.hips.run/v2/<deployment>/run
Authorization: Bearer $HIPS_API_KEY
Content-Type: application/json

{"input": {"prompt": "A lighthouse at dusk"}}
```

Answer:

```
{"id":"3f2b8c1e-5a7d-4c9b-8e2f-1a6d4b7c9e05","status":"IN_QUEUE"}
```

`<deployment>` is the deployment's `dep_` id, or the same 26 characters after `dep-` or `dep`, as in its host name. Send an `inference_only` or `full` API key of the deployment's workspace as the bearer. A job's id is a UUID; a `runsync` job's id starts with `sync-`.

### The routes

On `https://api.hips.run`, each under the deployment's id.

**POST /v2/{id}/run** (served): Queue a job; answers `{"id", "status": "IN_QUEUE"}` at once.

**POST /v2/{id}/runsync** (served): Queue a job and wait for its end, up to `?wait=`; answers the status object.

**GET /v2/{id}/status/{job}** (served): The job's status object, with an ended job's result. `?ttl=` sets the job's time to live first.

**GET /v2/{id}/status-sync/{job}** (served): The status object after waiting for the job's end, up to `?wait=`.

**GET /v2/{id}/stream/{job}** (served): The parts the job's handler streamed since the last read, each once.

**POST /v2/{id}/cancel/{job}** (served): Cancel a waiting or running job.

**POST /v2/{id}/retry/{job}** (served): Queue a `FAILED` or `TIMED_OUT` job again with its own input.

**POST /v2/{id}/purge-queue** (served): Remove every waiting job; running jobs go on.

**GET /v2/{id}/requests** (served): The deployment's newest jobs, at most 100.

**GET /v2/{id}/health** (served): Any container deployment's job and worker counts, a load-balanced one's included.

### The job's body

`run` and `runsync` take one JSON object. A body is at most 10 MiB on `run` and 20 MiB on `runsync`; a larger one answers 400 before the rest is read. Members not listed here are ignored.

- `input` (Any JSON value but `null`), Required: Your handler's input, kept byte for byte: strings, escapes, key order and the text of numbers reach the worker as sent. A body without `input`, or with `input` `null`, answers 400.
- `s3Config` (JSON object), Optional: Handed to the worker beside `input`, byte for byte. Anything but an object answers 400.
- `webhook` (String), Optional: An `https` URL on port 443, at most 2,048 bytes, that receives the job's status object when it ends ([Webhooks](#webhooks)). Another scheme or port answers 400 when the job is submitted.
- `policy.executionTimeout` (Integer milliseconds), Defaults to the deployment's `timeout`: 5,000 to 604,800,000. A job that runs longer ends `TIMED_OUT`. With neither set, a job has no execution timeout.
- `policy.ttl` (Integer milliseconds), Defaults to the deployment's `jobTtl`: 10,000 to 604,800,000: the job's whole life from its submission, waiting and running included. At its end the job is stopped and removed, its result with it. `?ttl=` on the URL sets the same value; `policy.ttl` wins when both are sent.
- `policy.lowPriority` (Boolean), Default `false`: A low-priority job does not count when the deployment scales up: it runs when one of the deployment's workers is free and starts none itself.
- `?wait=` (Integer milliseconds, `runsync` only), Default 90,000: 1,000 to 570,000: how long `runsync` waits for the job's end before it answers the job as it stands.

### The status object

`status`, `status-sync`, `runsync` and a webhook answer the same object. Each member is there only where it applies; `output`, and an `error` your handler posted, are its bytes as it posted them.

A completed job:

```
{"delayTime":824,"executionTime":3120,"id":"3f2b8c1e-5a7d-4c9b-8e2f-1a6d4b7c9e05","output":{"image_url":"https://example.com/lighthouse.png"},"status":"COMPLETED"}
```

- `id` (String): The job's id, the same on every read.
- `status` (`IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED`, `CANCELLED` or `TIMED_OUT`): Waiting, running, or how it ended.
- `delayTime` (Integer milliseconds): From the submission to the moment a worker last took the job, once one has.
- `executionTime` (Integer milliseconds): From that moment to the job's end, once it ended after running.
- `output` (JSON): On `COMPLETED`, and on `FAILED` where the handler posted one.
- `error` (JSON): On `FAILED`: the handler's error, or HIPS's own text: `job timed out after 1 retries` when the job lost its worker twice, `output too large` for a result over 20,000,000 bytes, `output invalid` for a result that is not a JSON object.
- `retries` (Integer): On `FAILED`, when the job was queued again before: how many times.

A job whose worker is lost while it runs goes back to the queue once. Lost a second time, it ends `FAILED` with `job timed out after 1 retries`.

### How long jobs, inputs and results are kept

*Never past the job's time to live. Once either is over, every read of the job answers 404.*

| Submitted with | Result readable after the job ends |
| --- | --- |
| `run` | 30 minutes |
| `runsync` | 1 minute |
| `runsync` with `?wait=` | 5 minutes |

- A job lives for its time to live from its submission, waiting and running included. `status` with `?ttl=` (10,000 to 604,800,000 ms) sets it again, counted from the submission, longer or shorter; a time to live already over removes the job.
- A job's input is kept encrypted while the job waits or runs. It is deleted once the job completes or is cancelled; a `FAILED` or `TIMED_OUT` job's input is kept until its result expires, so `retry` can run it again. Never past the job's time to live.
- A result is kept encrypted, readable by the deployment's workspace alone, until exactly its expiry, and deleted after.
- HIPS writes no input, output or webhook address to its logs.

### Waiting: runsync and status-sync

`runsync` queues the job and holds the request until the job ends or `?wait=` passes. An ended job is answered whole; one still waiting or running is answered as it stands, with no result, and you read it again with `status` or `status-sync`. `status-sync` waits the same way for a job already queued, with the same `?wait=` (1,000 to 570,000 ms, 90,000 by default).

### Streams

A handler that yields parts streams them. `GET .../stream/<job>` answers `{"status": "IN_PROGRESS", "stream": [...]}` with every part not read yet, each once and oldest first, each the JSON your handler yielded. Read again until `status` is an ended state and `stream` is empty. Up to 32 MiB of unread parts are kept for a job, the oldest unread part dropped past it, and unread parts are kept until the job's result expires.

### Cancel, retry, purge and list

- `POST .../cancel/<job>` ends a waiting or running job `CANCELLED`, stops it on its worker, and answers `{"id", "status": "CANCELLED"}`. A job that is not waiting or running answers 404.
- `POST .../retry/<job>` queues a `FAILED` or `TIMED_OUT` job again before its result expires, with the same id, input, policy and webhook, discards its earlier result, and answers `{"id", "status": "IN_QUEUE"}`. It takes no body. A job in another state answers 400; a job whose input is no longer kept answers 400, and you submit it again with `run`.
- `POST .../purge-queue` removes every waiting job, which then reads as gone, and answers `{"removed": <count>, "status": "completed"}`. Running jobs are not touched.
- `GET .../requests` lists the deployment's jobs that can still be read, newest first, at most 100, each as its status object without `output`.

### Webhooks

- A job submitted with `webhook` is posted there when it ends `COMPLETED`, `FAILED` or `TIMED_OUT`: a `POST` with `Content-Type: application/json` whose body is the status object, its result included. A cancelled job posts nothing.
- Any 2xx answer is delivery. Otherwise HIPS tries twice more, each try 10 seconds after the one before ended, and each try has 10 seconds for the whole exchange.
- HIPS calls only public addresses, on 443: an address that is private, loopback, link-local or a cloud metadata service, or a name that resolves to one, is never called, and that try fails.

### Limits

*Per deployment and route. Past either limit the route answers 429 with `Retry-After` in seconds.*

| Route | Requests per 10 seconds | Requests at once |
| --- | --- | --- |
| `run`, `retry` | 1,000 | 200 |
| `runsync`, `status`, `status-sync`, `stream` | 2,000 | 400 |
| `cancel` | 100 | 20 |
| `purge-queue` | 2 | No limit |
| `requests` | 10 | 2 |
| `health` | 2,000 | No limit |

A route past its limit answers with `Retry-After` alone. `RateLimit-Policy` and `RateLimit` are not sent here: they carry the management routes' quota ([Requirements and headers](/docs/reference/headers)), which these routes do not count against.

The workspace's own requests a minute apply first, answered as on every other route ([Limits](/docs/operating/limits)). Past 100,000 waiting and running jobs on a deployment, `run` and `runsync` answer 429 with `Retry-After: 10`.

### Answers

The queue's own refusals are short problem documents (`Content-Type: application/problem+json`). A refusal by HIPS's account rules carries the [error envelope](/docs/reference/errors) of every other route.

| Status | Body | When |
| --- | --- | --- |
| 400 | `{"title": "Bad Request", "detail": "<what was refused>", "status": 400}` | A body that is not a JSON object or whose `webhook` or `policy` has the wrong type, a missing or `null` `input`, an `s3Config` that is not an object, a value outside its range (`policy.executionTimeout`, `policy.ttl`, `?ttl=`, `?wait=`), a webhook that is not `https` on 443 or is longer than 2,048 bytes, a body over its bound, or a `retry` the job's state or its input does not allow. `detail` says which, such as `the body is not a JSON object, or its webhook or policy has the wrong type`, `webhook must be an https URL on port 443` or `only a FAILED or TIMED_OUT job is retried`. |
| 404 | `{"title": "Not Found", "detail": "endpoint not found", "status": 404}` | The one body for a deployment that does not exist, was deleted, is another workspace's or is not a queue deployment, and for a job that is unknown, another deployment's, purged, or past its time to live or its result's keep time. A key learns nothing of another workspace's deployments or jobs. |
| 409 | `{"title": "Conflict", "detail": "...", "status": 409, "code": "ENDPOINT_PAUSED"}` | `run` or `runsync` on a deployment that is stopped or has `workers.max` 0. No job is queued. |
| 429 | `{"title": "Too Many Requests", "detail": "rate limit exceeded", "status": 429}` with `Retry-After` | A route's limit, or the deployment's 100,000 waiting and running jobs. |
| 401, 402, 403, 429 | The error envelope | A missing or invalid key, a key that reaches no deployment, the workspace's state or plan, or its requests a minute. |
| 503 | The error envelope, `overloaded`, with `Retry-After` | HIPS could not reach the queue's store. Retry after the delay. |

Requests to these routes that reach the deployment and their answers, and each webhook body that reaches your endpoint, count as the deployment's `caller_in` and `caller_out` transfer ([Deployment billing](/docs/billing/deployments#transfer-legs)); HIPS's own 5xx answers and `health` reads are not counted.

### Health

`GET https://api.hips.run/v2/<deployment>/health`, with a key of the deployment's workspace, answers any container deployment's counts, at most a second old. A read starts no worker and never resets an idle timer. It answers the same 404 and 429 bodies as the queue.

Answer:

```
{"jobs":{"completed":12,"failed":1,"inProgress":2,"inQueue":5,"retried":0},"workers":{"idle":1,"initializing":0,"ready":3,"running":2,"throttled":0,"unhealthy":0}}
```

*Every member is always present. A load-balanced deployment's job counts are always zero.*

- `jobs.inQueue, jobs.inProgress` (Integer): The jobs waiting and running now.
- `jobs.completed, jobs.failed, jobs.retried` (Integer): The jobs that completed, failed, or were queued again, in the last 30 minutes.
- `workers.idle, workers.initializing, workers.running, workers.throttled, workers.unhealthy` (Integer): The workers in each [worker state](/docs/deployments#worker-states).
- `workers.ready` (Integer): The idle workers, and the running workers taking requests now.


## For AI agents
- API: https://ai.hips.com/v1, OpenAI-compatible; the key is read from HIPS_API_KEY.
- Models: GET https://ai.hips.com/v1/models with the key, or https://hips.com/api/models without one.
- hi, the HIPS command line: curl -fsSL https://hips.com/hi.sh | sh, then hi models.
- Every page above as Markdown: its address plus .md (the home page at https://hips.com/index.md), or its address with Accept: text/markdown.
