---
title: "route"
method: POST
path: "/route/"
tags: ["Serverless"]
---

# route

`POST /route/`

Calls on the serverless engine to retrieve a GPU instance address within your endpoint for processing a request.
The engine will return either a ready worker URL or status information if no workers are available.

CLI Usage: `vastai route <endpoint> <cost>`

## Request body

- object
  - `endpoint` string, required — Name of the endpoint
  - `cost` number, float, required — The estimated compute resources for the request

## Response `200`

Success response - either worker assignment or status

- union
  - object
    - `endpoint` string — Same as the input parameter
    - `url` string — The address of the worker instance to send the request to
    - `cost` number — Same as the input parameter
    - `reqnum` integer — Request number corresponding to this worker instance
    - `signature` string — Cryptographic signature authenticating the response
    - `__request_id` string — Unique identifier generated by the server for this request
  - object
    - `endpoint` string — Same as the input parameter
    - `status` string — Breakdown of workers in your endpoint group by status
    - `__request_id` string — Unique identifier generated by the server for this request

## Other responses

- `400` — Bad Request - invalid parameters
- `401` — Unauthorized - authentication failed

---

[API](https://skmtc.net/vast/apis/vast-ai-api.md) · [All operations](https://skmtc.net/vast/apis/vast-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vast/vast-ai-api/versions/4ed14f79f796/schema)
