Dream endpoints are gated by the
dreaming-2026-04-21 beta header; the managed-agents-2026-04-01 header on its own doesn’t grant access to dreams. The dream-endpoint examples on this page send both headers; session and memory-store calls need only managed-agents-2026-04-01. The SDK sets these automatically.How it works
A dream is an asynchronous job that takes:- a pre-existing memory store: the store the model verifies, deduplicates, and reorganizes, and
- 1 to 100 sessions: past transcripts the model mines for patterns and insights to fold into the output.
outputs[] shortly after the dream starts running, once the workflow has cloned the input store; a running dream can briefly report an empty outputs[].
Create a dream
claude-opus-5, claude-fable-5, claude-opus-4-8, claude-opus-4-7, claude-sonnet-5, and claude-sonnet-4-6 are supported. You can optionally pass instructions to steer the dreaming process; see Steer with instructions.
The response is the full dream resource with status: "pending":
Steer with instructions
The optionalinstructions field steers what the dreaming pipeline synthesizes. It is applied throughout the pipeline: what to read closely, what to merge or drop, and how to structure the output store.
Use instructions for high-level synthesis guidance such as focus areas (“focus on coding-style preferences”), content to preserve unchanged, or output conventions you want applied across the store. The pipeline is a synthesis pass over the inputs, not an editor applied to the text of the store, so imperative directives that target specific lines (“change sentence X to Y”, “fix the count in section Z”) generally produce no change. To make targeted edits to individual memories, use the Memory Stores API on the output store directly.
Track progress
Dreams run asynchronously and typically take minutes to a few hours, driven by the number of input transcripts. Poll the dream by ID to check status:Lifecycle
Watch the pipeline run
Once a dream isrunning, its session_id field points at the underlying session running the pipeline. You can stream that session’s events to observe what the dream is reading and writing in real time. The session is archived (not deleted) when the dream reaches a terminal state, so the transcript remains available afterward.
Use the output
Whenstatus reaches completed, the memory_store entry in outputs[] references a fully populated store. It’s an ordinary memory store in your workspace. Review it with the Memory Stores API or in the Console, then either:
- Leverage it: attach it to future sessions as a
memory_storeresource in place of (or alongside) the input memory store, or - Discard it: delete the memory store or archive the memory store.
failed or canceled the output store persists with partial contents so you can inspect what was produced before stopping; clean it up through the Memory Stores API if you don’t need it.
Cancel a dream
Cancel moves apending or running dream to canceled immediately. Canceling an already-canceled dream is an idempotent no-op; canceling a completed or failed dream returns 400.
After cancellation, the dream’s
usage fields might continue to update for a few seconds while in-flight work winds down. Poll the dream until usage stabilizes if you need the final count.Archive a dream
Archive setsarchived_at on a dream that has reached a terminal state (completed, failed, or canceled); status is left unchanged. Archived dreams are excluded from default list responses but remain readable by ID. Archiving an already-archived dream is an idempotent no-op. Archiving a pending or running dream returns 400; cancel it first. There is no unarchive.
List dreams
Returns all non-archived dreams in the workspace, newest first. Uselimit (default 20, max 100) and the page cursor to paginate. Pass include_archived=true to include archived dreams.
Errors
A non-exhaustive list of possible dreaming errors follows.Billing
Dreams are billed at standard API token rates for the model you select;usage on the resource reports the exact totals. Cost scales roughly linearly with the number and length of input sessions. Start with a small batch of sessions and scale up once you’re satisfied with the curation quality.
Limits
Default rate limits apply to dream creation while this feature is in research preview. Contact support if you need higher limits.