Getting started
From API key to your first rendered design.
This guide takes you from a fresh account to a rendered, on-brand design in a few minutes. The API is plain JSON over HTTP with a bearer token, so it works from any language — examples below are in TypeScript, Python, and cURL.
1. Create an API key
Log in to your Rivermark API dashboard and open Settings → API keys. Click Generate key, give it a name (for example, production or staging), and copy the key.
Treat keys like passwords
API keys look like rmk_live_… and grant full access to your organization's API usage. Store it in a secret manager or environment variable — never in your source control.
Set it as an environment variable so the examples below work as-is:
export RIVERMARK_API_KEY="rmk_live_…"All requests go to https://api.rivermark.ai and carry the key as a bearer token:
Authorization: Bearer $RIVERMARK_API_KEY2. Create your first design
This request creates an Instagram post from scratch, with no brand references, and prints the rendered output URL.
const res = await fetch("https://api.rivermark.ai/design", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RIVERMARK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
task: "Create an Instagram post announcing a summer sale: 30% off everything, this weekend only. Vibrant, sunny, confident.",
output: [{ id: "post", size: "1080x1350" }],
}),
});
const design = await res.json();
console.log(design.design_id);
// rmd_cj4hbqz2w0003mz6x7p9q2xe
console.log(design.output[0].url);
// https://cdn.rivermark.ai/rmd_cj4hbqz2w0003mz6x7p9q2xe/k3f8qz1w/post.pngA successful response looks like this:
{
"design_id": "rmd_cj4hbqz2w0003mz6x7p9q2xe",
"output": [
{
"id": "post",
"url": "https://cdn.rivermark.ai/rmd_cj4hbqz2w0003mz6x7p9q2xe/k3f8qz1w/post.png",
"format": "png",
"width": 1080,
"height": 1350
}
],
"change_summary": "Created an Instagram post for the summer sale",
"change_description": "Built a full-bleed post with a sunny gradient, bold headline set in a geometric sans, and a sale badge in the lower third. Verified legibility and safe zones.",
"changes": [
{
"kind": "created",
"path": "frames/post.html",
"url": "https://cdn.rivermark.ai/rmd_cj4hbqz2w0003mz6x7p9q2xe/k3f8qz1w/source/post.html"
}
],
"cost": 0.10
}Open the output[0].url — that's your design, rendered exactly as it will appear.
3. Download the output
Rendered URLs are ephemeral
Designs are stored permanently, but the rendered image URLs returned by the API are temporary. Download what you want to keep — see Outputs.
import { writeFile } from "node:fs/promises";
const res = await fetch(design.output[0].url);
await writeFile("post.png", Buffer.from(await res.arrayBuffer()));4. Reuse or iterate on it (optional)
The design_id is persistent, and a design you've already made is the most useful reference you can give the next request. How you reuse it depends on what you want:
- As a template — pass it as a reference and ask for new content in its style: "Create a post from this template with the following copy: …" This is the basis of the user-created templates guide.
- As a style reference — pass it alongside other references and ask for something new that follows its look: "Create a story in the same style as this post."
- To iterate on it — pass it as
continue_fromto issue a follow-up request in the design's context. The original is effectively forked, and each turn returns a new design ID. This is how conversational editing works — see the AI design editor guide.
// Iterating: continue from the existing design
const next = await fetch("https://api.rivermark.ai/design", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RIVERMARK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
task: "Make the headline smaller and move the badge to the top right.",
continue_from: design.design_id,
}),
}).then((r) => r.json());
