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

# Async Queue Endpoints

These endpoints run **asynchronous inference jobs** against a **Serverless API (LoRA) Deployment**.

The endpoint shape is the same async pattern used by Serverless API (ComfyUI) (submit > `request_id` > status/result).\
What changes is the **request/response schema**, which is specific to your deployment and is shown in the Deployment **API** tab.

## Endpoints

**Base URL**: `https://api.runcomfy.net`

| Endpoint                                                            | Method | Description         |
| :------------------------------------------------------------------ | :----: | :------------------ |
| `/prod/v2/deployments/{deployment_id}/inference`                    |  POST  | Submit an inference |
| `/prod/v2/deployments/{deployment_id}/requests/{request_id}/status` |   GET  | Check job status    |
| `/prod/v2/deployments/{deployment_id}/requests/{request_id}/result` |   GET  | Get job result      |
| `/prod/v2/deployments/{deployment_id}/requests/{request_id}/cancel` |  POST  | Cancel queued job   |

## Common path parameters

* `deployment_id`: Required string. The unique ID for your LoRA deployment.
* `request_id`: Required string for status, result, and cancel. The unique ID for a specific inference job.

***

## Submit a request

```text theme={null}
POST /prod/v2/deployments/{deployment_id}/inference
```

This call enqueues a job and returns a `request_id` right away, plus URLs you can use to poll and fetch results. **The request body must conform to the deployment’s input schema shown on the deployment details page under the API tab**; treat that schema as the contract for required fields, types, enums, and defaults.

### Request example

```bash theme={null}
curl --request POST \
  --url https://api.runcomfy.net/prod/v2/deployments/{deployment_id}/inference \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer <token>" \
  --data '{
    "prompt": "Make the scene feel warmer and more cinematic. Add a subtle orange glow.",
    "ctrl_img_1": "https://playgrounds-storage-public.runcomfy.net/tools/7063/media-files/usecase1-1-input.webp",
    "width": 1024,
    "height": 1024,
    "guidance_scale": 4,
    "sample_steps": 25,
    "network_multiplier": 1.0,
    "neg": "",
    "seed": 42,
    "sampler": "flowmatch",
    "num_frames": 1,
    "fps": 1
  }'
```

### Input files (URLs)

If your schema includes `image_uri` inputs such as `ctrl_img_1`, pass a **publicly accessible HTTPS URL** that returns the raw file via an unauthenticated `GET` request. The URL must not require cookies and must not redirect to a login page.

### Response example

```json theme={null}
{
  "request_id": "{request_id}",
  "status_url": "https://api.runcomfy.net/prod/v2/deployments/{deployment_id}/requests/{request_id}/status",
  "result_url": "https://api.runcomfy.net/prod/v2/deployments/{deployment_id}/requests/{request_id}/result",
  "cancel_url": "https://api.runcomfy.net/prod/v2/deployments/{deployment_id}/requests/{request_id}/cancel"
}
```

***

## Monitor request status

```text theme={null}
GET /prod/v2/deployments/{deployment_id}/requests/{request_id}/status
```

Use this endpoint to poll queue progress and determine when results are ready. A typical lifecycle is `in_queue`, then `in_progress`, then a terminal outcome such as `succeeded`, `failed`, or `cancelled`.

### Request example

```bash theme={null}
curl --request GET \
  --url https://api.runcomfy.net/prod/v2/deployments/{deployment_id}/requests/{request_id}/status \
  --header "Authorization: Bearer <token>"
```

### Response example

```json theme={null}
{
  "request_id": "{request_id}",
  "status": "in_queue",
  "queue_position": 0,
  "result_url": "https://api.runcomfy.net/prod/v2/deployments/{deployment_id}/requests/{request_id}/result",
  "status_url": "https://api.runcomfy.net/prod/v2/deployments/{deployment_id}/requests/{request_id}/status"
}
```

***

## Retrieve request results

```text theme={null}
GET /prod/v2/deployments/{deployment_id}/requests/{request_id}/result
```

When the request succeeds, this endpoint returns an `output` object. **The `output` object conforms to the deployment’s output schema shown on the deployment details page under the API tab**. Outputs typically include **one or more hosted URLs**.

Generated assets (for example, images or videos) are hosted on temporary storage for convenience. The hosted output URLs remain available for up to 7 days after a request succeeds; after that, the files are automatically removed and the URLs will expire. If you need to keep outputs longer, download them or copy them to your own persistent storage.

### Request example

```bash theme={null}
curl --request GET \
  --url https://api.runcomfy.net/prod/v2/deployments/{deployment_id}/requests/{request_id}/result \
  --header "Authorization: Bearer <token>"
```

### Response example

```json theme={null}
{
  "request_id": "{request_id}",
  "status": "succeeded",
  "output": {
    "images": [
      "https://example.com/output-1.png",
      "https://example.com/output-2.png"
    ]
  },
  "created_at": "2025-07-22T13:05:16.143086",
  "finished_at": "2025-07-22T13:13:03.624471"
}
```

***

## Cancel a request

```text theme={null}
POST /prod/v2/deployments/{deployment_id}/requests/{request_id}/cancel
```

Use this to cancel a job while it is still in the queue. If the job is already running inference or has finished, it cannot be cancelled.

### Request example

```bash theme={null}
curl --request POST \
  --url https://api.runcomfy.net/prod/v2/deployments/{deployment_id}/requests/{request_id}/cancel \
  --header "Authorization: Bearer <token>"
```

### Response example

```json theme={null}
{
  "request_id": "{request_id}",
  "status": "completed",
  "outcome": "cancelled"
}
```
