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

FieldRequiredTypeDescription
session_idYesstringSession that owns the artifact
artifact_idYesstringArtifact version ID from the list response, not a file_id or snapshot ID
No 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 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
}

Response fields

FieldTypeDescription
idstringArtifact version ID, not a file_id
objectstringArtifact object type, fixed as agent.session.artifact
session_idstringOwning session
environment_idstringSource environment
turn_idstringSource turn
pathstringFull sandbox path when the artifact was generated
size_bytesintegerFile size in bytes
created_atintegerCreation time, Unix seconds
The detail response does not return underlying storage identifiers, signed download URLs, or credentials.

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.