---
title: "Get Build"
method: GET
path: "/v1/builds/{build_id}"
tags: ["Builds"]
---

# Get Build

`GET /v1/builds/{build_id}`

## Request

- Base URL: `https://api.ensemble.markets` (the document declares no server; this is the origin it was published from)
- URL: `https://api.ensemble.markets/v1/builds/{build_id}`
- Auth: HTTP bearer

One build attempt with the script it produced and the full error,
including the traceback. A program's `build_id` names the build behind
the script it serves; a run's `script_hash` matches the build that
produced it. A legacy `b-<uuid>` id still resolves, stored as-is or
re-prefixed to mb-/sb-/ab-. Owner only.

## Path parameters

- `build_id` string, required: Build ID (build_... or legacy mb-/sb-/ab-/b-...). Read kind for the program type. A legacy b-<uuid> from a fact sheet still resolves.

## Response `200`

Successful Response

- Build: A build with the script it produced and the full error, including traceback.
  - `id` string, required: Build ID (build_... or legacy mb-/sb-/ab-/b-...). Read kind for the program type.
  - `kind` 'model', required
  - `program_id` string, required: The model built
  - `attempt` 'build' | 'rebuild' | 'revision', required: build: the first build; rebuild: a later generation; revision: a promote rewrote the script's defaults without generating
  - `status` 'succeeded' | 'failed' | 'cancelled', required
  - `prompt` string, nullable
  - `effort` 'min' | 'mid' | 'max', nullable
  - `script_hash` string, nullable: SHA-256 of the script this attempt produced; runs carry the same hash
  - `error` BuildError
    - `type` string, nullable: validation_failed: the request was rejected before any code was written (not billed). generation_failed: the generated script failed validation. execution_failed: the sandbox run failed. internal_error and cancelled are ours and not billed.
    - `message` string, required
    - `code_excerpt` string, nullable: The lines of the script around the failure, if any
    - `validation` ValidationError[], nullable: The rejection(s), present when the build failed validation
      - `type` string, required: Which rule rejected it: syntax, forbidden, price_source, nondeterministic, constants, entry_point, imports, inputs, members, universe, sources, metadata or other
      - `message` string, required: The rejection, written to teach the fix
      - `line` integer, nullable: The line named by the message, if any
  - `usage` BuildUsage: Billing usage for one generation.
    - `units` integer, required
    - `base` integer, nullable
    - `tokens` integer, nullable
    - `seconds` integer, nullable
    - `effort` 'min' | 'mid' | 'max', nullable: The effort the attempt was billed at
  - `trace_id` string, nullable
  - `started_at` string, date-time, nullable
  - `completed_at` string, date-time, required
  - `script` string, nullable
  - `traceback` string, nullable
  - `timing` object, nullable

## Other responses

- `4XX`: The request was refused; `error.type` says why
- `5XX`: The server failed; quote `X-Request-Id` when reporting it

---

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