Skip to main content

Create Dream

Trigger an asynchronous memory consolidation job.

POST /api/v1/cloud/dreams Creates a Dream that asynchronously consolidates the specified Memory Store. Returns a Dream object.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>
Content-TypeYesapplication/json

Request body

FieldTypeRequiredDescription
inputsarrayYesInput list. Must include one memory_store type input; optionally include sessions type inputs
modelstring | object | nullNoModel ID or Dream model object with optional reasoning effort and context window. Omitted, null, or empty-string values use auto
instructionsstringNoCustom consolidation instructions, at most 4096 bytes when UTF-8 encoded (a character may use multiple bytes)

inputs elements

FieldTypeDescription
typestring"memory_store" or "sessions"
memory_store_idstringRequired when type is memory_store
session_idsarrayRequired when type is sessions, max 100 Session IDs

model object

Existing string requests remain supported, for example "model": "auto". You can also pass an object:
{"model":{"id":"dfmodel","effort":"high","context_window":400000}}
FieldTypeRequiredDescription
idstringYesNonempty model ID. Use an available, enabled ID from List Models; IDs are not limited to a fixed set of tiers
effortstringNoReasoning effort: none, low, medium, high, xhigh, or max. Values other than none must appear in the selected model's efforts; none explicitly disables reasoning
context_windowintegerNoContext window in tokens; must be a positive integer. When the model has a nonempty available_context_windows list, select a value from it; no tier restriction is applied when the catalog declares no tiers
  • The two options may be omitted independently. Omission means no explicit override; responses do not fill in defaults as user selections. Explicit null, empty effort, zero or negative windows, and other invalid values return 400.
  • Omitting the entire model, or sending null, an empty string, or a whitespace-only string, selects auto. An object must contain a nonempty id; {} does not mean auto.
  • auto without options keeps automatic routing. With effort or context_window, the catalog must contain an available auto entry supporting those options; otherwise the request returns 400.
  • Only id, effort, and context_window are supported in the object. speed and other unknown fields return 400. The error response's error.param identifies the field.
  • The example illustrates the format. Query the models and options available to your identity before using it; do not assume dfmodel, high, or 400000 is always available.

Example request

curl -s -X POST 'https://api.qoder.com/api/v1/cloud/dreams' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": [
      { "type": "memory_store", "memory_store_id": "memstore_019e5cdb9c3f71c3b6505eba937a40b4" },
      { "type": "sessions", "session_ids": ["sess_019e7a1b2c3d4e5f6a7b8c9d0e1f2a3b"] }
    ],
    "model": { "id": "dfmodel", "effort": "high", "context_window": 400000 },
    "instructions": "Focus on user preferences for code style"
  }'

Example response

HTTP 201 Created
{
  "id": "drm_019e86b4a8f070a3b6c5d4e3f2a1b0c9",
  "type": "dream",
  "status": "pending",
  "inputs": [
    { "type": "memory_store", "memory_store_id": "memstore_019e5cdb9c3f71c3b6505eba937a40b4" },
    { "type": "sessions", "session_ids": ["sess_019e7a1b2c3d4e5f6a7b8c9d0e1f2a3b"] }
  ],
  "outputs": [],
  "model": { "id": "dfmodel", "effort": "high", "context_window": 400000 },
  "instructions": "Focus on user preferences for code style",
  "session_id": null,
  "usage": { "input_tokens": 0, "output_tokens": 0, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0 },
  "error": null,
  "created_at": "2026-06-15T10:00:00Z",
  "ended_at": null,
  "archived_at": null
}

Errors

HTTPTypeTrigger
400invalid_request_errorEmpty or invalid inputs, missing or duplicate memory_store input, missing or inaccessible source Store, more than 100 Session IDs in total, unavailable or disabled model, invalid model option types/combinations or unknown fields, instructions exceeding 4096 UTF-8 bytes
401authentication_errorMissing or invalid authentication token
409conflict_errorThe current identity already has an active Dream (pending or running) in this workspace
See Error Reference for the full error envelope.