Skip to main content
POST

Headers

string
required
Bearer f13_sk_live_… - see Authentication.
string
required
application/json
string
Optional retry-safety key, 1–255 characters. The key is bound to the body it is first used with; reusing it with a different body is rejected with 422. See Idempotency.

Body

string
Description of the graphic to generate. Maximum 2,000 characters. Required unless images is sent: on illustration endpoints a single image without a prompt is drawn on its own (its main subject becomes the illustration). Models that need a prompt refuse an image-only request with 422.
string
The model to run this request on: an id from GET /v1/models. Omit it to use the workspace’s default model. A model the workspace cannot use is refused with 403 (model_unavailable) before charging; nothing falls back to another model. Each model’s capabilities say which of the fields below it takes.
string
default:"vector"
vector returns the editable SVG without the final photo-rendering pass, billed at the workspace’s image price. image also requests the final rendered image alongside its vector geometry and is billed at the workspace’s photo price (photoPriceCents in GET /v1/usage); if that image cannot be produced or kept, the request fails and its charge is refunded. Workspaces with a vector-only renderer reject image before charging, and a model that takes freeform draws an image for its freeform drawings only. Reusing an idempotency key with a different output is rejected.
string
default:"fill"
How the vector is painted on illustration endpoints: fill draws filled regions with white seams between the parts, outline draws coloured outlines. Sending only outline_fill keeps outline. With output: "image" the photo is drawn over the same stencil. Workspaces with a vector-only renderer reject this field before charging.
boolean
Fill the regions under outline lines. Defaults to true when paint_mode is outline; false leaves bare outlines. Sending true with paint_mode: "fill" is rejected with 400.
string
The color the drawing’s accent is drawn in, as #rrggbb (case does not matter), for example "#ffcf22". Omit it to use the model’s own accent. Only models whose capabilities.accent is true in GET /v1/models take it; the others refuse it with 400 (unsupported_input) before charging. A value that is not a #rrggbb color is rejected with 400.
boolean | string
Takes one of two forms, depending on the model:
  • true or false, on illustration models (capabilities.drawingOptions in GET /v1/models): whether to retrieve visual grounding. false uses the prompt-only vector pipeline.
  • "off", "on" or "auto", on models whose capabilities.grounding is true: on looks up real figures on the web before drawing (for example the numbers on a chart), auto lets the model decide, and off draws from the prompt alone.
Omit it to use the model’s own default. A model refuses the form it does not take with 400 (unsupported_input) before charging. Any other value is rejected with 400.
string
The language the drawing’s words are written in, as a BCP 47 tag such as "fr", "pt-BR" or "sr-Latn" (case does not matter; _ works as -). Omit it for the model’s own default, English. Only models whose capabilities.language is true in GET /v1/models take it; the others refuse it with 400 (unsupported_input) before charging. A value that is not shaped like a language tag is rejected with 400.Each model keeps its own list of languages. A well-formed tag the model does not draw in ends the stream with an error frame, code unsupported_input, whose message names the languages it takes, for example Unsupported language "sw". Supported: en, fr, de, …. You are not charged.
boolean
default:"false"
Turns on freeform drawings. With true, a model that takes it may answer a request for a picture of one real thing (an animal, an object, a landmark) with a drawing traced from a photo of it, as well as what it draws anyway. The model decides per request: a request it reads as one of its usual drawings is drawn as before. A freeform drawing takes longer than the model’s other drawings.Only models whose capabilities.freeform is true in GET /v1/models take it; the others refuse true with 400 (unsupported_input) before charging. Omitting it and sending false are the same request.On such a model output: "image" needs freeform: true (without it the request is refused with 400 before charging) and returns the photo the drawing was traced from, framed on the SVG. A request the model draws as anything other than a freeform drawing has no photo: the stream ends with an error frame, code unsupported_request, and you are not charged. Send it again with output: "vector".
boolean
default:"false"
Names a freeform drawing’s parts beside it, each on a leader line to a dot on its part, like a textbook figure (“neck”, “tail”, “hoof” around a horse). The names are written in the request’s language, English without one. Only with freeform: true: without it the request is refused with 400 (unsupported_input) before charging.Ask for the thing and send the field: the prompt still decides what is drawn, and “a horse with its parts labelled” is read as a textbook diagram, not as a labelled horse. The names are the parts the model found in the drawing, not a list you choose, and they can differ between requests. A request the model draws as anything other than a freeform drawing is drawn as without the field.The labelled drawing is the SVG, in a frame of its own around the drawing and its names; with output: "image" the photo is framed to match. When no name can be placed the drawing comes without them. Labels add no charge. Omitting it and sending false are the same request.
object
How a diagram is presented and what question it poses: one JSON object, passed to the model as you send it. Only models whose capabilities.accent is true in GET /v1/models take it; the others refuse it with 400 (unsupported_input) before charging.A top-level field wins over the same setting in options: accent over options.style.accent. What the model made of the options comes back on the diagram frame.A saved style. A workspace can have one style saved for it, so that plain requests come back in its own look; ask us to set or change yours. The saved style is the starting point of every request, and the request’s own options.style goes over it field by field: a field you send wins, a field you send as null is left out of that request, and "style": null draws that request without the saved style. The style a figure was drawn with is on the diagram frame, in applied.style.The object can be at most 16,384 characters of JSON, nested at most 8 levels; a larger one, or a value that is not a JSON object, is rejected with 400. The model checks the contents: a key or a value it does not take ends the stream with an error frame, code unsupported_input, whose message names the field and what it takes. You are not charged.
string[]
Up to 4 reference images that give the model visual context for the prompt, as public HTTPS URLs or base64 data URLs (data:image/png;base64,…; png, jpeg, webp or non-animated gif). HTTPS URLs must use port 443, be at most 8,192 characters, and contain no embedded credentials or fragments. Signed query-string URLs work; images must be accessible without authorization headers. The model fetches the URL and applies its image limits. Inline data URLs are limited to 8MB of image data each; the request body is bounded at 48MB. Illustration endpoints take one image: the photo to draw, with or without a prompt. Sending more is refused with 422, and sending one with grounding: false with 400, both before charging.
For a hosted reference, keep the same API key and endpoint and send:
To generate multiple candidates for the same prompt, issue parallel requests (with distinct idempotency keys) - there is no n parameter.

Response

200 with Content-Type: text/event-stream. Each frame is a data: line holding one JSON object discriminated by type: Failures before the stream starts are JSON error responses - see Errors for the 400/401/402/409/422/429/503 shapes.

The asset object

Delivered on the saved frame.
string
Unique asset id (UUID), as listed by GET /v1/assets.
string
The prompt that produced this asset.
string
Hosted URL of the SVG. Empty string if the upload failed (the markup from the delta frames is still complete).
string | null
Hosted URL of a PNG copy of the image, when the workspace’s model returns one alongside the SVG. null otherwise, including when the PNG could not be stored (the SVG and the charge are unaffected).
string
private at creation. Sharing is managed from the dashboard.
string
Where the asset was created.
string
Opaque identifier of the model build that produced the asset. Informational only: the value changes as the model is updated and is not meant to be parsed or compared.
integer
Amount debited from the workspace credit balance, in cents.
integer
Generation time in milliseconds.
string
ISO 8601 creation timestamp.
object | null
{ "slug": string } when a public share link exists for this asset, otherwise null.

The diagram object

Delivered on the diagram frame, after the last delta, by models that describe their drawing. Every field is optional, and the model adds fields over time: ignore the ones you do not know. A label question with one blank:
The delta frames carry the question view: the cell with one name replaced by the marker 1. The diagram frame follows, with both views, the parts and the key: