Agents API

Remove design from your agent's critical path.

Most agent pipelines stall at visuals — you either hard-code templates or hand off to a human. One POST to Glittr returns a production-ready HTML/CSS design in under two seconds. No human. No template. No waiting.

5 free generations. No credit card required.

Your first design in under 60 seconds.

Three API calls. No SDK. No configuration. Your agent ships production-ready visuals from the first POST.

01

Create an API key

Sign in at useglittr.com and hit Generate Key. Takes 10 seconds. The key is scoped to your account and rate-limited so a rogue agent can't run up your bill.

02

Make your first request

POST a natural-language prompt to /api/v1/designs/generate. You get back a complete HTML/CSS design in under two seconds — id, html, and your current usage count.

03

Ship it — iterate or export

Render the HTML directly, refine it with a follow-up instruction, or POST it to /export and get back a PNG. Your agent never leaves the API.

Three endpoints. The full design pipeline.

Generate from a prompt, refine with instructions, export to PNG — all REST, all in one place. No browser, no design tool, no waiting on a human.

Step 01

Generate

POST a natural-language prompt. Receive a complete HTML/CSS design in under two seconds — no templates, no assembly.

generate
curl -X POST https://useglittr.com/api/v1/designs/generate \  -H "Authorization: Bearer glittr_sk_••••" \  -H "Content-Type: application/json" \  -d '{    "prompt": "Product launch banner, bold orange CTA",    "aspectRatio": "16:9"  }' # Response:# {#   "id": "clxyz1234...",#   "html": "<div class=\"glittr-design\">...</div>",#   "imageUrl": "https://s3.amazonaws.com/glittr/designs/...",#   "usage": { "count": 1, "limit": 5 }# }
200 OKGenerate complete · avg. 1.4s
Step 02

Iterate

Send a follow-up instruction with the design ID. The API refines in-place — resize, restyle, rewrite — without losing context.

iterate
curl -X POST https://useglittr.com/api/v1/designs/iterate \  -H "Authorization: Bearer glittr_sk_••••" \  -H "Content-Type: application/json" \  -d '{    "html": "<div class=\"glittr-design\">...</div>",    "instruction": "Make the headline larger and add a subtitle",    "designId": "clxyz1234..."  }' # Response:# {#   "html": "<div class=\"glittr-design\">...</div>",#   "imageUrl": "https://s3.amazonaws.com/glittr/designs/...",#   "versionId": "clxyz5678...",#   "usage": { "count": 1.5, "limit": 5 }# }
200 OKIterate complete · avg. 1.4s
Step 03

Export

POST the HTML with target dimensions. Get back a production PNG — 1920×1080, 1080×1080, any size. No headless browser to manage.

export
curl -X POST https://useglittr.com/api/v1/designs/export \  -H "Authorization: Bearer glittr_sk_••••" \  -H "Content-Type: application/json" \  -d '{    "html": "<div class=\"glittr-design\">...</div>",    "width": 1920,    "height": 1080  }' \  --output design.png # Response: PNG binary (image/png)# Content-Length: 245892
200 OKPNG exported · 245 KB

Drops into OpenAI Agents SDK, LangChain, CrewAI, and more.

No wrapper library to install. If your framework can POST JSON, it can generate professional designs. Wrap the endpoint in a tool function in under five minutes.

curl
curl -X POST https://useglittr.com/api/v1/designs/generate \  -H "Authorization: Bearer $GLITTR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "prompt": "Instagram story for a coffee shop grand opening",    "aspectRatio": "9:16"  }'
200 OKDesign generated · avg. 1.4s response

Zero SDKs

curl, Python requests, Node fetch — if it sends an HTTP POST, it works. Nothing to install.

REST-native

200, 429, 403 — standard HTTP status codes your agent already handles. JSON in, JSON out.

Per-agent keys

Issue one key per agent. Set hard caps so a runaway agent can't drain your generation quota.

Iterate in-flight

Pass the design ID and a new instruction. The API refines in-place — no regeneration from scratch, no lost context.

Everything you need. Nothing you don't.

Bearer token auth on every endpoint. JSON responses throughout — except /export, which returns a PNG binary.

POST/api/v1/designs/generate

Generate a new design from a natural-language prompt

Scope: design:generate

POST/api/v1/designs/iterate

Iterate, resize, restyle, or apply quick actions to a design

Scope: design:iterate

POST/api/v1/designs/rewrite

Rewrite or translate text content

Scope: design:rewrite

POST/api/v1/designs/export

Export design HTML to a PNG image

Scope: design:export

GET/api/v1/designs/:id

Retrieve a saved design and its version history

POST/api/v1/keys

Create a new API key (session auth)

GET/api/v1/keys

List your API keys (session auth)

DELETE/api/v1/keys/:id

Revoke an API key (session auth)

Answers before you have to ask.

Your agent ships designs today, not next sprint.

One endpoint. Under two seconds per design. Five free generations to prove it works before you commit to a plan.

Start building — get your API key

5 free generations. No credit card required.