Skip to main content
PUT
Create Host Background Jobs

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Body

application/json
machine
integer
required

ID of the machine to create jobs for.

Example:

12345

price_gpu
number<float>
required

Price per GPU per day.

Example:

0.5

price_inetu
number<float>
required

Price for internet upload.

Example:

0.1

price_inetd
number<float>
required

Price for internet download.

Example:

0.1

image
string
required

Docker image to use for the job.

Example:

"vastai/tensorflow"

args
string[]

Arguments for the Docker image.

Example:
args_str
string

Command-line arguments as a single shell-quoted string (parsed via shlex). Mutually exclusive with args.

Example:

"--train --epochs 10"

use_ssh
boolean

Whether to enable SSH access on the created background job containers.

Example:

false

onstart
string

Shell command to run when the container starts.

Example:

"bash /start.sh"

env
object

Key-value pairs of environment variables to inject into the container.

Example:

Response

Returns {success: false, msg: "only the owner can create default bid contracts for a machine."} if not machine owner (no HTTP error code set)

success
boolean

Whether the operation succeeded

machine_id
integer

ID of the machine on which bids were created

user_id
integer

ID of the authenticated user

you_sent
object

Echo of the request body