Skip to main content
GET
/
v1
/
training
/
jobs
/
{training_job_id}
/
queue_context
cURL
curl --request GET \
--url https://api.baseten.co/v1/training/jobs/{training_job_id}/queue_context \
--header "Authorization: Bearer $BASETEN_API_KEY"
{
  "target_job_id": "<string>",
  "gpu_type": "<string>",
  "requested_gpus": 123,
  "submitted_at": "2023-11-07T05:31:56Z",
  "active_at_submit": [
    {
      "training_job_id": "<string>",
      "instance_type_name": "<string>",
      "total_gpus": 123,
      "workload_plane_name": "<string>",
      "status_at_submit": "<string>",
      "status_set_at": "2023-11-07T05:31:56Z",
      "training_job_name": "<string>"
    }
  ],
  "pending_ahead_at_submit": [
    {
      "training_job_id": "<string>",
      "instance_type_name": "<string>",
      "requested_gpus": 123,
      "priority": 123,
      "submitted_at": "2023-11-07T05:31:56Z",
      "training_job_name": "<string>"
    }
  ],
  "events": [
    {
      "training_job_id": "<string>",
      "status": "<string>",
      "created": "2023-11-07T05:31:56Z",
      "training_job_name": "<string>",
      "event_message": "<string>",
      "exit_code": 123
    }
  ],
  "events_window_end": "2023-11-07T05:31:56Z",
  "target_job_name": "<string>",
  "released_at": "2023-11-07T05:31:56Z",
  "pending_seconds": 123,
  "org_capacity": {
    "gpu_type": "<string>",
    "max_gpus": 123,
    "last_modified": "2023-11-07T05:31:56Z",
    "min_gpus": 123
  },
  "team_capacity": {
    "gpu_type": "<string>",
    "max_gpus": 123,
    "last_modified": "2023-11-07T05:31:56Z",
    "min_gpus": 123
  }
}

Authorizations

Authorization
string
header
required

Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.

Path Parameters

training_job_id
string
required

Response

200 - application/json

Read-only diagnostic for a training job's PENDING window.

Returns the (org, gpu_type) capacity pool the job was gated by, jobs that were holding GPU capacity in that pool when this job was submitted, and every status event in [submitted_at, released_at] for those jobs (or up to "now" if the target is still PENDING).

target_job_id
string
required

Hashid of the target training job

gpu_type
string
required

GPU type the target requested

requested_gpus
integer
required

GPUs the target requested (gpu_count * effective_node_count)

submitted_at
string<date-time>
required

When the job row was inserted (= API POST time)

active_at_submit
ActiveJobAtSubmitV1 · object[]
required

Jobs in the same (org, gpu_type) pool that were holding capacity at submitted_at

pending_ahead_at_submit
PendingJobAheadAtSubmitV1 · object[]
required

PENDING jobs in the same (org, gpu_type) pool that were ahead of the target in dequeue FIFO order at submitted_at (priority DESC then created ASC). These also block the target's release.

events
QueueEventV1 · object[]
required

Every status event in [submitted_at, events_window_end] for the target job, every job in active_at_submit, and every job in pending_ahead_at_submit, oldest first.

events_window_end
string<date-time>
required

released_at if set, else 'now' (events ongoing)

target_job_name
string | null

Target job's name

released_at
string<date-time> | null

When the job's TRAINING_JOB_CREATED status was set, i.e. the moment it was released from PENDING. None if still PENDING.

pending_seconds
integer | null

released_at - submitted_at in seconds. None if still PENDING.

org_capacity
CapacityAtSubmitV1 · object | null

Org-level cap for (org, gpu_type). None if no cap is configured.

team_capacity
CapacityAtSubmitV1 · object | null

Team-level cap for (team, gpu_type). None if no team cap is configured.