Skip to main content
Artifacts are workspace-scoped files owned by the gateway. The protocol exposes metadata and upload control through JSON-RPC. Upload chunks use WebSocket binary frames; artifact and projection reads use authenticated HTTP routes under /storage/.... Use this API whenever a client needs to upload a local file to a gateway, list files attached to a thread, preview a generated file, download a remote artifact to the client machine, or bind an existing artifact to a new turn.

Methods

Artifact payloads use snake_case field names.

Artifact summary

Most list and get responses return ArtifactSummary.
Important enum values:

Capabilities

Ask the gateway for limits before starting upload UI.
Response:
required_for_local_paths means clients should upload local files to the gateway before referring to them in a turn. This is required for remote gateways and is the safe default for local gateways too.

Agent artifact tools

Agent-created user-visible files use model-facing tools, not client JSON-RPC methods. The tools are registered inside an agent turn when artifact registration is enabled, then made visible by turn preflight or by request_tools with the artifact domain. artifact_prepare reserves a safe staging path before the file exists. It does not create an artifact.
Response:
outputPath is inside PIONEER_ARTIFACT_OUTPUT_DIR. It is a temporary gateway path that can be passed to shell, browser, renderer, MCP, or skill tools. It is not a durable artifact id and must not be treated as a client-visible file location. artifact_register imports a completed regular file into the workspace artifact store and binds it to the current turn.
Response:
Common artifact_register errors include: the file does not exist, the path is outside the allowed workspace or staging roots, the path escapes through a symlink, the path is not a regular file, the file is too large, the workspace quota would be exceeded, or the file was already removed from staging. If the final assistant message mentions PIONEER_ARTIFACT_OUTPUT_DIR or a private gateway path instead of a registered artifact, the gateway can ask the agent to retry registration once. If registration still does not happen, the turn fails instead of presenting a private path as the result.

artifact_read

artifact_read is the model-facing, bounded read tool for artifact continuity. It is an internal agent-domain operation, not a client JSON-RPC method or a client download transport. The model sees artifact refs in recent history or recalled thread context as metadata. If it needs actual file content, it requests the hidden artifact domain and then calls artifact_read for the specific artifact ids it needs. The gateway resolves workspace, thread, turn, and authorization from the active agent turn; the model does not pass workspace_id. Typical arguments are camelCase because this is a model tool contract:
For text-like artifacts or ready text projections, the tool can return text. For images and other binary content, the gateway can return an attachment shape suitable for the provider request path. The model should read only the artifact it needs, not every artifact reference in the prompt. Artifact refs do not make artifact_read visible by themselves. They tell the model what can be requested. The capability becomes callable only after normal tool visibility rules reveal the artifact domain.

Listing artifacts

Use artifact/list/thread for the thread artifacts panel.
Response:
Do not call artifact/list/thread for a draft thread that has not been materialized. The gateway validates that the thread exists and belongs to the workspace.

Reading content

Native clients read exact immutable content from the same gateway_base_url used for the root WebSocket connection:
Both routes require Authorization: Bearer ... and the exact Pioneer-Protocol-Version: 1 header. The gateway authorizes the requested workspace and artifact before opening storage. Clients can use one byte range, If-None-Match, and If-Range; multipart ranges are not supported. Responses provide an exact length, a strong ETag, private cache policy, and content-type/security headers. Clients must stream the response into owned temporary storage, verify the expected length and SHA-256, and publish the file atomically. Access credentials never belong in a URL. For a browser or system viewer that cannot attach native authorization headers, create a short-lived view grant over the authenticated WebSocket session:
The result contains a relative /storage/views/{opaque_grant} URL and an expiry timestamp. Resolve that path against the pinned gateway_base_url and use it only for the intended viewer operation. The grant is scoped to one immutable representation, bound to the authenticated session, short-lived, redacted from diagnostics, and reauthorized on every request.

Upload flow

Start an upload session:
Response:
After artifact/upload/start, send chunks as binary WebSocket frames on the same authenticated connection.

Upload binary chunk frame

Header:
The gateway acknowledges accepted chunks with artifact/upload/chunk_ack:
Use next_offset as the authoritative resume point. Finish the upload:
Response:
If the user cancels, call artifact/upload/abort.

Download and resume flow

Downloads use the authenticated content route from Reading content, not a JSON-RPC session. A client may resume its own partial file with a single Range request and If-Range set to the previously recorded strong ETag. If the representation no longer matches, the client discards the partial file and restarts from byte zero. Cancellation closes the HTTP body and may retain only identity-bound, recoverable partial state; incomplete bytes are never published as the final file.

Binding existing artifacts

Use artifact/bind when a client or gateway flow needs to associate an existing artifact with a new message, turn, tool call, or task result.
Response:

Notifications

Clients should refresh thread artifact lists on thread/artifacts/changed, as well as on artifact/created. An artifact may gain new bindings or metadata without getting a new artifact id.

Client rules

  • Always include workspace_id.
  • Do not list artifacts for draft threads that have not been created on the gateway.
  • Use authenticated /storage/... HTTP routes for native preview and download reads; use a short-lived view grant only for a browser or system viewer.
  • Verify sha256 for completed uploads and final downloaded files.
  • Treat desktop paths and gateway paths as different machines unless you know the gateway is local.
  • Store local preview/download caches as disposable client state.
  • Use generated schemas from /schemas for exact validation.