RivermarkRivermark
Core concepts

Editing and continue_from

Designs are made to be edited — cheaply, repeatedly, conversationally.

Editing an existing design is a central mechanism of the Rivermark API, not an afterthought. It's how you implement quality-control loops on your side, and how you give your own users direct AI editing capabilities.

continue_from

Pass a design ID in continue_from to issue a follow-up request in that design's context:

A follow-up turn
{
  "task": "Make the headline smaller and move the badge to the top right.",
  "continue_from": "rmd_cj4hbqz2w0003mz6x7p9q2xe"
}

Semantics:

  • The original design is effectively forked — it remains untouched and accessible.
  • The new turn produces a new design ID of its own, returned in the response.
  • The agent sees the full history of the session, not just the latest frame, so edits compose naturally over many turns.
  • Edit requests are highly cost-effective — see Costs.

To maintain an editing session across many turns, keep passing the latest design ID in continue_from:

editing-session.ts
const create = (body: object) =>
  fetch("https://api.rivermark.ai/design", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.RIVERMARK_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify(body),
  }).then((r) => r.json());

let design = await create({ task: "Create a flyer for the event." });

design = await create({
  task: "Apply the user's requested changes. Do not change anything else.",
  user_prompt: "make it feel more like nighttime",
  continue_from: design.design_id,
});

design = await create({
  task: "Apply the user's requested changes. Do not change anything else.",
  user_prompt: "perfect. add the ticket link at the bottom",
  continue_from: design.design_id,
});

Every intermediate design remains addressable — a session is a chain of forks, and you can branch from any point (e.g. offer "undo" by returning to an earlier ID).

continue_from vs. passing a design as a reference

Both see the design, but they mean different things:

  • Reference (references: [{ type: "design", id }]) — "here's something to look at and work from." The agent may create new, related designs. Use for templates: "create a post from this template".
  • continue_from — "this is the design being worked on." The result is the next version of the same thing, with full session history. Use for iteration and refinement.

The user-created templates guide uses references; the AI design editor guide uses continue_from.

Forking on purpose

Because every turn forks, "give me two directions from here" is just two requests with the same continue_from:

Branch a session
[
  {
    "task": "Try a version with a dark background.",
    "continue_from": "rmd_cj4hbqz2w0003mz6x7p9q2xe"
  },
  {
    "task": "Try a version built around the photo reference.",
    "continue_from": "rmd_cj4hbqz2w0003mz6x7p9q2xe"
  }
]

On this page