Skip to main content
Responses return a ref. Call client.artifacts.get with that ref to download the file.

Object References

A ref is a 3-5 letter type prefix, an underscore, and a 6-digit hex string (img_a1b2c3).

Retrieving an Artifact

In a Chat Completion

  • session_id comes from the chat response.
  • object_id comes from the ref in the JSON result.

Common Use Cases

Multi-modal Artifacts

Generated images and videos.

Multiple Artifacts

Multiple images in one response, such as a virtual try-on or video thumbnails.

Document Processing

A redacted document returned as a PDF.

3D Reconstruction

A 3D model returned as a ply or spz file.

Best Practices

  • The Python and Node SDKs write large artifacts, including videos, to disk. Check the file size before loading a video into memory.
  • Use a ref type such as ImageRef or VideoRef on the response model. The Python and Node SDKs convert the ref when you call artifacts.get.

API Reference

Retrieve an artifact by id.