The Problem: Your AI Has No Visual Memory
Ask ChatGPT to design a button and it gives you #3b82f6. Ask again an hour later, you get #2563eb. Different conversation, different output, same brand breaking apart in real time.
This isn't a model capability issue. It's a data problem. AI systems have no persistent visual memory of your brand — they start every conversation from zero. Without structured design context, each generation is a dice roll against your brand guidelines.
The solution is design tokens: structured, machine-readable representations of your design system. Colors, typography, spacing, voice — all in a format any AI can consume at generation time.
What Are Design Tokens?
Design tokens are the atomic units of a design system. They're not Figma files or Notion docs — they're JSON variables your entire stack can share:
Beyond colors, tokens cover:
- Typography — heading font, body font, mono font, sizes, weights
- Spacing — base unit, component padding, section margins
- Border radius — buttons, cards, inputs, modals
- Brand voice — tone, prohibited phrases, formality level
- Component patterns — CTA style, error states, empty states
Tokens give every AI tool in your stack the same visual grammar. Different LLMs, same brand output.
The Design Token API: Your Brand as an Endpoint
BrandAPI exposes your design tokens as a structured JSON endpoint. Register your brand once, and every AI tool fetches the same tokens from the same source:
GET https://brandapi-ogk6.polsia.app/v1/brand/tokens Authorization: Bearer YOUR_API_KEY
The response is a complete token set your AI integration reads before generating anything:
{
\"colors\": {
\"primary\": \"#7c3aed\",
\"accent\": \"#a78bfa\",
\"background\": \"#0a0a0c\",
\"surface\": \"#111115\",
\"border\": \"#27272e\",
\"text\": \"#e4e4e7\",
\"textMuted\": \"#71717a\"
},
\"typography\": {
\"heading\": \"Space Grotesk, 700\",
\"body\": \"Space Grotesk, 400\",
\"mono\": \"DM Mono, 400\"
},
\"spacing\": {
\"baseUnit\": 4,
\"sm\": 8, \"md\": 16, \"lg\": 24, \"xl\": 40
},
\"borderRadius\": {
\"button\": \"8px\", \"card\": \"10px\", \"input\": \"6px\"
},
\"brand\": {
\"name\": \"Acme Corp\",
\"voice\": \"Direct. Technical. Human. No jargon.\",
\"avoidPhrases\": [\"synergy\", \"leverage\", \"best-in-class\"]
}
}
Wiring Tokens to AI Models
ChatGPT / OpenAI
// Fetch tokens once, inject into system prompt const fetchTokens = async (apiKey) => { const res = await fetch('https://brandapi-ogk6.polsia.app/v1/brand/tokens', { headers: { Authorization: `Bearer ${apiKey}` } }); return res.json(); }; const tokens = await fetchTokens(process.env.BRANDAPI_KEY); const completion = await openai.chat.completions.create({ model: 'gpt-4o', messages: [{ role: 'system', content: `Before generating anything, read these tokens: Colors: ${JSON.stringify(tokens.colors, null, 2)} Typography: ${JSON.stringify(tokens.typography, null, 2)} Voice: ${tokens.brand.voice} Use primary color ${tokens.colors.primary} for main actions. Never use: ${tokens.brand.avoidPhrases.join(', ')}` }, { role: 'user', content: 'Write a 3-line product update announcement.' }] });
Claude / Anthropic
const tokens = await fetchTokens(process.env.BRANDAPI_KEY); const response = await anthropic.messages.create({ model: 'claude-sonnet-4-5', system: `Design tokens — apply to all output: ${JSON.stringify(tokens, null, 2)} CSS color variable syntax: var(--color-name). Match token names exactly.`, messages: [{ role: 'user', content: 'Generate a pricing table component in React using the tokens above.' }] });
GitHub Copilot (CLI)
# Store brand tokens in a config file, reference in prompt curl -s -H \"Authorization: Bearer $BRANDAPI_KEY\" \\ https://brandapi-ogk6.polsia.app/v1/brand/tokens \\ > .brand-tokens.json # Copilot uses the file — reference it in your inline prompt: gh copilot suggest \"Write a TypeScript function that applies brand colors from .brand-tokens.json to a styled button component\" # Or in VS Code: prefix prompts with a token context comment // Brand tokens: primary=#7c3aed, accent=#a78bfa, bg=#0a0a0c // Generate a landing page hero section using these tokens
Without vs. With Design Tokens
The difference is immediate and measurable:
Color: #4A90E2 (random blue)
Font: system-ui default
Radius: 4px (CSS default)
Color: #7c3aed (brand primary)
Font: Space Grotesk, 700
Radius: 8px (brand button radius)
The token-guided output is shorter, uses the right voice, applies the brand's primary color, and matches the component radius. The generic output is verbose, uses banned phrases, and generates a random color that doesn't exist in the brand.
Making Tokens Work at Scale
A few patterns to avoid common pitfalls:
- Cache tokens — fetch once per job, not per generation. A 5-minute in-memory cache means one API call per batch of outputs, not one per message.
- Version your token schema — when your brand updates, update tokens in BrandAPI and every AI integration picks up the change automatically. No codebase edits needed.
- Use the voice token in system prompts — the voice string is the highest-leverage token. It controls tone, vocabulary, and formality across every AI-generated asset.
- Add avoidPhrases to every prompt — the banned phrase list is the cheapest brand safety feature you can add. No more \"synergy\" in your product copy.
BrandAPI is free to start. Register your brand, grab your API key, and wire your first AI integration in under 15 minutes. Tokens are JSON — any language with an HTTP client works.
Make every AI output on-brand automatically.
Register your brand and get design tokens as a live API endpoint — ready to wire into any AI tool in your stack.