class

Anthropic::BetaDreams

Inherits Reference < Object

Dreams API resource (beta / research preview).

An asynchronous memory-consolidation job that reads a memory store plus session transcripts and writes consolidated memories into a new output memory store. Dream endpoints require both beta headers (auto-attached): managed-agents-2026-04-01 and dreaming-2026-04-21. Research-preview access must be requested separately; without it the API returns 404.

dream = client.beta.dreams.create(
  inputs: [
    Anthropic::BetaDreamMemoryStoreInput.new("memstore_abc"),
    Anthropic::BetaDreamSessionsInput.new(["sess_1", "sess_2"]),
  ],
  model: "claude-opus-4-7",
  instructions: "Consolidate project facts",
)
dream = client.beta.dreams.retrieve(dream.id)

Constructors

new(client : Client)
Source

Instance methods

archive(dream_id : String, betas : Array(String) = [] of String) : BetaDream

Archive a Dream.

Source
cancel(dream_id : String, betas : Array(String) = [] of String) : BetaDream

Cancel a Dream that is still pending or running.

Source
create(inputs : Array(BetaDreamInput | Hash(String, JSON::Any)), model : String | BetaDreamModelConfig | Hash(String, JSON::Any), instructions : String | Nil = nil, betas : Array(String) = [] of String) : BetaDream

Create a Dream.

model may be a bare model id string or a BetaDreamModelConfig / hash with id (and optional speed).

Source
list(created_at_gt : String | Nil = nil, created_at_lt : String | Nil = nil, include_archived : Bool | Nil = nil, limit : Int32 = 20, page : String | Nil = nil, statuses : Array(String) | Nil = nil, betas : Array(String) = [] of String) : BetaDreamListResponse

List Dreams.

created_at_gt / created_at_lt are exclusive RFC 3339 bounds. statuses filters by lifecycle status (repeatable query param).

Source
retrieve(dream_id : String, betas : Array(String) = [] of String) : BetaDream

Retrieve a Dream by ID.

Source