List artifacts

Lists what a coding run left, kept after its sandbox is gone: every file it added or changed and its whole change as changes.patch, stored beside the run; the ports it served, each a preview while its sandbox is kept; its pull request and where its work was published.

GET /v1/agent/coding/{session}/artifacts

Addresshttps://api.hanzo.ai/v1/agent/coding/{session}/artifacts
MethodGET
Operationget_agent_coding_by_session_artifacts
AuthAuthorization: Bearer $HANZO_API_KEY

Lists what a coding run left, kept after its sandbox is gone: every file it added or changed and its whole change as changes.patch, stored beside the run; the ports it served, each a preview while its sandbox is kept; its pull request and where its work was published. A run that is still working, or saved nothing, answers an empty list.

Request

1 field.

FieldInTypeRequiredDescription
sessionpathstringyesSession is the run's handle — the sessionId POST /v1/agent/coding answered with — from the path.

Response

StatusBodyMeaning
200agent.CodingArtifactsok
defaultproblem-detailsrefused

200 body — 10 fields.

FieldInTypeAlwaysDescription
artifactsbodyagent.Artifact[]—Artifacts are the run's artifacts, stored files first.
artifacts[].kindbodystring—Kind is file, patch, preview, pull or deploy.
artifacts[].namebodystring—Name is the artifact's handle: a changed file's path in the workspace, or changes.patch for the whole change; for a link, its kind and what it names.
artifacts[].portbodyinteger (int64)—Port is a preview's port in the run's sandbox, which POST /v1/sandbox/{id}/preview opens while the sandbox is kept.
artifacts[].sandboxbodystring—Sandbox is the sandbox a preview is served from.
artifacts[].sha256bodystring—SHA256 is a stored artifact's digest, hex.
artifacts[].sizebodyinteger (int64)—Size is a stored artifact's length in bytes.
artifacts[].urlbodystring—URL is where a link points: a preview's host, a pull request, a deployment.
savedbodystring—Saved is when the artifacts were saved, RFC 3339 in UTC; empty while the run has saved none.
sessionbodystring—Session is the run's handle.

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, AgentApi } from 'hanzoai';

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

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

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

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

let result = agent_api::get_agent_coding_by_session_artifacts(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AgentApi;

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

var result = new AgentApi(client).getAgentCodingBySessionArtifacts();
curl https://api.hanzo.ai/v1/agent/coding/<session>/artifacts \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches agent through the agent 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": "list_agents"
         }
       }
     }'

Agent API · All Hanzo APIs · Interactive reference

Was this page useful?