---
title: "Save Model Draft"
method: PUT
path: "/v1/models/{model}/draft"
tags: ["Models"]
---

# Save Model Draft

`PUT /v1/models/{model}/draft`

## Request

- Base URL: `https://api.ensemble.markets` (the document declares no server; this is the origin it was published from)
- URL: `https://api.ensemble.markets/v1/models/{model}/draft`
- Auth: HTTP bearer

Autosave changes without affecting current results. expected_version and base_hash protect concurrent edits; reset starts over from approved source. Free.

## Path parameters

- `model` string, required: Owned model ID, slug, symbol or exact name

## Request body

- DraftUpdate
  - `expected_version` integer, required: Optimistic lock. Use zero for a new working draft.
  - `base_hash` string, required: Strategy fingerprint returned with the draft; detects intervening changes.
  - `prompt` string, nullable: Plain-language strategy instructions for the working draft
  - `description` string, nullable: Short explanation of the model's purpose, published only on apply
  - `inputs` object, nullable: Candidate input values, validated against the draft's input schema
  - `script` string, nullable: Optional supplied candidate source. Null uses the stored source or generates from changed instructions.
  - `effort` 'min' | 'mid' | 'max', nullable: Candidate generation effort; balanced (mid) by default
  - `from_run_id` string, nullable: Explicitly start from an owned historical result with recoverable source and inputs.
  - `reset` boolean: Replace the draft with the current approved strategy, subject to expected_version.

## Response `200`

Successful Response

- ModelDraftView
  - `model_id` string, required
  - `version` integer, required
  - `base_revision_id` string, nullable
  - `base_hash` string, required
  - `prompt` string, required
  - `description` string
  - `inputs` object, required
  - `inputs_schema` object, nullable
  - `effort` 'min' | 'mid' | 'max'
  - `latest_revision_id` string, nullable
  - `updated_at` string, date-time, nullable
  - `outdated` boolean

## Other responses

- `4XX`: The request was refused; `error.type` says why
- `5XX`: The server failed; quote `X-Request-Id` when reporting it

---

[API](https://skmtc.dev/ensemble/apis/ensemble-api.md) · [All operations](https://skmtc.dev/ensemble/apis/ensemble-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ensemble/apis/ensemble-api/revisions/4c0fbd80c197?raw)
