Skip to main content

Retrieve an artifact

Retrieve metadata for a single immutable artifact version.

Endpoint

GET /agents/sessions/{session_id}/artifacts/{artifact_id} Returns metadata for the specified artifact. A successful call returns 200 and does not return file content.

Path parameters

session_id string (required)Session that owns the artifactartifact_id string (required)Artifact version ID from the list response, not a file_id or snapshot IDNo request body.

Request example

curl -sS "$BASE_URL/agents/sessions/sess_xxx/artifacts/artifact_xxx" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "OpenAI-Beta: agents=v1"

Response fields

id stringArtifact version ID, not a file_idobject stringArtifact object type, fixed as agent.session.artifactsession_id stringOwning sessionenvironment_id stringSource environmentturn_id stringSource turnpath stringFull sandbox path when the artifact was generatedsize_bytes integerFile size in bytescreated_at integerCreation time, Unix secondsThe detail response does not return underlying storage identifiers, signed download URLs, or credentials.

Response example

{
  "id": "artifact_xxx",
  "object": "agent.session.artifact",
  "session_id": "sess_xxx",
  "environment_id": "ccarenv_xxx",
  "turn_id": "turn_xxx",
  "path": "/workspace/outputs/report.txt",
  "size_bytes": 19,
  "created_at": 1793941200
}

Error codes

HTTP statusError type / codeSolution
404not_found_error / not_found_errorUse an artifact ID that exists and has not been deleted in the current workspace
The error body has the shape {"error":{"type","code","message","param"}}. Gateway errors can use a different structure.