/route/
endpoint calls on the serverless engine to retrieve a GPU instance address within your Endpoint.
POST https://run.vast.ai/route/
Inputs
endpoint
(string): Name of the Endpoint.api_key
(string): The Vast API key associated with the account that controls the Endpoint. The key can also be placed in the header as an Authorization: Bearer.cost
(float): The estimated compute resources for the request. The units of this cost are defined by the PyWorker. The serverless engine uses the cost as an estimate of the request’s workload, and can scale GPU instances to ensure the Endpoint has the proper compute capacity.
JSON
Outputs
On Successful Worker Return
url
(string): The address of the worker instance to send the request to.reqnum
(int): The request number corresponding to this worker instance. Note that workers expect to receive requests in approximately the same order as these reqnums, but some flexibility is allowed due to potential out-of-order requests caused by concurrency or small delays on the proxy server.signature
(string): The signature is a cryptographic string that authenticates the url, cost, and reqnum fields in the response, proving they originated from the server. Clients can use this signature, along with the server’s public key, to verify that these specific details have not been tampered with.endpoint
(string): Same as the input parameter.cost
(float): Same as the input parameter.__request_id
(string): The __request_id is a unique string identifier generated by the server for each individual API request it receives. This ID is created at the start of processing the request and included in the response, allowing for distinct tracking and logging of every transaction.
JSON
On Failure to Find Ready Worker
endpoint
: Same as the input parameter to/route/
.status
: The breakdown of workers in your endpoint group by status.
Example: Hitting route with cURL
Curl