API
Lock one visual style and its palette, then let your scripts, CI jobs and AI agents generate the on-style asset system — app icons, favicons, og-images, empty states, per-screen illustrations. One key, one URL, and every image is checked against the locked style before you get it, the same guarantee the app gives you.
1. Get a key
In the app, open Settings → API keys and generate one. The key is shown once; copy it then. It starts with sl_ and covers your account's projects. Revoke it any time from the same screen.
Send the key on every request in an Authorization: Bearer header.
2. Connect an AI agent
Agents that speak MCP — Claude Code, Cursor, Claude Desktop and others — connect to one URL with the key and get Stylelock as tools. Nothing to install.
Claude Code, one command:
claude mcp add --transport http stylelock https://app.stylelock.dev/api/mcp \
--header "Authorization: Bearer sl_your_key"
Cursor, Claude Desktop and most others take the same thing as a config entry:
{
"mcpServers": {
"stylelock": {
"url": "https://app.stylelock.dev/api/mcp",
"headers": { "Authorization": "Bearer sl_your_key" }
}
}
}
Claude Desktop, claude.ai and ChatGPT take no key at all: add a custom connector with the URL https://app.stylelock.dev/api/mcp, sign in to Stylelock when asked, and approve. That approval creates a key named after the app under Settings → API keys; revoke it there to disconnect.
3. The tools
The connector's own instructions teach the assistant the routine, so you do not have to. In order:
- Explore, then lock.
explore_styleturns a brief into three candidate looks as images, each checked by a vision model;lock_stylemakes the one you choose the project's style reference.list_stylesshows the curated catalogue to start from. - Colours.
suggest_palettederives accent, secondary and background colours from the product description or its CSS tokens, with reasons;lock_palettewrites the palette to the project and says where it came from. - Plan, then generate.
plan_asset_packproposes the exact assets a set of screens and spots needs;generate_assetsrenders the ones you select on the locked style and checks each;edit_asset(background, crop, resize) andvectorize_asset(SVG) refine them;export_packanswers a repo-ready pack — AppIcon.appiconset, Android mipmaps, favicons, og-image, manifest. - Around it.
create_project(a project per product, made by the agent itself),list_projects,list_assets,get_asset, andproject_setup, which writes the project file below and a stable AGENTS.md block.
Money. Exploring and generating are the paid steps; everything else is free. Each paid tool states its price in its own description, the first style explore on an account is free, and every paid result states the exact charge — so an agent can try, look, and try again, and it is told never to spend without you agreeing. Pass the same idempotencyKey on a retry and the same answer comes back, with nothing charged twice. When the balance is empty the call answers 402 and nothing is rendered; top up in the app under Credits.
4. Working inside a project
A project that uses Stylelock keeps .stylelock/stylelock.json, committed to the repo. It holds ids and what was locked — never a key:
{
"version": 1,
"family": { "version": 1 },
"account": "app.stylelock.dev",
"project": { "id": "…", "name": "Acme" },
"palette": { "accent": "#2563EB", "secondary": "#0EA5E9", "bg": "#F8FAFC", "source": "stylelock" },
"style": { "id": "…", "name": "flat-minimal", "source": "stylelock" }
}
- Opening a project: the assistant reads the file and continues with the locked style and palette — no re-exploring, no drift.
- No file yet: it lists what the account has, creates a project with
create_projectwhen there is none, or proposes an explore;project_setupwrites the file once something is locked and hands the assistant a short block for your AGENTS.md — appended to the file you already have, never replacing it; nothing to download. - One brand across our tools: if the project also carries a Mascotline or Layoutline file, the assistant hands it in with the call (
siblings) and every picture takes the colours already locked for the brand; the result says where they came from. Where a sister tool would help, the result suggests it, with its price.
When a call is refused
401 — no key, or a key we do not recognise
Check the header. A revoked or banned key answers 403.
404 — the project is not yours
Pass a project id from .stylelock/stylelock.json or list_projects.
400 — the brief names the artifact, not the artwork
Describe what should be drawn ("a running shoe mid-stride"), not "an app icon" or "a logo"; the result names the word to change.
409 — the style is already locked
A project locks one style. Create another project for a second look.
402 — out of credits
Top up under Credits and retry with the same idempotencyKey.
429 — this key is over its calls per minute
Wait the seconds given in Retry-After, then send the same request again.
What's new for agents
- 1.1.0 — 2026-09-22.
create_project: an agent on an account with no project creates one itself and goes straight to exploring — nothing to do in the web app first. - 1.0.0 — 2026-09-22. The Stylelock connector: explore and lock a style and a palette, plan, generate, edit, vectorize and export an asset pack;
project_setupwrites.stylelock/stylelock.json; sibling files are read on the server so every product of ours draws in one brand.