---
title: "Reconstructs queue context for a training job"
method: GET
path: "/v1/training/jobs/{training_job_id}/queue_context"
---

# Reconstructs queue context for a training job

`GET /v1/training/jobs/{training_job_id}/queue_context`

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 TrainingJobStatus event in [submitted_at, released_at] for those jobs, useful for understanding why a job sat in PENDING. Caller must be an org admin and the job must belong to the caller's org.

## Response `200`

- GetTrainingJobQueueContextResponseV1 — 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
  - `target_job_name` string, nullable — Target job's name
  - `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)
  - `released_at` string, date-time, nullable — 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, nullable — released_at - submitted_at in seconds. None if still PENDING.
  - `org_capacity` CapacityAtSubmitV1 — A GPU capacity row as it stands now, with ``last_modified`` so callers can judge whether the value matches what the dequeue gate saw at submit time. Capacity rows are not historicized: edits overwrite in place. Compare ``last_modified`` against the response's ``submitted_at`` — if it's later, the value may have changed.
    - `gpu_type` string, required — GPU type identifier (e.g. H100, A100-40GB)
    - `max_gpus` integer, required — Current max concurrent GPUs of this type
    - `min_gpus` integer, nullable — Current baseline GPU allocation, if configured
    - `last_modified` string, date-time, required — When the capacity row was last modified
  - `team_capacity` CapacityAtSubmitV1 — A GPU capacity row as it stands now, with ``last_modified`` so callers can judge whether the value matches what the dequeue gate saw at submit time. Capacity rows are not historicized: edits overwrite in place. Compare ``last_modified`` against the response's ``submitted_at`` — if it's later, the value may have changed.
    - `gpu_type` string, required — GPU type identifier (e.g. H100, A100-40GB)
    - `max_gpus` integer, required — Current max concurrent GPUs of this type
    - `min_gpus` integer, nullable — Current baseline GPU allocation, if configured
    - `last_modified` string, date-time, required — When the capacity row was last modified
  - `active_at_submit` ActiveJobAtSubmitV1[], required — Jobs in the same (org, gpu_type) pool that were holding capacity at submitted_at
    - `training_job_id` string, required — Hashid of the other training job
    - `training_job_name` string, nullable — Other job's name
    - `instance_type_name` string, required — Instance type of the other job
    - `total_gpus` integer, required — gpu_count * effective_node_count
    - `workload_plane_name` string, required — Workload plane the other job was on
    - `status_at_submit` string, required — Other job's status as of submitted_at (one of ACTIVE_STATES)
    - `status_set_at` string, date-time, required — When that status was set
  - `pending_ahead_at_submit` PendingJobAheadAtSubmitV1[], 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.
    - `training_job_id` string, required — Hashid of the other training job
    - `training_job_name` string, nullable — Other job's name
    - `instance_type_name` string, required — Instance type of the other job
    - `requested_gpus` integer, required — gpu_count * effective_node_count
    - `priority` integer, required — Effective priority (NULL coalesced to 0)
    - `submitted_at` string, date-time, required — The other job's submission time
  - `events` QueueEventV1[], 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.
    - `training_job_id` string, required — Hashid of the training job this event is for
    - `training_job_name` string, nullable — Job name
    - `status` string, required — TrainingJobStatus.Name value
    - `created` string, date-time, required — When the status row was inserted
    - `event_message` string, nullable — Human-readable event message from the status metadata
    - `exit_code` integer, nullable — Exit code from the status metadata, if any
  - `events_window_end` string, date-time, required — released_at if set, else 'now' (events ongoing)

---

[API](https://skmtc.dev/baseten/apis/baseten-inference-api.md) · [All operations](https://skmtc.dev/baseten/apis/baseten-inference-api/llms.txt) · [OpenAPI document](https://skmtc.dev/baseten/apis/baseten-inference-api/revisions/a55a2f64c3c5?raw)
