Claude Platform Docs

Dream 생성

client.beta.dreams.create(params, options?): BetaDream
POST/v1/dreams

과거 세션을 사용하여 메모리 저장소의 재구성된 버전을 생성하는 비동기 작업을 시작하고, 결과를 폴링할 수 있는 드림을 반환받습니다.

기본적으로 드림은 결과를 새 메모리 저장소에 기록하며 입력 메모리 저장소는 변경하지 않습니다. 응답의 status는 pending으로 설정되고 outputs 배열은 비어 있습니다. status가 completed, failed 또는 canceled가 될 때까지 드림을 폴링하세요.

드림 생성에 대한 자세한 내용은 Dreams 가이드를 참조하세요.

Parameters
params: DreamCreateParams { inputs; model; instructions; /* 3 more */ }
inputs: Array<BetaDreamInput>

The memory store and sessions for the dream to read, as exactly one memory_store entry and exactly one sessions entry.

One of the following:
interface BetaDreamMemoryStoreInput { type: "memory_store"; memory_store_id }

The memory store that a dream reads, given as an entry in inputs.

With output_behavior set to update_existing, the dream writes its result into this memory store. Otherwise the dream doesn't change it.

type: "memory_store"
memory_store_id: string

The ID of the memory store for the dream to read (memstore_...).

The memory store must be in the same workspace as the dream and must not be archived.

minLength1
interface BetaDreamSessionsInput { type: "sessions"; session_ids }

The sessions that a dream reads, given as an entry in inputs.

type: "sessions"
session_ids: Array<string>

The IDs of the sessions whose transcripts the dream reads (sesn_...).

Give 1 to 100 IDs, with no duplicates. Each session must be in the same workspace as the dream. Responses list the IDs in sorted order.

The limits table in the Dreams guide lists all the limits on a dream.

model: string | BetaDreamModelConfigParam

The model that runs a dream, given as a model ID or as an object with id and speed.

In the object form, speed can only be standard.

The limits table in the Dreams guide lists the supported models.

One of the following:
string
interface BetaDreamModelConfigParam { id; speed }

The object form of model in a request to create a dream.

id: string

The ID of the model to run the dream with.

The ID can be 1 to 256 characters long.

The limits table in the Dreams guide lists the supported models.

minLength1
maxLength256
speed?: "standard" | "fast" | null

How fast the model generates output for the dream. Defaults to standard.

Dreams accept only standard.

One of the following:
"standard"
"fast"
instructions?: string | null

Guidance that steers how the dream reads the sessions and organizes the output memory store, from 1 to 4,096 characters.

See the Dreams guide for what kinds of instructions work well.

minLength1
maxLength4096
output_behavior?: BetaOutputBehavior

Which memory store a dream writes its result to. Defaults to create_new when left out of a create request.

One of the following:
interface BetaOutputBehaviorCreateNew { type: "create_new" }

Write the result to a new memory store that starts as a copy of the input memory store. This is the default.

The new memory store is in the same workspace as the dream. The dream doesn't change the input memory store.

type: "create_new"
interface BetaOutputBehaviorUpdateExisting { type: "update_existing"; memory_store_id }

Write the result into the input memory store instead of a new memory store.

The credential must be allowed to write memory stores, or the request returns a 403 error. While another update_existing dream on the same memory store hasn't fully stopped, the request returns a 409 error.

type: "update_existing"
memory_store_id: string

The ID of the memory store for the dream to write its result to (memstore_...). It must be the memory store in the memory_store entry of inputs.

minLength1
betas?: Array<AnthropicBeta>⁠Header parameter

Optional header to specify the beta version(s) you want to use.

One of the following:
(string & {})
"message-batches-2024-09-24"
"prompt-caching-2024-07-31"
"computer-use-2024-10-22"
"computer-use-2025-01-24"
"pdfs-2024-09-25"
"token-counting-2024-11-01"
"token-efficient-tools-2025-02-19"
"output-128k-2025-02-19"
"files-api-2025-04-14"
"mcp-client-2025-04-04"
"mcp-client-2025-11-20"
"dev-full-thinking-2025-05-14"
"interleaved-thinking-2025-05-14"
"code-execution-2025-05-22"
"extended-cache-ttl-2025-04-11"
"context-1m-2025-08-07"
"context-management-2025-06-27"
"model-context-window-exceeded-2025-08-26"
"skills-2025-10-02"
"fast-mode-2026-02-01"
"output-300k-2026-03-24"
"user-profiles-2026-03-24"
"user-profiles-2026-08-18"
"user-profiles-2026-09-04"
"advisor-tool-2026-03-01"
"managed-agents-2026-04-01"
"cache-diagnosis-2026-04-07"
"dreaming-2026-04-21"
"thinking-token-count-2026-05-13"
"server-side-fallback-2026-06-01"
"server-side-fallback-2026-07-01"
"fallback-credit-2026-06-01"
"fallback-credit-2026-07-01"
"agent-memory-2026-07-22"
"mid-conversation-tool-changes-2026-07-01"
"compact-2026-01-12"
"computer-use-2025-11-24"
"mcp-tunnels-2026-06-22"
"structured-outputs-2025-11-13"
"task-budgets-2026-03-13"
"thinking-display-updates-2026-08-18"
"ce-user-management-2026-07-13"
"mid-conversation-output-config-2026-07-01"
"thinking-binding-controls-2026-08-01"
"mid-conversation-system-clear-at-2026-08-21"
"compact-2026-09-04"
"inline-tools-2026-09-15"
"mcp-client-2026-09-15"
"ce-plugins-2026-09-01"
"spend-limit-reads-2026-09-26"
workspace_id?: string⁠Header parameter

Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).

Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

Returns
interface BetaDream { type: "dream"; id; archived_at; /* 11 more */ }

An asynchronous job that reads a memory store and past sessions, then writes a reorganized version of that memory store.

By default the dream writes its result to a new memory store and doesn't change the input memory store. With output_behavior set to update_existing, it writes its result into the input memory store instead.

The Dreams API is in research preview: the request and response shapes are volatile and may change without the deprecation period that applies to generally-available endpoints.

See the Dreams guide for what a dream reads and produces.

Dream 생성
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});

const betaDream = await client.beta.dreams.create({
  inputs: [{ memory_store_id: "x", type: "memory_store" }],
  model: "string"
});

console.log(betaDream.id);
Returns Examples
Response 200
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "ended_at": "2019-12-27T18:11:19.117Z",
  "error": {
    "message": "message",
    "type": "type"
  },
  "inputs": [
    {
      "memory_store_id": "x",
      "type": "memory_store"
    }
  ],
  "instructions": "instructions",
  "model": {
    "id": "x",
    "speed": "standard"
  },
  "output_behavior": {
    "type": "create_new"
  },
  "outputs": [
    {
      "memory_store_id": "memory_store_id",
      "type": "memory_store"
    }
  ],
  "session_id": "session_id",
  "status": "pending",
  "type": "dream",
  "usage": {
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "input_tokens": 0,
    "output_tokens": 0
  }
}