> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anonalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Artifacts

> Build a shareable web page that gives an overview of a memory space, and control who can open it.

An artifact is a single, self-contained web page built from what a space holds: an
overview of a project, a summary of decisions, a status page. You ask for it in plain
language, it is built in the background, and you share it through a stable link.

Every artifact starts **private**. Its creator can share it with everyone who can read
the space, and the space owner can make it **public** to anyone with the link.

An artifact is a snapshot. Deleting a memory later does not change pages already built.

## Create an artifact

```http theme={null}
POST /v1/spaces/{space_id}/artifacts
Authorization: Bearer anona_live_YOUR_KEY
Content-Type: application/json
```

```json theme={null}
{
  "request": "An overview of the billing migration: what changed, what is left, who owns it",
  "conversation": []
}
```

| Field | Type | Required | Description |
| - | - | - | - |
| `request` | string | yes | What the page should cover, 1 to 2,000 characters. |
| `conversation` | array | no | Earlier turns, oldest first, each `{"role": "user" or "assistant", "content": "..."}`. At most 40 turns and 40,000 characters in total. Used only to understand references such as "make that into a page"; the page is built from the space's memories. |

**Response** `202 Accepted`

```json theme={null}
{
  "id": "6f1c2a7e-0b7d-4a51-9a52-1d3f0e8c9b11",
  "space_id": "billing",
  "title": null,
  "request": "An overview of the billing migration: what changed, what is left, who owns it",
  "status": "pending",
  "sharing": "private",
  "error_code": null,
  "created_at": "2026-10-16T09:30:00Z",
  "completed_at": null,
  "link": "https://memory.anonalabs.com/a/6f1c2a7e-0b7d-4a51-9a52-1d3f0e8c9b11",
  "can_publish": true
}
```

Building takes from several seconds to a few minutes. Poll
[Get an artifact](#get-an-artifact) until `status` is `completed` or `failed`.

Creating an artifact needs write access to the space; read-only members receive
`403 space_read_only`. You can have one artifact building per space at a time.

### Cost

An artifact is billed in credits for the tokens used to build it, plus a flat
surcharge per page. Before anything is queued, the request is checked against the
most it could cost; if your balance is below that, it is refused with
`429 credits_exhausted` and a message naming the amount. A failed build is not
charged.

## List artifacts

```http theme={null}
GET /v1/spaces/{space_id}/artifacts
```

Returns `{"items": [...]}`, newest first, at most 50. You see your own artifacts and
those shared with the space or made public. The space owner sees all of them,
private ones included, so any link built from the space can be found and withdrawn.

## Get an artifact

```http theme={null}
GET /v1/spaces/{space_id}/artifacts/{artifact_id}
```

Returns the artifact in the shape shown above.

| Field | Description |
| - | - |
| `status` | `pending`, `running`, `completed` or `failed`. |
| `sharing` | `private`, `space` or `public`. |
| `error_code` | Why a build failed, when `status` is `failed`. |
| `link` | The page's stable link. It never expires; whether it opens depends on `sharing`. |
| `can_publish` | Whether you may make artifacts on this space public. |

## Change sharing

```http theme={null}
PATCH /v1/spaces/{space_id}/artifacts/{artifact_id}
Content-Type: application/json
```

```json theme={null}
{ "sharing": "space" }
```

| Value | Who can open the link |
| - | - |
| `private` | The creator, while they can still read the space. |
| `space` | Anyone who can read the space. |
| `public` | Anyone with the link, signed in or not. |

The creator and the space owner can change sharing. Sharing with the space needs
write access to it. Making an artifact public needs the space owner's authority;
anyone else receives `403 space_owner_only`. Returns the updated artifact.

## Delete an artifact

```http theme={null}
DELETE /v1/spaces/{space_id}/artifacts/{artifact_id}
```

Deletes the artifact and its page; the link stops working at once. Allowed for the
creator and the space owner. Returns `204 No Content`. Deleting a space deletes its
artifacts too, public ones included: their links stop working at once, and any still
building are cancelled without charge.

Deleting an artifact that is still building cancels the build: it disappears at once,
nothing is charged for it, and it still counts toward the hourly limit.

## Open an artifact

```http theme={null}
GET /v1/artifacts/{artifact_id}/view
```

This is the access check behind the link. Authentication is optional: a public
artifact opens for anyone.

**Response** `200 OK`

```json theme={null}
{
  "url": "https://...",
  "expires_in": 300,
  "title": "Billing migration overview",
  "shared_by": "Acme",
  "created_at": "2026-10-16T09:30:00Z",
  "can_manage": true,
  "csp": "default-src 'none'; ...",
  "space_id": "acme:billing",
  "sharing": "public",
  "can_publish": false
}
```

| Field | Description |
| - | - |
| `url` | A short-lived URL of the page. Request a fresh one rather than storing it. |
| `expires_in` | Seconds `url` stays valid. |
| `shared_by` | The name of the organization that owns the space. |
| `can_manage` | Whether you may change sharing or delete it. |
| `csp` | Informational: the Content-Security-Policy the page already carries in its own `<meta>` tag. Do not set it as an iframe `csp` attribute — browsers then refuse frames whose server does not opt in, and storage cannot. Embed with `sandbox="allow-scripts"`. |
| `space_id` | Only when `can_manage` is true: the space id to use with the routes above to change sharing or delete. For a space shared with you it is the qualified `{owner_slug}:{space}` form. `null` otherwise. |
| `sharing` | Only when `can_manage` is true: `private`, `space` or `public`. `null` otherwise. |
| `can_publish` | Only when `can_manage` is true: whether you may make the artifact public. `null` otherwise. |

Anyone else who can open the page, including a signed-out visitor to a public link,
gets `null` for these three fields: a link never reveals which space it came from or
how it is shared.

## API keys

Every route above accepts an API key as well as a dashboard session. An API key acts
as the member it belongs to: it has that member's access to each space, their role,
and their authority, and the artifacts it creates are theirs. A key can do exactly
what its member can do in the dashboard, and no more.

## Errors

| Status | Code | Meaning |
| - | - | - |
| 404 | `artifact_not_found` | No such artifact, or it is not shared with you. The two are deliberately indistinguishable. |
| 404 | `space_not_found` | The space does not exist. Nothing is queued. |
| 409 | `artifact_in_progress` | You already have an artifact building in this space. |
| 503 | `artifacts_unavailable` | Artifacts are not available right now. |
| 403 | `space_read_only` | You have read-only access to the space. |
| 403 | `space_owner_only` | Only the space owner can make an artifact public. |
| 429 | `credits_exhausted` | Your balance is below what the artifact could cost. |
| 429 | `artifact_rate_limited` | Your organization has started 10 artifacts this hour, counting failed and deleted ones. The count resets each clock hour, so try again within the hour. |

A failed build reports one of these in `error_code`:

| Code | Meaning |
| - | - |
| `artifact_no_material` | The space had nothing to build a page from. |
| `artifact_truncated` | The page was too long to finish. Ask for a narrower page. |
| `artifact_too_large` | The finished page was over 2 MB. |
| `artifact_rejected` | The page did not pass the safety checks applied to every artifact. |
| `artifact_not_html` | The model did not produce a single HTML page. |
| `artifact_timeout` | Building the page took longer than 10 minutes. |
| `artifact_generation_failed` | The page could not be built after a retry. |
| `credits_exhausted` | When the build started, your balance was below what it could cost. |
| `space_unavailable` | The space could not be read when the build started: your access was removed, or its owner cannot be reached. |

A failed build is not charged.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.