Get build

Answers one build: its status, and for a failed build the reason.

GET /v1/build/{id}

Addresshttps://api.hanzo.ai/v1/build/{id}
MethodGET
Operationget_build_by_id
AuthAuthorization: Bearer $HANZO_API_KEY

Answers one build: its status, and for a failed build the reason.

A build belongs to the organization its credential names, so it is read by the credential that could have asked for it, and another organization's build is 404 rather than 403: whether an id exists is not said to anyone it is not for.

Request

1 field.

FieldInTypeRequiredDescription
idpathstringyesID is the build's id, from the path.

Response

StatusBodyMeaning
200platform.runnerBuildRespok
defaultproblem-detailsrefused

200 body — 9 fields.

FieldInTypeAlwaysDescription
buildJobIdbodystring—BuildJobID is the queued build's id, and what its progress is read by.
imagebodystring—Image is the ref the image lane will push.
indexbodystring—Index is the binaries.json URL the artifact lane will publish.
platformsbodystring[]—Platforms are the architectures the image lane will publish, echoed back.
reasonbodystring—Reason is why a failed build failed, as the cluster said it: the solve's error line (error: failed to solve: ...), a container waiting on what it cannot have, or the deadline.
runnerPoolbodystring—RunnerPool is the runner class the build was placed on.
statusbodystring—Status is queued until the build finishes, then succeeded or failed.
tagsbodystring[]—Tags are the extra tags the image lane will write beside Image, onto the same manifest: the request's, deduplicated.
targetbodystring—Target is the multi-stage build target, echoed back.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.

import { Configuration, PlatformApi } from 'hanzoai';

const api = new PlatformApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getBuildById({ id: 'id' });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import PlatformApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = PlatformApi(client).get_build_by_id(id='id')
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.PlatformAPI.GetBuildById(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, platform_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = platform_api::get_build_by_id(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.PlatformApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new PlatformApi(client).getBuildById();
curl https://api.hanzo.ai/v1/build/<id> \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches platform through the platform tool, which names its 38 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_build"
         }
       }
     }'

Platform API · All Hanzo APIs · Interactive reference

Was this page useful?