Skip to main content
POST
/
v1
/
jobs
Create Job
curl --request POST \
  --url https://api.compute.x.io/v1/jobs \
  --header 'Content-Type: application/json' \
  --data '
{
  "parameters": {
    "parameters": {
      "allowed_ips": [
        "<string>"
      ],
      "env": {},
      "host": "<string>",
      "image": "<string>",
      "imagesrc": "<string>",
      "ports": [
        123
      ],
      "secret": "<string>",
      "sshkey": "<string>",
      "tag": "<string>",
      "user": "<string>",
      "volumes": [
        {
          "image": "<string>",
          "mount": "<string>",
          "registry": "<string>",
          "secret": "<string>",
          "tag": "<string>",
          "user": "<string>"
        }
      ]
    },
    "type": "docker"
  },
  "title": "<string>",
  "max_timeout_run_ms": 900000,
  "task": "BATCH",
  "cpu_count": 4,
  "description": "<string>",
  "gpu_count": 1,
  "gpu_name": "NVIDIA RTX 4090",
  "gpu_registry_uuid": "01234567-89ab-cdef-0123-456789abcdef",
  "max_node_count": 1,
  "max_retry_count": 0,
  "max_timeout_assign_ms": 300000,
  "max_timeout_start_ms": 300000,
  "min_ram_gb": 0,
  "min_storage_gb": 0,
  "min_vram_gb": 0
}
'
{
  "object": "job",
  "created_at": "2023-12-25",
  "updated_at": "2023-12-25",
  "status": "PENDING",
  "task": "BATCH",
  "title": "<string>",
  "cpu_count": 123,
  "gpu_count": 123,
  "min_ram_gb": 123,
  "min_vram_gb": 123,
  "min_storage_gb": 123,
  "parameters": {
    "parameters": {
      "allowed_ips": [
        "<string>"
      ],
      "env": {},
      "host": "<string>",
      "image": "<string>",
      "imagesrc": "<string>",
      "ports": [
        123
      ],
      "secret": "<string>",
      "sshkey": "<string>",
      "tag": "<string>",
      "user": "<string>",
      "volumes": [
        {
          "image": "<string>",
          "mount": "<string>",
          "registry": "<string>",
          "secret": "<string>",
          "tag": "<string>",
          "user": "<string>"
        }
      ]
    },
    "type": "docker"
  },
  "timeout_assign_at_ms": 123,
  "uuid": "<string>",
  "started_at": "2023-12-25",
  "completed_at": "2023-12-25",
  "description": "<string>",
  "gpu_name": "<string>",
  "gpu_registry_uuid": "<string>",
  "max_timeout_assign_ms": 123,
  "max_timeout_run_ms": 123,
  "max_timeout_start_ms": 123,
  "max_retry_count": 123,
  "max_node_count": 123,
  "image_size_bytes": 123,
  "container_access_tokens": [],
  "status_reason": "<string>",
  "source_recipe_uuid": "<string>"
}

Body

application/json
parameters
object
required
title
string
required
max_timeout_run_ms
number
required

The maximum time in milliseconds to execute a BATCH Job.

Required range: x >= 60000
Example:

900000

task
enum<string>
required
Available options:
BATCH
cpu_count
number
default:0

The number of CPU cores required for the Job. The assigned Node must have at least this many CPU cores available.

Required range: x >= 0
Example:

4

description
string | null

An optional description for the Job.

gpu_count
number
default:0

The number of GPUs required for the Job. The assigned Node must have at least this many GPUs available.

Required range: x >= 0
Example:

1

gpu_name
string | null

The name of the GPU to use for the Job. If not specified, the system will choose the first available GPU that satisfies the Job requirements. Mutually exclusive with gpu_registry_uuid.

Example:

"NVIDIA RTX 4090"

gpu_registry_uuid
string<uuid> | null

UUID of a GPU from the GpuRegistry for exact GPU targeting. Mutually exclusive with gpu_name.

Example:

"01234567-89ab-cdef-0123-456789abcdef"

max_node_count
number
default:1

The maximum number of Nodes that can be assigned to run the Job. Default is 1.

max_retry_count
number
default:0

The maximum number of times to retry the Job if it fails. Default is 0 (no retries).

Required range: x >= 0
max_timeout_assign_ms
number
default:300000

The maximum time in milliseconds to wait for the the Job to be assigned to a Node. Default: 5 minutes.

Required range: x >= 300000
max_timeout_start_ms
number
default:300000

The maximum time in milliseconds to wait for the the Node to finish preparing the assigned Job. Default: 5 minutes.

Required range: x >= 120000
min_ram_gb
number
default:0

The minimum RAM in gigabytes required for the Job. The assigned Node must have at least this much RAM available.

Required range: x >= 0
min_storage_gb
number
default:0

The minimum storage in gigabytes required for the Job. The assigned Node must have at least this much storage available.

Required range: x >= 0
min_vram_gb
number
default:0

The minimum VRAM in gigabytes required for the Job. The assigned Node must have at least this much VRAM available.

Required range: x >= 0

Response

Job created successfully

object
enum<string>
required
Available options:
job
created_at
string<date> | null
required
updated_at
string<date> | null
required
status
enum<string>
required
Available options:
PENDING,
ASSIGNED,
RUNNING,
COMPLETED,
CANCELLED,
FAILED
task
enum<string>
required
Available options:
BATCH,
PERSISTENT
title
string
required
cpu_count
number | null
required
gpu_count
number | null
required
min_ram_gb
number
required
min_vram_gb
number
required
min_storage_gb
number
required
parameters
object
required
timeout_assign_at_ms
number | null
required
uuid
string | null
started_at
string<date> | null
completed_at
string<date> | null
description
string | null
gpu_name
string | null
gpu_registry_uuid
string | null
max_timeout_assign_ms
number | null
max_timeout_run_ms
number | null
max_timeout_start_ms
number | null
max_retry_count
number | null
max_node_count
number | null
image_size_bytes
number | null
container_access_tokens
object[]
status_reason
string | null
source_recipe_uuid
string | null