Design Agent API

Send a brief in plain English and receive a finished set of design files.

Looking for the generation and conversion API? View API Reference v1

Quick Navigation

Overview

The Design Agent works differently from the rest of the SVGMaker API. Instead of one call producing one image, you describe what you need and the agent plans the work, draws it, lays it out and exports it. You get back a single download holding every file it produced.

Because real design work takes minutes rather than milliseconds, the API is asynchronous. Every request returns immediately with a session id, and you collect the result by watching a stream or receiving a webhook.

Base URL

https://agent.svgmaker.io

This is a different host from the rest of the API, which lives at api.svgmaker.io.

Quick start

bash

Authentication

Every request is authenticated with your API key in the x-api-key header. It is the same key you use for the rest of the SVGMaker API — create one in your account settings.

bash

Start a Design

One endpoint starts everything. Send a brief and the turn begins immediately; omit the brief and you get an empty session you can post to later.

POST/v1/sessions

Body fields

Send as multipart/form-data when attaching files, or JSON when not.

FieldTypeRequiredDescription
contentstringNoYour brief, in plain English. Omit it to create an idle session with no turn.
filesfileNoA reference file. Repeat the field for each one, up to 20 per request.
imagefileNoA reference image the agent should look at, up to 8. Images sent as files are picked up automatically, so this is rarely needed.
callback_urlstringNoAn HTTPS URL to receive the signed result when the turn finishes.
titlestringNoA label for the session, for your own reference.
← Scroll horizontally to see more →

Response (202)

json

The two URLs already carry a short-lived token, so they need no API key header. They expire, and every turn returns fresh ones.

Reference Files

Attach your own artwork and the agent designs around it — converting it, tracing it, resizing it, or matching its style in something new.

bash

Getting the Result

Three ways, all ending at the same download_url. Pick whichever fits your app.

1. Watch the stream

Server-Sent Events, one message per stage. Best when a person is waiting.

bash

2. Poll the events

Read stored events at your own pace. Pass ?afterSeq= to fetch only what is new.

GET/v1/sessions/{session_id}/events
bash

3. Receive a webhook

Nothing to watch and nothing to poll. See below.

Checking status on its own

If you only want to know whether a session is still working, read the session rather than its events.

GET/v1/sessions/{session_id}
json

Follow-Up Turns

Post to an existing session and the agent picks up where it left off, keeping everything it already made. Each turn is charged on its own.

POST/v1/sessions/{session_id}/events
bash

The response carries a fresh stream_url and poll_url for the new turn. You can attach files and callback_url here too.

Stopping a turn

Send type: "user.interrupt" to stop work in flight. The reply tells you whether there was anything running to stop.

bash

Deleting a session

Removes the session and everything it produced, including the agent's working files.

DELETE/v1/sessions/{session_id}

Webhooks

Add a callback_url to any request that starts a turn and the signed result is POSTed to your server when the work is done.

Setup

1

Generate a webhook secret in your account settings

2

Add callback_url when you start a turn

3

Verify the signature, then use the download_url

Delivery payload

json

On a failed turn success is false, status is error and there is no download.

Signature verification

Every delivery carries webhook-id, webhook-timestamp and webhook-signature headers. Verify against the raw request body, before any JSON parsing.

javascript

Worth knowing

callback_url must be HTTPS

A webhook secret is required, or nothing is delivered

Failed deliveries are retried a few times over about 95 seconds

A webhook covers one turn — send it again on each follow-up

Credits

Spending is usage based. A short job costs less than a long one, and every turn is capped, so a large brief can never run away with your balance.

Each completed event and webhook tells you what the turn cost and what is left:

json

If a turn fails

You are not charged for the turn, and anything already taken during it is returned automatically. Your balance is checked before a session is created, so a request you cannot afford is refused with 402 rather than starting and stopping.

Buy credits on the pricing page. The same pack works across the whole SVGMaker API.

Error Handling

Errors carry a code and a sentence written for the person who will read it. A turn that fails after it has started reports the same pair on an error event rather than an HTTP status.

json
CodeHTTPMeaning
UNAUTHORIZED401Invalid or missing API key
PAID_ACCOUNT_REQUIRED403The account has no credit pack
INSUFFICIENT_CREDITS402Balance too low to start a turn
NOT_FOUND404No such session, or not yours
INVALID_REQUEST400The request was not valid
PAYLOAD_TOO_LARGE413The uploaded files are too large
BUDGET_EXCEEDED400The design was too complex to finish in one turn
TURN_LIMIT400The design needed more steps than one turn allows
RATE_LIMIT_EXCEEDED429Too many requests
CREDIT_SERVICE_UNAVAILABLE503Credits temporarily unavailable, retry shortly
INTERNAL500Something went wrong on our side
← Scroll horizontally to see more →

Rate Limits

You can start 5 designs per minute per API key. Starting a new session and continuing an existing one share that budget, since both start a turn.

Going over returns 429 with a Retry-After header telling you how many seconds to wait.

Get started background

No credit card required