Artifacts API

Publish self-contained HTML or Markdown pages to a shareable URL. Artifacts are versioned and permissioned, and update in place when you publish again.

This page is the REST reference. For the concepts and the CLI, see Artifacts, Publishing, Capabilities, and Sharing.

Responses use the standard envelope. See REST overview — response format.


Scopes

ScopeAccess
artifacts:readPost comments
artifacts:writeCreate, publish versions, update metadata, delete, change visibility, share, transfer, upload and delete assets, activate and resolve comment threads

Read routes (list, get, content, render, frame, comments, assets, viewer, page store) need no scope. They apply the artifact's visibility instead: public and unlisted artifacts are readable without authentication, and everything else requires a caller who is allowed to see it.

A reader is served the artifact's one live version: the latest, or the pinned one. Version history is for editors, meaning the owner, a user shared with write permission, or a workspace member. GET /artifacts/{id}/versions answers a viewer with 403; GET /artifacts/{id}/versions/{versionId} and its content answer with 404. content, render and frame return 404 to a viewer who names a version other than the live one.

Both scopes are in the standard preset. See API keys — Permission scopes.


Endpoints

MethodPathScopePurpose
GET/artifacts—List artifacts
POST/artifacts/list—List artifacts (JSON body)
GET/artifacts/{id}—Get an artifact
GET/artifacts/{namespace}/{name}—Get an artifact by name
POST/artifactsartifacts:writeCreate an artifact, or publish a version when the name exists
POST/artifacts/{id}artifacts:writeUpdate metadata
POST/artifacts/{id}/versionsartifacts:writePublish a version
DELETE/artifacts/{id}artifacts:writeDelete
GET/artifacts/{id}/versions—List versions. Editors only.
POST/artifacts/{id}/versions/list—List versions (JSON body). Editors only.
GET/artifacts/{id}/versions/{versionId}—Get one version. Editors only.
GET/artifacts/{id}/content—Page source of the live version
GET/artifacts/{id}/versions/{versionId}/content—Page source of one version. Editors only.
GET/artifacts/{id}/render—Wrapped HTML document
GET/artifacts/{id}/frame—Embed URLs for an iframe
GET/artifacts/{id}/stream—Server-sent events for updates
GET/artifacts/guidance—Authoring guidance as Markdown
POST/artifacts/{id}/visibilityartifacts:writeChange visibility
GET/artifacts/{id}/sharesartifacts:writeList per-user shares
POST/artifacts/{id}/shareartifacts:writeShare with a user
DELETE/artifacts/{id}/share/{userId}artifacts:writeRevoke a share
POST/artifacts/{id}/transferartifacts:writeTransfer to another workspace
GET/artifacts/{id}/comments—List comment threads
POST/artifacts/{id}/commentsartifacts:readPost a comment
POST/artifacts/{id}/comments/{commentId}/activateartifacts:writeSend a thread to agents
POST/artifacts/{id}/comments/{commentId}/resolveartifacts:writeResolve or reopen a thread
GET/artifacts/{id}/viewer—Who is viewing (user capability)
POST/artifacts/{id}/data/get list set update delete—Page store (db capability)
GET/artifacts/{id}/assets—List assets
GET/artifacts/{id}/assets/{assetId}—Download an asset
POST/artifacts/{id}/assetsartifacts:writeUpload an asset
DELETE/artifacts/{id}/assets/{assetId}artifacts:writeDelete an asset

Artifact object

FieldTypeDescription
idstringArtifact ID
namespacestringOwning workspace's username. Immutable.
namestringSlug within the namespace. Immutable.
titlestringDisplay title
descriptionstringOne-line summary
faviconstringOne or two emoji for the rendered page's browser tab
imagesobjectCover images: card, thumbnail, banner (URL strings)
typestringhtml (default) or markdown
version_idstringLatest published version ID
versionobjectLatest version metadata
shared_version_idstringPinned version. When set, it is the live version viewers are served; empty means the latest.
capabilitiesobjectRuntime capabilities the latest version declared
visibilitystringprivate, team, org, unlisted, or public
viewsintegerView count
urlstringCanonical viewer URL
created_at, updated_atstringRFC 3339 timestamps

New artifacts are created private.

Version object

FieldTypeDescription
idstringVersion ID
artifact_idstringParent artifact ID
numberinteger1-based publish sequence
contentobjectStored file reference (uri, hash, size). The source itself comes from the content endpoints. uri is empty when the version is stored in the private artifacts bucket — use the content endpoints instead of treating a bare storage key as a public URL.
content_hashstringSHA-256 of the UTF-8 source
md5stringLowercase hex MD5 of the UTF-8 source
size_bytesintegerSource byte length
label, notesstringOptional version label and notes
originstringProvenance, for example belt, chat:<id>, api
generated_bystringWho produced the version, for example agent:<id>, human:<email>
capabilitiesobjectRuntime capabilities this version declared
created_by_user_idstringPublishing user

Publishing identical content is a no-op. No duplicate version is created.


Create or publish

POST /artifacts creates an artifact and its first version. When an artifact with the same name already exists in your namespace, it publishes a new version instead.

POST /artifacts/{id}/versions appends a version to an existing artifact.

Both accept multipart/form-data or JSON. Multipart is the recommended way to send page source.

Multipart

PartDescription
filePage source (HTML or Markdown). Omit to update metadata without creating a version.
title, description, favicon, typeEntry metadata
nameSlug on create. Derived from title when omitted.
label, notes, origin, generated_byVersion metadata
imageCover URL. Sets card, thumbnail, and banner to the same value.
capability or capabilitiesRepeat the field or comma-separate: db, user, assets
base_version_id, forceSee Version conflicts
bash
1curl -X POST https://api.inference.sh/artifacts \2  -H "Authorization: Bearer inf_your_key" \3  -F "[email protected]" \4  -F "title=Sales dashboard" \5  -F "type=html" \6  -F "capability=db"
bash
1curl -X POST https://api.inference.sh/artifacts/art_abc123/versions \2  -H "Authorization: Bearer inf_your_key" \3  -F "[email protected]" \4  -F "label=v2"

JSON

FieldTypeRequiredDescription
titlestringOn createDisplay title
contentstringYesPage source (HTML or Markdown)
content_encodingstringNo"base64" when content is base64-encoded UTF-8
namestringNoSlug on create. Derived from title when omitted.
description, faviconstringNoEntry metadata
imagesobjectNoCover image URLs (card, thumbnail, banner)
typestringNohtml (default) or markdown. Create only.
label, notes, origin, generated_bystringNoVersion metadata
capabilitiesobjectNoFor example {"db": true, "user": true}. An unknown name is refused.
base_version_idstringNoVersion the content was built on
forcebooleanNoPublish over a newer version and discard it
bash
1curl -X POST https://api.inference.sh/artifacts \2  -H "Authorization: Bearer inf_your_key" \3  -H "Content-Type: application/json" \4  -d '{5    "title": "Release notes",6    "type": "markdown",7    "content": "# v2.0\n\n- Faster renders"8  }'

Version conflicts

Pass base_version_id with the version_id you read before editing. When the artifact has moved past that version, the publish is refused with 409 and code version_conflict. The detail names the current version. Re-read it, merge, and publish again.

RequestResult
base_version_id omittedUnconditional publish
base_version_id equals the current version_idPublish proceeds
base_version_id is stale409 version_conflict
force: truePublishes anyway and discards what landed in between

Update metadata

POST /artifacts/{id}

Updates title, description, favicon, images, or shared_version_id. Content changes go through a publish.

json
1{2  "title": "Updated title",3  "shared_version_id": "VERSION_ID"4}

shared_version_id pins a version, making it the live one viewers are served. Pass "" to make the latest version live again. Pinning changes which version is live; editors keep access to every version. See Sharing — Versions.


List and get

GET /artifacts or POST /artifacts/list returns artifacts you own or that were shared with you, with cursor pagination.

GET /artifacts/{id} returns one artifact by ID.

GET /artifacts/{namespace}/{name} resolves by name. Append @shortVersionId to the name to get that version attached instead of the latest (for example myteam/report@a1b2c3d4). For a viewer, a version other than the live one is 404.

GET /artifacts/{id}/versions or POST /artifacts/{id}/versions/list lists version metadata with cursor pagination. GET /artifacts/{id}/versions/{versionId} returns one version. Both require write access to the artifact: a viewer receives 403 from the list and 404 for a single version.

DELETE /artifacts/{id} deletes the artifact.


Content

GET /artifacts/{id}/content returns the source of the live version (latest, or the pinned version).

GET /artifacts/{id}/versions/{versionId}/content returns one version. versionId is a full ID or the short ID. Editors only; a viewer receives 404 for any version but the live one.

RequestResponse
DefaultJSON: artifact_id, version_id, number, type, title, content, content_hash, md5, size_bytes
Accept: text/* or ?raw=1Raw source body

Render

GET /artifacts/{id}/render

Returns the page wrapped in a full HTML document, as belt artifact get --render prints it.

QueryDescription
versionVersion ID or short ID. Default: the live version. A viewer naming any other version receives 404.
themedark or light

The response Content-Type is text/plain, so a browser shows the source instead of running it on the API origin. Browsers display published pages through Frame.


Frame

GET /artifacts/{id}/frame

Returns the URLs a client loads to show a published page. Both point at the user-content domain, never the API host. See Artifacts — Where a page runs. Accepts the same version and theme query parameters as Render, and runs the same read check as GET /artifacts/{id}. A viewer is framed the live version only; any other version is 404.

FieldTypeDescription
artifact_idstringArtifact ID
version_idstringResolved version ID
version_short_idstringVersion short ID
embed_urlstringURL for an <iframe>
top_urlstringThe same page opened in its own tab
exchangebooleantrue when the URLs carry a short-lived access token. false for a public artifact, which needs none.
expires_atstringWhen the URL token expires. Omitted when exchange is false.

URL tokens are valid for about 10 minutes. Once a URL has been opened, the page stays accessible in that browser for about 55 minutes. Request a new frame after that.

bash
1curl "https://api.inference.sh/artifacts/art_abc123/frame?theme=dark" \2  -H "Authorization: Bearer inf_your_key"

Authoring guidance

GET /artifacts/guidance

Returns the page contract with the design, capability, and diagram guidance. It is the text belt artifact guidance prints. No authentication required. The response body is text/markdown, not JSON.

QueryDescription
topicsComma-separated: design, capabilities, diagrams. Omit for all.

Live updates

GET /artifacts/{id}/stream

Server-sent events for artifact updates such as new versions and metadata changes. See Streaming.


Visibility, sharing, transfer

POST /artifacts/{id}/visibility

json
1{ "visibility": "unlisted" }
ValueWho can view
privateThe author (default on create)
teamWorkspace members
orgOrganization members
unlistedAnyone with the link
publicAnyone

POST /artifacts/{id}/share shares with one user:

json
1{ "user_id": "USER_ID", "permission": "read" }

permission is read (viewer: the live version) or write (editor: can publish versions and read the version history). GET /artifacts/{id}/shares lists shares. DELETE /artifacts/{id}/share/{userId} revokes one.

POST /artifacts/{id}/transfer moves the artifact to another workspace:

json
1{ "team_id": "TEAM_ID" }

→ Sharing


Comments

GET /artifacts/{id}/comments returns an array of threads. Each thread is a root comment with its replies in chronological order. Anyone who can read the artifact can list its threads.

POST /artifacts/{id}/comments requires artifacts:read.

FieldDescription
contentComment body (required)
parent_comment_idThread root to reply to. Omit to start a thread.
send_to_agentActivate the thread for agents in the same request

Comments are disabled on public artifacts. The request returns 409 with code comments_unavailable.

POST /artifacts/{id}/comments/{commentId}/activate sets agent_activated on a thread root. Agents can read every thread but can only reply to or resolve activated threads.

POST /artifacts/{id}/comments/{commentId}/resolve resolves a thread. Send {"resolved": false} to reopen it.


Runtime capabilities

A page declares capabilities at publish time and gets only what its published version declared. Capabilities covers the window.inferencesh JavaScript API. The routes below are what the viewer calls on the page's behalf. Each is refused unless the artifact declared the matching capability.

Page store (db)

POST /artifacts/{id}/data/get, /data/list, /data/set, /data/update, /data/delete

FieldTypeRequiredDescription
collectionstringYesCollection path, for example poll or data/users/me/prefs
doc_idstringFor get, set, update, deleteDocument ID within the collection
dataobjectFor set, updateJSON document body
limitintegerNoMax documents on list. Clamped to 200.

set replaces a document and creates it when missing. update merges fields. Reads follow the artifact's visibility. Writes require a signed-in caller. Documents under data/users/me are private to the caller who wrote them.

A document response has collection, doc_id, data, updated_at, and owner_user_id (set for per-viewer documents). A list response has collection, documents, and count.

bash
1curl -X POST https://api.inference.sh/artifacts/art_abc123/data/get \2  -H "Authorization: Bearer inf_your_key" \3  -H "Content-Type: application/json" \4  -d '{"collection": "poll", "doc_id": "totals"}'

data/get returns 404 not_found with document not found when the artifact is readable but the document does not exist. data/list returns an empty documents array for an empty collection.

Viewer identity (user)

GET /artifacts/{id}/viewer

FieldTypeDescription
signed_inbooleanfalse for someone opening a public link without an account
user_idstringPresent when signed in
namestringDisplay name
avatar_urlstringProfile image URL
can_editbooleanWhether this viewer is an editor: may publish new versions and read the version history

No email or credential is included.

Assets (assets)

Files stored beside an artifact. Page sources and assets are written to a dedicated private object store (not the shared bucket behind public task file URLs). Anyone who can view the artifact can read its assets through the API; upload and delete require artifacts:write. Uploading identical bytes twice returns the existing asset.

POST /artifacts/{id}/assets takes multipart form data with a file part and an optional content_type field.

bash
1curl -X POST https://api.inference.sh/artifacts/art_abc123/assets \2  -H "Authorization: Bearer inf_your_key" \3  -F "[email protected]"
FieldTypeDescription
asset_idstringAsset ID
filenamestringOriginal filename
content_typestringMIME type
size_bytesintegerFile size
urlstringAddress to use in page markup, exactly as returned
created_atstringRFC 3339 timestamp
uploaded_by_user_idstringUploading user

GET /artifacts/{id}/assets returns assets, count, total_bytes, and budget_bytes.

GET /artifacts/{id}/assets/{assetId} checks that the caller may view the artifact, then redirects (302) to a storage URL valid for 15 minutes, or streams the bytes.

DELETE /artifacts/{id}/assets/{assetId} removes the asset and its stored bytes.


Limits

LimitValue
Page source per publish16 MiB
Asset file25 MiB
Assets per artifact250 MiB and 500 files
Asset upload through the MCP artifact_asset_upload tool8 MiB per file
Page store document128 KiB of stored JSON
Page store per artifact16 MiB and 10,000 documents
Page store list200 documents per call
Collection path / document ID length512 / 200 characters

A page store write over a limit returns 400 with code validation_error. Replacing an existing document is measured against the new payload only.


  • Artifacts — what a page is and where it runs
  • Publishing — belt artifact publish, flags, updating in place
  • Capabilities — db, user, assets from inside a page
  • Sharing — visibility, pinned versions, comments
  • API keys — artifacts:read and artifacts:write scopes

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.