Visant Copilot API
Auth: Authorization: Bearer <jwt_token>
Token: POST /api/auth/login → { "email": "...", "password": "..." }
Visant Copilot API — REST API Reference
Version: 0.0.0
Auth: Authorization: Bearer <jwt_token>
POST /auth/signup
Sign up a new user
Create a new account with email and password
POST /auth/login
User login
Authenticate user and return JWT token
POST /auth/logout
User logout
User logout
GET /auth/profile
Get current user profile
Get current user profile
PUT /auth/profile
Update user profile
Update user profile
POST /auth/refresh
Refresh JWT token
Refresh JWT token
POST /auth/verify-email
Verify email address
Verify email address
GET /mockups
List mockups
List mockups
Parameters:
| name | in | type | description |
|---|---|---|---|
limit |
query | integer | - |
skip |
query | integer | - |
POST /mockups/generate
Generate mockup using AI
Generate product mockup from image using Gemini or Claude AI
GET /mockups/{id}
Get mockup by ID
Get mockup by ID
Parameters:
| name | in | type | description |
|---|---|---|---|
id |
path | string | - |
PUT /mockups/{id}
Update mockup
Update mockup
Parameters:
| name | in | type | description |
|---|---|---|---|
id |
path | string | - |
DELETE /mockups/{id}
Delete mockup
Delete mockup
Parameters:
| name | in | type | description |
|---|---|---|---|
id |
path | string | - |
GET /brand-guidelines/public/{slug}
Get public brand guideline
Returns full brand guideline data for a public slug. No authentication required.
Parameters:
| name | in | type | description |
|---|---|---|---|
slug |
path | string | Public slug of the brand guideline |
GET /brand-guidelines/public/{slug}/context
Get brand context for LLMs
Returns LLM-ready formatted brand context. Perfect for AI agents and MCP integrations. No authentication required.
Parameters:
| name | in | type | description |
|---|---|---|---|
slug |
path | string | Public slug of the brand guideline |
format |
query | string | Output format: full (default) or compact (optimized for image gen) |
output |
query | string | Response type: text (default) or json |
POST /ai/improve-prompt
Improve an image generation prompt
Refine and enhance a prompt to produce better AI image generation results.
POST /ai/generate-smart-prompt
Generate an optimized image prompt from structured inputs
Build a high-quality image generation prompt from design type, style tags, colors, and optional brand context.
POST /ai/suggest-prompt-variations
Generate variations of an existing prompt
Generate variations of an existing prompt
POST /ai/describe-image
Describe / extract prompt from an image
Analyze an image and return a detailed description suitable for use as a generation prompt.
POST /ai/extract-colors
Extract dominant color palette from an image
Analyze an image and return hex codes, color names, semantic roles (primary/accent/background/neutral), and frequency.
POST /ai/generate-naming
Generate brand or product name suggestions
Generate creative and memorable name suggestions from a brief. Optionally biased by a brand guideline.
POST /branding/generate-step
Generate a branding step (persona, archetype, SWOT, colors, moodboard, etc.)
Multi-step branding generation engine. Each step generates a specific brand asset using AI. Step values:
- 1: Market Research — benchmarking paragraph
- 5: Competitors — competitive landscape
- 6: References — visual design inspirations
- 7: SWOT — strengths/weaknesses/opportunities/threats
- 8: Color Palettes — AI color recommendations with hex codes
- 9: Visual Elements — icons, patterns, textures
- 10: Persona — audience persona (demographics, psychographics, pain points)
- 11: Concept Ideas — product mockup and usage scenarios
- 12: Moodboard — mood and aesthetic direction
- 13: Archetypes — brand archetype analysis (Hero, Sage, Lover, Caregiver, etc.)
POST /mockups/batch-generate
Generate multiple mockup images in parallel
Generate up to 20 mockup images in parallel from an array of prompts. All images share the same model and output settings.
POST /plugin
Execute plugin command
Send a command to the Figma plugin for processing
GET /plugin/docs
Get plugin documentation
Get plugin documentation
GET /plugin/mcp
Get MCP specification
Get MCP specification
MCP Tools Reference
Integrate Visant Labs directly into AI agents via the Model Context Protocol.
MCP Servers
| Server | Transport | Endpoint | Tools |
|---|---|---|---|
| Platform MCP | Streamable HTTP | /api/mcp |
19+ tools |
| Figma MCP | stdio | npm run mcp:figma |
9 (Figma node manipulation) |
Connect — Claude.ai / Claude Desktop
Settings → Connectors → Add → enter your /api/mcp URL → OAuth auto-flow.
Connect — Anthropic API
{ "mcp_servers": [{ "type": "url", "url": "<endpoint>/api/mcp", "name": "visant", "authorization_token": "visant_sk_xxx" }],
"tools": [{ "type": "mcp_toolset", "mcp_server_name": "visant" }] }
Connect — Claude Code CLI
claude mcp add --transport http visant <endpoint>/api/mcp
Authentication
- OAuth 2.1 (recommended): Automatic via DCR + PKCE S256 — zero config for Claude Connector
- API Key:
Authorization: Bearer visant_sk_xxx— create at Settings → API Keys
Scopes: read, write, generate.
Figma MCP — Tool Reference
message
Resposta em texto para o usuário. Use para explicar o que fez ou tirar dúvidas.
Parameters:
| name | type | required | description |
|---|---|---|---|
content |
string | yes | Conteúdo da mensagem |
Example input:
{
"type": "MESSAGE",
"content": "Criei o botão conforme solicitado."
}
get_design_context
Get rich design context for a Figma selection. Provides structured JSON with layout, typography, and color tokens.
Parameters:
| name | type | required | description |
|---|---|---|---|
fileId |
string | yes | Figma file ID |
nodeId |
string | no | Optional node ID. If omitted, gets selection. |
depth |
number | no | Depth of serialization (default: 5) |
Example input:
{
"fileId": "abc123def456"
}
search_design_system
Search for components, variables, and styles in your design system.
Parameters:
| name | type | required | description |
|---|---|---|---|
fileId |
string | yes | Figma file ID |
query |
string | yes | Search term (e.g., "button", "primary") |
Example input:
{
"fileId": "abc123def456",
"query": "button"
}
create_frame
Cria um frame container com auto-layout. Essencial para seções, telas e grupos organizados.
Parameters:
| name | type | required | description |
|---|---|---|---|
props |
object | yes | Propriedades do frame |
ref |
string | no | Referência opcional para uso posterior |
parentNodeId |
string | no | ID do pai (opcional) |
Example input:
{
"type": "CREATE_FRAME",
"ref": "header",
"props": {
"name": "Header",
"width": 1440,
"height": 80,
"layoutMode": "HORIZONTAL",
"itemSpacing": 20,
"primaryAxisAlignItems": "CENTER",
"counterAxisAlignItems": "CENTER"
}
}
create_component
Cria um componente mestre novo e reutilizável. Use para elementos que se repetem no design.
Parameters:
| name | type | required | description |
|---|---|---|---|
props |
object | yes | Propriedades do componente |
ref |
string | no | Referência (ex: "btnPrimary") |
Example input:
{
"type": "CREATE_COMPONENT",
"ref": "myButton",
"props": {
"name": "Button/Primary",
"width": 200,
"height": 48,
"layoutMode": "HORIZONTAL"
}
}
combine_as_variants
Combina múltiplos componentes (criados via ref) em um conjunto de variantes.
Parameters:
| name | type | required | description |
|---|---|---|---|
name |
string | yes | Nome do set de variantes |
componentRefs |
array | yes | Lista de Refs dos componentes |
ref |
string | no | Referência do set |
Example input:
{
"type": "COMBINE_AS_VARIANTS",
"name": "Button",
"componentRefs": [
"btn1",
"btn2"
],
"ref": "buttonSet"
}
create_svg
Cria vetores a partir de uma string SVG. Ideal para ícones e ilustrações personalizadas.
Parameters:
| name | type | required | description |
|---|---|---|---|
svgString |
string | yes | Código SVG inline |
name |
string | no | Nome do elemento |
width |
number | no | Largura final |
height |
number | no | Altura final |
ref |
string | no | Referência |
Example input:
{
"type": "CREATE_SVG",
"svgString": "<svg>...</svg>",
"name": "Icon/Check",
"width": 24,
"height": 24
}
set_image_fill
Preenche um nó com uma imagem a partir de uma URL (Unsplash, etc).
Parameters:
| name | type | required | description |
|---|---|---|---|
nodeId |
string | no | ID do nó |
ref |
string | no | Ou use a Referência de um nó criado |
imageUrl |
string | yes | URL da imagem |
scaleMode |
string | no | Modo de escala da imagem |
Example input:
{
"type": "SET_IMAGE_FILL",
"ref": "heroImage",
"imageUrl": "https://images.unsplash.com/photo-123",
"scaleMode": "FILL"
}
create_rectangle
Cria um retângulo, divisor ou fundo.
Parameters:
| name | type | required | description |
|---|---|---|---|
props |
object | yes | Propriedades do retângulo |
ref |
string | no | Ref |
parentRef |
string | no | Ref do pai |
Example input:
{
"type": "CREATE_RECTANGLE",
"parentRef": "header",
"props": {
"name": "Background",
"width": 300,
"height": 100,
"fills": [
{
"type": "SOLID",
"color": {
"r": 0.9,
"g": 0.9,
"b": 0.9
}
}
],
"cornerRadius": 8
}
}
create_text
Cria um elemento de texto.
Parameters:
| name | type | required | description |
|---|---|---|---|
props |
object | yes | Propriedades do texto |
parentRef |
string | no | Ref do pai |
Example input:
{
"type": "CREATE_TEXT",
"parentRef": "header",
"props": {
"name": "Title",
"content": "Hello World",
"fontSize": 24,
"fontFamily": "Inter",
"fontStyle": "Bold",
"fills": [
{
"type": "SOLID",
"color": {
"r": 0.1,
"g": 0.1,
"b": 0.1
}
}
]
}
}
rename
Renomeia um nó existente.
Parameters:
| name | type | required | description |
|---|---|---|---|
nodeId |
string | yes | ID do nó |
name |
string | yes | Novo nome |
Example input:
{
"type": "RENAME",
"nodeId": "1:2",
"name": "New Name"
}
delete_node
Remove um nó do design.
Parameters:
| name | type | required | description |
|---|---|---|---|
nodeId |
string | yes | ID do nó |
Example input:
{
"type": "DELETE_NODE",
"nodeId": "1:2"
}
create_component_instance
Instancia um componente existente da biblioteca.
Parameters:
| name | type | required | description |
|---|---|---|---|
componentKey |
string | yes | Chave do componente mestre |
name |
string | no | Nome da instância |
parentNodeId |
string | no | ID do pai |
Example input:
{
"type": "CREATE_COMPONENT_INSTANCE",
"componentKey": "abc-123",
"name": "Primary Button"
}
create_color_variables_from_selection
Extrai as cores dos fills da seleção atual e cria variáveis de cor no library do Figma, usando o nome de cada camada como nome da variável. Batch: processa todos os elementos selecionados de uma vez.
Parameters:
| name | type | required | description |
|---|---|---|---|
collectionName |
string | no | Nome da coleção de variáveis (padrão: "Colors") |
Example input:
{
"type": "CREATE_COLOR_VARIABLES_FROM_SELECTION",
"collectionName": "Brand Colors"
}
bind_nearest_color_variables
Percorre nós recursivamente e vincula cada fill/stroke hardcoded à variável de cor mais próxima por distância RGB. Substitui cores hardcoded por tokens do design system.
Parameters:
| name | type | required | description |
|---|---|---|---|
threshold |
number | no | Distância máxima para match (0-1, padrão: 0.05) |
scope |
string | no | Escopo (padrão: selection) |
collectionName |
string | no | Filtrar por coleção de variáveis |
Example input:
{
"type": "BIND_NEAREST_COLOR_VARIABLES",
"threshold": 0.05,
"scope": "selection"
}
request_scan
Solicita scan da página inteira quando os elementos mencionados pelo usuário não estão na seleção atual. O sistema re-envia o comando com contexto completo automaticamente.
Parameters:
| name | type | required | description |
|---|---|---|---|
reason |
string | no | Motivo do scan |
Example input:
{
"type": "REQUEST_SCAN",
"reason": "Frame mencionado não encontrado na seleção"
}
group_nodes
Agrupa múltiplos nós em um novo grupo.
Parameters:
| name | type | required | description |
|---|---|---|---|
nodeIds |
array | yes | Lista de IDs |
name |
string | yes | Nome do grupo |
Example input:
{
"type": "GROUP_NODES",
"nodeIds": [
"1:2",
"1:3"
],
"name": "Login Form"
}
set_text_style
Altera propriedades de estilo de um texto SEM mudar o conteúdo. Use para fontSize, fontFamily, textAutoResize, etc.
Parameters:
| name | type | required | description |
|---|---|---|---|
nodeId |
string | yes | ID do nó de texto |
fontSize |
number | no | Tamanho da fonte |
fontFamily |
string | no | Família da fonte |
fontStyle |
string | no | Estilo (Regular, Bold, etc) |
textAutoResize |
string | no | Como o texto redimensiona |
textAlignHorizontal |
string | no | Alinhamento horizontal |
textAlignVertical |
string | no | Alinhamento vertical |
lineHeight |
object | no | { value: number, unit: "PIXELS" |
letterSpacing |
object | no | { value: number, unit: "PIXELS" |
fills |
array | no | Array de fills para cor do texto |
Example input:
{
"type": "SET_TEXT_STYLE",
"nodeId": "1:234",
"textAutoResize": "HEIGHT",
"fontSize": 24
}
export_frames_data
Exporta os DADOS/TEXTOS dos frames como ARQUIVO para download (json, markdown, html ou csv). Use SEMPRE que o usuário pedir para baixar/exportar/gerar um arquivo ou planilha com o conteúdo dos frames (ex: "me dá um json com todos os orçamentos"). É determinístico: lê TODOS os frames do escopo (sem limite), por isso é melhor que escrever o conteúdo num MESSAGE. Passe scope:"page" para exportar a página inteira, ou scope:"selection" para os frames selecionados. Use fields para montar colunas estruturadas (ex: ["cliente","valor","categoria"]) — o sistema casa cada label:valor por heurística e sempre inclui o texto bruto.
Parameters:
| name | type | required | description |
|---|---|---|---|
format |
string | no | Formato do arquivo (padrão: json) |
scope |
string | no | selection = frames selecionados; page = página inteira (padrão: selection) |
fields |
array | no | Campos para extração estruturada (ex: cliente, valor, categoria) |
title |
string | no | Título/base do nome do arquivo |
Example input:
{
"type": "EXPORT_FRAMES_DATA",
"format": "json",
"scope": "page",
"fields": [
"cliente",
"valor",
"categoria"
],
"title": "Orçamentos"
}
AI Agent Integration Guide
Visant Labs provides three main ways for AI agents to interact with the platform: Discovery, MCP Tools, and REST API.
Discovery (LLM Discovery)
https://api.visantlabs.com/llms.txt— Concise platform overviewhttps://api.visantlabs.com/llms-full.txt— Complete MCP referencehttps://api.visantlabs.com/api/docs/api/spec— OpenAPI JSON Spec
Authentication
Two methods: OAuth 2.1 (recommended for AI agents) or API Key (for scripts).
OAuth 2.1 (recommended)
- Register:
POST /oauth/registerwith{client_name, redirect_uris, grant_types: ["authorization_code"]} - PKCE: generate
code_verifier→code_challenge= base64url(sha256(verifier)) - Authorize: open
/oauth/authorize?client_id=...&redirect_uri=...&code_challenge=...&code_challenge_method=S256&state=...&response_type=code&scope=read+write+generatein user's browser - Exchange:
POST /oauth/tokenwithgrant_type=authorization_code&code=...&code_verifier=...&client_id=... - Refresh:
POST /oauth/tokenwithgrant_type=refresh_token&refresh_token=...
Discovery: GET /.well-known/oauth-authorization-server · Scopes: read, write, generate
API Key (manual)
- Create in Settings → API Keys →
Authorization: Bearer visant_sk_xxx
MCP Connection
Transport: Streamable HTTP (stateless)
Endpoint: /api/mcp
Discovery: /.well-known/mcp.json
Claude.ai / Claude Desktop
Settings → Connectors → Add → enter /api/mcp URL → OAuth auto-flow
Anthropic API (MCP Connector)
{ "mcp_servers": [{ "type": "url", "url": "<your-endpoint>/api/mcp", "name": "visant" }],
"tools": [{ "type": "mcp_toolset", "mcp_server_name": "visant" }] }
Beta header: anthropic-beta: mcp-client-2025-11-20
Claude Code CLI
claude mcp add --transport http visant <your-endpoint>/api/mcp
Available MCP Tools (132 total)
| Tool | Description | Cost |
|---|---|---|
account-profile |
Get the authenticated user profile including name, email, avatar, and subscription plan. | free |
account-usage |
Get credit usage, remaining balance, plan limits, storage quota (used/limit/remaining), and billing cycle info for the authenticated account. | free |
ai-apply-theme |
Apply visual themes to an existing mockup (e.g. "christmas", "cyberpunk", "minimalist"). Costs credits. | credits |
ai-change-object |
Replace or modify an object in an existing mockup image. Costs credits. Pass the image and describe what to change. | credits |
ai-describe-image |
Analyze an image and return a detailed text description. Provide either a URL or base64-encoded data. Free, no credit cost. | free |
ai-extract-colors |
Extract a color palette from any image. Returns hex values, names, roles, and frequency. Free (no credits). | free |
ai-generate-image |
Generate an image from a text prompt. No brand injection, no project saving — just prompt → image. For placing existing designs in scenes, use mockup-generate instead. Costs credits. | credits |
ai-generate-naming |
Generate brand/product name ideas from a brief. Optionally uses brand guideline for tone consistency. Costs credits. | credits |
ai-improve-prompt |
Enhance and refine a text prompt using AI to produce better generation results. Free, no credit cost. | credits |
ai-suggest-prompt-variations |
Generate multiple creative variations of a prompt. Free (cached). Use to give users options before spending credits on generation. | credits |
api-key-create |
Create a new Visant API key (visant_sk_xxx). Requires either an active API key (Bearer token) OR a JWT from auth-login/auth-register. The raw key is shown only once — save it immediately. | free |
api-key-list |
List all API keys for the authenticated user. Shows prefix, name, scopes, last used, and expiry — but not the raw key value. | free |
auth-login |
Sign in to an existing Visant Labs account. Returns a JWT token. Use api-key-create (passing this token) to generate a visant_sk_xxx API key for persistent MCP/API access. | free |
auth-register |
Create a new Visant Labs account. Returns a JWT token and user info. After registering, use api-key-create (passing the JWT) to generate a visant_sk_xxx API key for MCP/API access. | free |
brand-guidelines-compare-versions |
Compare two versions of a brand guideline to see what changed (colors added, typography modified, strategy updated, etc.). | free |
brand-guidelines-compile |
Compile a brand guideline into design tokens — returns four ready-to-use files: CSS custom properties, a Tailwind theme extension, React/TS tokens, and SCSS variables. Use for design-to-code workflows. | free |
brand-guidelines-compliance-check |
Validate a brand's color palette for WCAG contrast and internal consistency. Returns a scored report with violations. (For strategy ↔ visual ↔ voice coherence, use brand-guidelines-health-check instead.) | free |
brand-guidelines-create |
Create a new brand guideline. Provide at minimum an identity.name. All other sections (colors, typography, guidelines, strategy, tokens) are optional and can be added now or via brand-guidelines-update later. | free |
brand-guidelines-delete |
Permanently delete a brand guideline. This cannot be undone. Confirm with the user before calling. | free |
brand-guidelines-delete-logo |
Delete a logo from a brand guideline by its logo ID. | free |
brand-guidelines-delete-media |
Delete a media asset from a brand guideline by its media ID. | free |
brand-guidelines-duplicate |
Duplicate a brand guideline, creating an independent copy with "(copy)" appended to the name. Useful for creating variants or testing changes without affecting the original. | free |
brand-guidelines-export |
Export a brand guideline as a portable JSON document for backup or migration — internal fields (ownership, view counts, sync state) are stripped. For working with a brand in-session, prefer brand-guidelines-get (supports section filtering and prompt format). | free |
brand-guidelines-figma-link |
Link or unlink a Figma file to a brand guideline. Once linked, figma-sync can pull design tokens automatically. | free |
brand-guidelines-figma-preview |
Dry-run for brand-guidelines-figma-sync: reports what the linked Figma file actually contains (color variables, text styles, components) and recommends which import path pays — "variables" when the file has a real token system, "text" when it does not (e.g. variables named after their own hex values). Reads only; changes nothing. | free |
brand-guidelines-figma-sync |
Sync brand guideline with a Figma file. Imports colors, typography, and design tokens from Figma VARIABLES and styles. Call brand-guidelines-figma-preview FIRST: most real files have no variable system, and on those this sync imports almost nothing — the preview says which path actually pays before you spend the call. Requires Figma token configured in user settings. | free |
brand-guidelines-get |
Get a brand guideline by ID. Use "sections" to fetch only what you need (e.g. ["colors","typography"] for visual tasks). Presets: "visual" (colors/typo/tokens), "copy" (voice/strategy), "minimal" (identity/colors/typo), "imageGen", "full". Omit sections for full context. | free |
brand-guidelines-health-check |
Audit a brand guideline for completeness. Returns which sections are filled, which are missing, and suggestions for improvement. | free |
brand-guidelines-ingest |
Extract brand data (colors, typography, voice, strategy) from a URL or raw text and MERGE it into an existing brand guideline. Useful for bootstrapping a guideline from a website, landing page, or brand document. Returns the extracted values. Pass preview=true to see what would be extracted WITHOUT saving (dry run), then re-run without preview to commit. | free |
brand-guidelines-invite |
Create an invite link for a brand guideline. The recipient gets a connect page where they can accept the invite, associate the brand to their account, and get one-click deep links to connect their AI tool (Cursor, VS Code, Claude, ChatGPT). Perfect for onboarding clients. | free |
brand-guidelines-knowledge-list |
List all knowledge documents (PDFs, brand docs) attached to a brand guideline. | free |
brand-guidelines-list |
List brand guidelines (identity vaults) owned by the authenticated user. Supports pagination and name search — use "search" to find a brand by name instead of listing every one. | free |
brand-guidelines-logo-rules |
Derive logo usage rules from the logo file itself: clear space, minimum reproduction size (screen + print), and which brand colors it may sit on (WCAG contrast). Deterministic measurement, not an AI guess. Runs automatically on upload — call this to backfill an older logo or to switch the clear-space module. | free |
brand-guidelines-media-commit |
Register assets already uploaded via brand-guidelines-media-upload-urls into the brand media kit. Fingerprints each file server-side, so duplicates (including files already present as logos) are reported and skipped. Returns added, duplicates, failed and the new completeness score. | free |
brand-guidelines-media-upload-urls |
Mint direct-to-storage upload URLs for a batch of local files (max 50). Returns one presignedUrl per file; PUT each file to its URL (e.g. curl -X PUT --data-binary @file -H "Content-Type: |
free |
brand-guidelines-public |
Get a public brand guideline by its slug. No authentication required. | free |
brand-guidelines-restore-version |
Restore a brand guideline to a previous version. The current state is preserved as a version before restoring. | free |
brand-guidelines-share |
Generate a public read-only link for a brand guideline. Once shared, anyone with the link can view colors, typography, logos, and brand strategy — without authentication. Returns the public URL. | free |
brand-guidelines-update |
Patch one or more sections of an existing brand guideline. Only the fields you provide are updated — others remain unchanged. Use this to iteratively build or refine a guideline section by section. | free |
brand-guidelines-upload-logo |
Upload a logo to a brand guideline. Accepts base64-encoded image data or a public URL. Returns the uploaded logo with its URL and ID. | free |
brand-guidelines-upload-media |
Upload ONE media asset (image or PDF) to a brand guideline media kit, as base64 data or a public URL. For more than 2 files, or files above ~500 KB, use brand-guidelines-media-upload-urls instead — base64 puts the whole file through the conversation. | free |
brand-guidelines-versions |
List the version history of a brand guideline — shows what changed and when. Useful for auditing edits or restoring a previous state. Returns versions in reverse chronological order. | free |
brand-render-preset |
Render a web preset to a PNG image on the brand — fully headless, no Figma. The server resolves colors, fonts, and REAL assets (logo by contrast, photo by semantic relevance), optionally applies a Visant image effect (halftone/riso/texture) to the photo, and returns a ready image URL. You supply only the template id, the text content, and an optional brief. This is the CLIENT/web path (vs figma-preset-fill, which targets the Figma plugin). | free |
branding-delete |
Permanently delete a branding project by ID. Cannot be undone — confirm with the user first. | free |
branding-generate |
Generate brand identity elements from a text prompt. Use step="full" for complete generation or target a specific step for iterative refinement. Costs credits. | credits |
branding-get |
Get a branding project by ID, including logo, colors, typography, and brand assets. | free |
branding-list |
List branding projects owned by the authenticated user. Supports pagination and name search. | free |
branding-save |
Create or update a branding project. If projectId is provided and the project exists, it updates it; otherwise creates a new one. Returns the saved project. | free |
budget-create |
Create a new budget document with client and project details. Returns the created budget. | free |
budget-delete |
Permanently delete a budget project by ID. Cannot be undone — confirm with the user first. | free |
budget-duplicate |
Duplicate an existing budget project. Returns the new project. | free |
budget-get |
Get a budget document by ID, including line items, totals, and client info. | free |
budget-list |
List budget documents created by the authenticated user. Supports pagination and search by budget or client name. | free |
budget-update |
Update an existing budget project by ID. Accepts any subset of budget fields — only provided fields are modified. | free |
campaign-generate |
Start a batch ad campaign generation. Returns a jobId for polling. Creates multiple mockup variations across formats (square, story, banner, portrait). Costs credits per image. | credits |
campaign-get |
Get a single persisted campaign by id, including its full results (generated ad image URLs per format/angle). | free |
campaign-list |
List persisted campaigns owned by the authenticated user. Campaigns survive the 2h job TTL. Filter by brandGuidelineId to see all campaigns for one brand. | free |
campaign-status |
Poll a batch campaign job for progress. Returns status (planning/generating/done/error) and completed results with image URLs. | free |
canvas-create |
Create a new empty canvas (whiteboard) project. | free |
canvas-delete |
Permanently delete a canvas project by ID. Cannot be undone — confirm with the user first. | free |
canvas-get |
Get a canvas project by ID, including elements, collaborators, and metadata. | free |
canvas-list |
List canvas (whiteboard) projects owned by the authenticated user. Supports pagination and name search. | free |
canvas-list-projects |
List canvas projects for the authenticated user with node type summary. | free |
canvas-parse-csv |
Parse a CSV string and return the rows as an array of objects. Use this to preview what a DataNode will produce from a CSV file before uploading it to the canvas. | free |
canvas-resolve-variables |
Given a prompt string and a variables map (key→value pairs), resolve all {{placeholder}} tokens and return the final prompt. Useful for previewing what a VariablesNode or DataNode will produce before generation. | free |
canvas-share |
Share a canvas project with other users. Generates a shareId and sets collaborative mode. Accepts user emails or user IDs for canEdit/canView lists. | free |
canvas-update |
Update a canvas project by ID. Provide any combination of name, nodes, edges, drawings, or linkedGuidelineId. Only provided fields are updated. | free |
community-my-presets |
List your own community presets (approved and pending). Requires auth. | free |
community-preset-create |
Create a new community preset. Requires auth. The preset will be publicly visible once approved. | free |
community-preset-delete |
Delete your own community preset permanently. Requires auth. | free |
community-preset-get |
Get a single community preset by ID. No auth required. | free |
community-preset-like |
Toggle like/unlike on a community preset. Returns updated like count. Requires auth. | free |
community-preset-update |
Update your own community preset. Only provided fields are changed. Requires auth. | free |
community-presets |
Browse approved community presets. Filter by category or search by keyword. No auth required. | free |
community-profiles |
Browse public community creator profiles. No auth required. | free |
creative-full |
Full creative pipeline in one call. Generates layout plan → background image → renders to PNG → saves project. Returns imageUrl, projectId, plan, and per-step credits. Use this instead of chaining creative-generate + mockup-generate + creative-render manually. | credits |
creative-generate |
Generate a structured marketing creative layout (background, text layers, logo, shapes) from a prompt. Optionally inject brand guideline context. Returns a layered creative plan ready for the Creative Studio. Costs credits. | credits |
creative-projects-create |
Save a creative project to the database. Requires prompt, format, and layers (from creative-generate). Optionally attach a brand guideline and background/thumbnail URLs. | free |
creative-projects-delete |
Permanently delete a creative project by ID. Cannot be undone — confirm with the user first. | free |
creative-projects-get |
Get a creative project by ID, including all layers, background, and generated assets. | free |
creative-projects-list |
List creative studio projects owned by the authenticated user. | free |
creative-projects-update |
Update an existing creative project (partial update). All fields are optional — only provided fields are updated. | free |
creative-render |
Render a creative plan (from creative-generate) into a PNG image server-side. Pass the plan JSON and the pre-generated background image URL. Returns imageUrl (public R2 URL). Use this to close the generate→image loop without a browser: generate plan, render, inspect image with vision, adjust, re-render. | free |
delete-studio3d-scene |
Delete a saved 3D Studio scene. | free |
document-extract |
Extract content from a PDF using a 2-phase pipeline: algorithmic (exact colors, fonts, embedded images) then Gemini semantic analysis (strategy, personas, voice, dos/donts, asset classification). Returns markdownText (structured, page-separated — ideal for RAG chunking) plus brand tokens. Accepts either pdf_base64 (base64-encoded PDF content, preferred for remote MCP usage) or pdf_path (server-side path). IMPORTANT: before calling, ask the user whether they want the result saved to disk as a .md file or returned inline. | free |
figma-extract-text |
Extract all text from a Figma file as markdown, in canvas reading order and grouped by page and frame. This is the raw material for a brand guideline: pipe the returned markdown straight into brand-guidelines-ingest (source=text). Works on any file your Figma token can read — no plugin and no open tab required. Requires a Figma token in user settings. | free |
figma-preset-fill |
Build a complete, deterministic FILL_TEMPLATE operation for the Visant Figma plugin. The server resolves the brand's REAL colors (variable modes) AND images (logos by variant/contrast, photos by semantic relevance) into a [Template]'s #slots. You supply only the brand, the template name, the text content, and an optional brief — never URLs or geometry. Run the returned operation in the Visant Figma plugin to produce an on-brand design with zero hallucinated layout. | free |
figma-templates-list |
List the [Template] presets in a brand's Figma file (or a given fileKey), with each template's name, aspect, and #slots (id, type text/image, optional, variant). Use this to discover what exists and what to fill BEFORE calling figma-preset-fill. Read-only. | free |
image-extract-url |
Extract high-resolution images from any public URL (Behance, Pinterest, Dribbble, portfolios, blogs). Returns a list of image URLs with metadata. Supports lazy-loaded images, srcset, and background images. | free |
images-to-pdf |
Create a multi-page PDF from images. Each image becomes one page sized to fit the image dimensions. Accepts PNG and JPEG base64-encoded images. | free |
mockup-delete |
Permanently delete a mockup by ID. Cannot be undone — confirm with the user first. | free |
mockup-generate |
Generate a mockup image placing a design into a realistic scene. |
Two workflows: A) With referenceImages: upload-image first to get a URL, then pass it in referenceImages array. Prompt describes the SCENE only (surface, lighting, angle), never the design content. B) With brandGuidelineId: pass the brand guideline ID and the logo/colors/typography are auto-injected. No upload needed.
Example call: { "prompt": "laptop on marble desk, soft studio lighting, top-down", "referenceImages": ["https://...logo.png"] }
Example call: { "prompt": "business card on white surface, natural light", "brandGuidelineId": "abc123" } | credits |
| mockup-get | Get a single mockup by its ID, including image URL, prompt, and metadata. | free |
| mockup-list | List mockups created by the authenticated user. Supports pagination. | free |
| mockup-presets | Browse proven scene descriptions (presets) by category. Returns prompt templates you can use directly as the prompt parameter in mockup-generate. These are NOT image references — they are scene descriptions. | free |
| mockup-update | Update a mockup's metadata (prompt, tags, isLiked, designType, aspectRatio). Does not regenerate the image. | free |
| moodboard-detect-grid | Detect individual image bounding boxes in a moodboard or grid image. Returns cell coordinates so each section can be cropped and extracted individually.
PREFER imageUrl. Passing base64 costs tokens proportional to the file and truncates on large images — get a URL with visant upload <file> --json or the upload-image tool first. | free |
| moodboard-suggest | Analyze images from a moodboard and suggest Remotion animation presets and Veo video generation prompts for each cell. Useful for turning static moodboard cells into motion content. | credits |
| moodboard-upscale | Upscale an image to 1K, 2K, or 4K using Gemini image enhancement. Returns a public URL.
PREFER imageUrl for the input — every generation tool already returns one, so you rarely need base64 at all. Passing base64 costs tokens proportional to the file and truncates on large images. | credits |
| oauth-authorized-apps | List all AI agents and applications authorized to access the user's account via OAuth. Shows client name, scopes granted, and when access was granted. | free |
| oauth-revoke-app | Revoke OAuth access for a connected app. The app will no longer be able to act on behalf of the user. Requires confirm: true. | free |
| payments-plans | List available subscription plans with pricing. No auth required. | free |
| payments-subscription-status | Get the current user subscription tier, credit balance, usage, and whether they can generate. Use this to check before suggesting paid operations. | free |
| payments-usage | Get detailed credit usage: free generations used, subscription credits remaining, reset date. More granular than account-usage. | free |
| pdf-compress | Compress a PDF using Ghostscript. Reduces file size by recompressing images. Presets: screen (72dpi, smallest), ebook (150dpi, balanced), printer (300dpi), prepress (300dpi, color-preserving). Returns compressed PDF as base64 with size comparison. | free |
| pdf-to-images | Rasterize PDF pages to images (PNG or JPEG) using Ghostscript. Returns an array of base64-encoded images, one per page. Useful for thumbnails, previews, or further processing. | free |
| playground-describe | Describe a mini-app spec as structured text so the agent can "see" the layout without a browser. Returns a visual tree + component summary. | free |
| playground-feed | Browse the community mini-app gallery with filters. | free |
| playground-fork | Fork a community mini-app into your library. | free |
| playground-generate | Generate a mini-app from a natural-language prompt. Returns a JSON spec that renders inside the Playground. Costs 1 credit. | credits |
| playground-get | Get a mini-app by its slug (public). | free |
| playground-iterate | Refine an existing mini-app spec with a follow-up instruction. Returns updated spec. Costs 1 credit. | free |
| playground-list | List the authenticated user's saved mini-apps. | free |
| playground-publish | Publish a mini-app to the community gallery. | free |
| playground-quickstart | One-shot: generate a mini-app from prompt → save → share. Returns spec + URLs. Costs 1 credit. | free |
| playground-save | Save a mini-app spec to the user's library. Returns the saved mini-app with slug. | free |
| playground-share | Generate a public share URL for a mini-app you own. | free |
| psd-mockup-produce | End-to-end PSD mockup production: optionally generate the artwork, then place it into a real PSD template and publish the final image. The single tool an agent needs to deliver a finished mockup.
Pipeline:
- Provide artPrompt (to generate art) OR artUrl (existing artwork). With brandGuidelineId, the brand logo/colors/typography are auto-injected into generation.
- The art is placed into the template's smart object (cover mode) via the scene fast path (falls back to opening the PSD automatically).
- Returns the published imageUrl.
Costs: generating art with artPrompt costs credits (same as mockup-generate); the render itself is free. If render fails after generation, the generation credits are refunded. Passing artUrl costs nothing.
Pick the template with psd-scene-list first and match the art aspect ratio to the face's suggestedAspectRatio. | credits |
| psd-scene-list | List the PSD mockup Scene Package catalog (pre-processed templates ready for instant rendering).
Each scene has FACES (smart objects where art is placed). For each face you get innerW/innerH — the pixel size of the editable area. The ideal art aspect ratio = innerW/innerH, and art is applied in COVER mode (it fills the face and the overflow is cropped), so keep the important content centered.
Workflow: pick a scene + face by brand/brief, then call psd-mockup-produce with that psdFileName (and face if the scene has multiple). If a PSD from the Drive catalog has no scene yet, run psd-scene-prepare first. | free |
| psd-scene-prepare | Pre-process a PSD from the Drive catalog into a Scene Package so it can be rendered instantly. Use this ONCE when a template you want is not yet in psd-scene-list. Heavy operation (opens the PSD), but cached forever after. Returns the extracted faces. | credits |
| reference-ingest | Ingest a curated mockup reference image into the library. AI auto-extracts dimensions (niche, aesthetic, vibe, lighting, texture, material, angle). Admin only. | free |
| reference-search | Search the curated design reference library by dimensions or free text. Covers BOTH mockups (niche, aesthetic, vibe, lighting, texture, material, angle, color_mood, mockup_type) AND logo/branding refs (brand_artifact, logo_construction, type_style). Returns world-class references with AI-extracted dimensions. | free |
| settings-byok-status | Check which API keys the user has configured (Gemini, OpenAI, Seedream) and storage tier. Use to know which models are available. | free |
| smart-analyze | AI-powered image analysis. Detects design type (logo, UI, photo, illustration), suggests mockup category and prompt, and returns a ready-to-use prompt for mockup-generate. Costs 1 credit.
PREFER imageUrl. Passing base64 costs tokens proportional to the file and truncates on large images — get a URL with visant upload <file> --json or the upload-image tool first. | free |
| studio3d-create-scene | Create and save a 3D Studio scene configuration. Returns a deep-link URL that opens the scene directly in the app. The config controls material, color, lighting, animation, camera, and more. Costs 0 credits. | free |
| studio3d-get-scene | Get a saved 3D Studio scene by ID. Returns full config that can be applied. Free. | free |
| studio3d-list-presets | List all built-in 3D Studio scene presets (Product Shot, Hero Banner, Neon, etc.) with their full configurations. Free. | free |
| studio3d-list-scenes | List saved 3D Studio scenes for the current user. Free. | free |
| studio3d-render | Render a 3D logo or wordmark to a video (mp4/webm) or still (png) — deterministic, frame by frame, in headless Chromium using the 3D Studio engine. Input: svgData (logo), text+font (type), or sceneId (saved scene). Look: preset (app scene preset, e.g. "Liquid Metal"), lighting preset, and config (same keys as studio3d-create-scene). Motion: camera.move turntable|orbit|push|pull|sweep|static. Returns a public URL. Free (no credits); slow (~0.1–0.5 s/frame). Use studio3d-list-presets for names. | free |
| update-studio3d-scene | Update an existing 3D Studio scene. Partial updates supported — only pass fields to change. | free |
| upload-image | Upload a base64 image and get a permanent public URL. Free, no credits, max 20MB.
PREFER THE CLI FOR LOCAL FILES: visant upload <file> --json sends the file
straight from disk and prints the URL. Use it whenever you can run a shell.
Passing base64 through this tool costs tokens proportional to the file size and,
past a few thousand characters, is unreliable — the payload gets truncated in
transit and a corrupt image is uploaded.
If you must pass base64, ALWAYS send bytes (and ideally sha256) so the
server can reject a truncated payload instead of returning a broken URL. | free |
| video-generate | Generate a video using AI (Google Veo or Kling). Supports text-to-video, image-to-video, frames-to-video, extend-video, and references modes. Costs credits based on model. | credits |
Credits & Limits
- Read operations (list, get) are always Free.
- Generation operations cost 1 credit.
- Every tool response includes
_meta: { credits_remaining, plan }.
Example Flow
- Connect via Claude.ai Connector or API key
- Call
account-usageto check balance - Call
brand-guidelines-list→brand-guidelines-getfor brand context - Call
mockup-generatewithbrandGuidelineIdand check_meta.credits_remaining
Figma Plugin — Visant Copilot
Installation
- Open any file in Figma.
- Go to Resources > Plugins and search for Visant Copilot.
- Click Run to launch the plugin panel.
- Sign in with your Visant account to unlock brand-aware features and credit-based generation.
AI Chat
Describe what you want in natural language — the AI creates, edits, and organizes Figma nodes automatically.
Features:
- @mentions — type
@to reference layers, components, or variables by name. The AI resolves them to real node IDs. - Multimodal input — drag-and-drop or paste images directly into the chat input for visual context.
- Brand context — select a Brand Guideline to inject colors, typography, and tone into every prompt.
/clearcommand — type/clearto reset chat history.- Clickable layer refs — operation summaries show
@"LayerName"links that select and zoom to the referenced layer. - Copy & select — hover any message bubble for a copy button; text is fully selectable.
Supported Operations (50)
Creation
CREATE_PAGE, CREATE_FRAME, CREATE_RECTANGLE, CREATE_ELLIPSE, CREATE_TEXT, CREATE_COMPONENT_INSTANCE, CREATE_COMPONENT, CREATE_SVG, CREATE_ICON, CREATE_LINE, CREATE_POLYGON, CREATE_STAR
Clone & Duplicate
CLONE_NODE (by name or ID), DUPLICATE_NODE — preserves all children (logos, images, components). Supports textOverrides to replace text in cloned templates.
Edit / Style
SET_FILL, SET_STROKE, SET_IMAGE_FILL, SET_CORNER_RADIUS, SET_INDIVIDUAL_CORNERS, SET_EFFECTS, SET_AUTO_LAYOUT, SET_OPACITY, SET_BLEND_MODE, SET_TEXT_CONTENT, SET_TEXT_STYLE, SET_TEXT_RANGES, SET_CONSTRAINTS, SET_LAYOUT_GRID, RESIZE, MOVE, RENAME, REORDER_CHILD, RECOLOR_NODE
Structure
GROUP_NODES, UNGROUP, DELETE_NODE, DETACH_INSTANCE, BOOLEAN_OPERATION (union, subtract, intersect, exclude), COMBINE_AS_VARIANTS
Variables & Tokens
APPLY_VARIABLE, APPLY_STYLE, CREATE_VARIABLE, CREATE_COLOR_VARIABLES_FROM_SELECTION, BIND_NEAREST_COLOR_VARIABLES
Inspection (MCP)
GET_DESIGN_CONTEXT, GET_VARIABLE_DEFS, GET_SCREENSHOT, SEARCH_DESIGN_SYSTEM, GET_CODE_CONNECT_MAP, ADD_CODE_CONNECT_MAP
All operations use JSON format: [{ "type": "OPERATION_TYPE", ...params }]
AI Prompt System (V2 — Intent-Driven)
Architecture
The AI prompt is assembled dynamically based on intent, not as a monolithic blob. This reduces tokens by ~70% and improves accuracy.
User Prompt > classifyIntent() > assemblePrompt() > LLM > operations[]
| |
keyword patterns modules by intent
+ optional LLM (only relevant ops)
pre-pass
Intent Classification (Two-Tier)
- Fast keyword classifier (~0ms) — regex-based detection of intent (
create,edit,clone,arrange,chat), format (instagram_feed,stories, etc.), and complexity. - LLM pre-pass (optional, ~200ms) — when keyword confidence < 0.65, a lightweight Flash Lite call extracts structured params:
sourceFrame,cloneCount,modifications[].
Module System
Prompt sections are injected by priority based on detected intent:
| Module | Priority | When injected |
|---|---|---|
think_mode |
99 | Think mode enabled |
feedback |
98 | Retrying after errors |
selection |
95 | Frame(s) selected |
history |
92 | Chat history exists |
preset |
90 | Format detected (Stories, Feed...) |
brand |
85 | Brand guideline active |
template_rules |
85 | Clone intent |
create_rules |
80 | Create intent |
edit_rules |
80 | Edit intent |
create_example |
70 | Complex creation (few-shot) |
components |
50 | Available components |
color_vars |
45 | Color variables available |
Brand-Aware Context
When a Brand Guideline is active, the prompt receives:
- Colors — palette with roles (Primary, Accent, CTA, Background)
- Typography — principal (headings) and secondary (body) families with available weights
- Logos — light/dark variants for cloning via
CLONE_NODE sourceName - Design tokens — spacing, radius from the brand guideline
- Voice & rules — brand voice, dos/don'ts as hard constraints
Brand context overrides generic styles (e.g., "Inter" is never used when brand fonts exist).
Feedback Loop
When operations fail validation (>50% invalid), the system automatically retries with:
- Lower temperature (0.1 vs 0.2)
- Error feedback injected at priority 98 (seen before all other modules)
- Specific error messages per operation type
Clone-First Strategy
When the user asks for "variations", "more like this", or "same style" with a frame selected:
- The intent classifier detects
cloneintent CLONE_NODEis prioritized overCREATE_*operationstextOverridesreplace text in cloned children by layer name- This preserves logos, images, shapes, and complex layers that can't be recreated
Brand Guidelines
- Select a brand guideline from the sidebar to inject identity context (colors, typography, tone, tokens, voice) into every AI prompt.
- The last selected brand persists across sessions via Figma pluginData — no need to re-select each time.
- Brand context is sent alongside the user prompt to the server, ensuring brand-consistent outputs.
Smart Scan (REQUEST_SCAN)
When the AI needs context beyond the current selection, it automatically emits a REQUEST_SCAN operation. This triggers a full page scan, re-sending the command with complete page context. The scan status appears as a tool call in the chat UI.
Plugin API (for developers)
Architecture
Figma Sandbox (code.ts) <> UI iframe (React) --SSE--> POST /api/plugin/stream (Claude/Gemini)
<-- APPLY_OPERATIONS ----------
Two AI provider paths:
- Streaming (default):
POST /api/plugin/stream— SSE with Claude (agentic, multi-turn with web search) - Direct (fallback):
POST /api/figma/generate— Gemini structured JSON output
POST /api/plugin/stream
SSE endpoint. Receives serialized selection + brand context + user prompt. Streams events: status, thinking, text, operations, done.
Operation JSON Format
[
{ "type": "CREATE_FRAME", "ref": "card", "props": { "name": "Card 300x200", "width": 300, "height": 200 } },
{ "type": "CREATE_TEXT", "parentRef": "card", "props": { "content": "Hello", "fontSize": 16 } },
{ "type": "CLONE_NODE", "ref": "v2", "sourceName": "card", "textOverrides": [{ "name": "Hello", "content": "World" }] }
]
ref creates a named reference; parentRef nests inside a previously created node; parentNodeId nests inside an existing Figma node by ID; sourceName clones by layer name; autoPosition: "right" auto-positions frames side by side.
Quality Assurance
After operations are applied, an auditCreatedNodes() pass checks for:
- Text truncation (
textTruncation === 'ENDING') - Double-fixed sizing on text (causes clipping)
- Incorrect layout sizing in auto-layout context
- Structural white frames (unnecessary solid fills)
- Child overflow parent bounds
Violations are reported in the OPERATIONS_DONE message telemetry.
Brand Guidelines API Reference
Base URL: /api/brand-guidelines
Auth: Authorization: Bearer <jwt_token> or Bearer visant_sk_xxx
Overview
Brand Guidelines (Identity Vaults) are structured brand data used as context for AI generation. They maintain visual consistency across mockups, branding projects, and canvas elements.
REST Endpoints
GET /api/brand-guidelines— List all guidelinesGET /api/brand-guidelines/:id— Get details by IDGET /api/brand-guidelines/public/:slug— Public read access (no auth)POST /api/brand-guidelines— Create new guidelinePUT /api/brand-guidelines/:id— Update guidelineDELETE /api/brand-guidelines/:id— Delete guidelineGET /api/brand-guidelines/:id/context— Get LLM-ready context (query:format=prompt|structured,output=text|json)
Schema
{
"identity": { "name": "...", "tagline": "...", "description": "..." },
"colors": [{ "hex": "#...", "name": "...", "role": "primary" }],
"typography": [{ "family": "...", "role": "heading", "size": 32 }],
"strategy": { "manifesto": "...", "archetypes": [], "personas": [], "voiceValues": [] },
"guidelines": { "voice": "...", "dos": [], "donts": [] }
}
LLM Context Usage
Agents should fetch the context in prompt format to inject directly into system prompts:
const context = await fetch(`/api/brand-guidelines/${id}/context?format=prompt&output=text`, { headers }).then(r => r.text());
// Inject context into LLM prompt
Figma Node JSON Spec
Data-driven pattern for creating Figma nodes via Plugin API. Define JSON → execute with render.ts.
Flow: JSON spec → collectFonts() → figma.loadFontAsync() → buildNode() recursively
Supported Node Types
- FRAME — container with auto-layout, padding, fills, children
- RECTANGLE — solid or gradient-filled box
- ELLIPSE — circle or oval shape
- TEXT — text with full typography control
NodeSpec Properties
| property | type | notes |
|---|---|---|
| type | string | 'FRAME' | 'RECTANGLE' | 'ELLIPSE' | 'TEXT' — required |
| name | string | Layer name — required |
| width / height | number | Applied via resize() internally |
| fills | FillSpec[] | Array of solid or gradient fills. Empty array = transparent |
| strokes | FillSpec[] | Stroke paints (same format as fills) |
| strokeWeight | number | Stroke width in pixels |
| cornerRadius | number | Rounded corners in pixels |
| opacity | number | 0–1 |
| effects | EffectSpec[] | DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR |
| layoutMode | string | 'NONE' | 'HORIZONTAL' | 'VERTICAL' — FRAME only |
| primaryAxisAlignItems | string | 'MIN' | 'MAX' | 'CENTER' | 'SPACE_BETWEEN' |
| counterAxisAlignItems | string | 'MIN' | 'MAX' | 'CENTER' | 'BASELINE' |
| paddingTop/Bottom/Left/Right | number | Inner spacing — auto-layout frames only |
| itemSpacing | number | Gap between children |
| layoutSizingHorizontal | string | 'FIXED' | 'FILL' | 'HUG' — set AFTER appendChild |
| layoutSizingVertical | string | 'FIXED' | 'FILL' | 'HUG' — set AFTER appendChild |
| characters | string | Text content — TEXT only |
| fontSize | number | Font size in px — TEXT only |
| fontName | object | { family: string, style: string } — must be loaded first |
| textAlignHorizontal | string | 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFIED' |
| children | NodeSpec[] | Nested nodes — FRAME only |
Critical Rules
- Colors are 0–1 floats — { r: 1, g: 0, b: 0 } = red. Never 0–255.
- Use resize(), not width= — width/height are read-only.
- Load fonts before text — figma.loadFontAsync() must complete first.
- appendChild before layoutSizing — FILL/HUG only works after node is in auto-layout parent.
- fontName.style must be exact — 'SemiBold' not 'Semi Bold'.
- lineHeight AUTO has no value — { unit: 'AUTO' } — omit value field.
- Empty fills = transparent — fills: [] removes all background.
Fill Examples
// Solid fill
{ "type": "SOLID", "color": { "r": 0.98, "g": 0.35, "b": 0.35 }, "opacity": 1 }
// Linear gradient
{
"type": "GRADIENT_LINEAR",
"gradientTransform": [[0.7, 0.7, -0.1], [-0.7, 0.7, 0.7]],
"gradientStops": [
{ "color": { "r": 0.06, "g": 0.09, "b": 0.22, "a": 1 }, "position": 0 },
{ "color": { "r": 0.40, "g": 0.06, "b": 0.20, "a": 1 }, "position": 1 }
]
}
Canvas API Reference
Base URL: /api/canvas
Auth: Authorization: Bearer <jwt_token>
Content-Type: application/json
Overview
The canvas is a React Flow graph stored as a project with nodes[] and edges[] arrays.
There is no individual node CRUD — to add/update/remove a node: GET the project, mutate the array, PUT the full array back.
Workflow:
POST /api/canvas— create projectGET /api/canvas/:id— fetch current nodes- Mutate locally
PUT /api/canvas/:id— persist the full nodes array
Projects CRUD
GET /api/canvas
List all projects for the authenticated user.
{ "projects": [{ "_id": "...", "name": "...", "nodes": [...], "edges": [...], "createdAt": "...", "updatedAt": "..." }] }
GET /api/canvas/:id
Get a single project by ID.
{ "project": { "_id": "...", "name": "...", "nodes": [...], "edges": [...] } }
POST /api/canvas
Create a new canvas project. Body:
{
"name": "My Canvas",
"nodes": [
{
"id": "prompt-1",
"type": "prompt",
"position": { "x": 100, "y": 100 },
"data": { "type": "prompt", "prompt": "A product photo on white background", "model": "gemini-2.5-flash" }
}
],
"edges": []
}
Response: { "project": { "_id": "abc123", ... } }
PUT /api/canvas/:id
Update a project. Send only fields to change; nodes/edges require the full array.
Body: { "name"?: string, "nodes"?: Node[], "edges"?: Edge[], "drawings"?: any[] }
Limits: max 10 000 nodes, 15 MB payload after R2 offload.
DELETE /api/canvas/:id
Delete a project permanently.
Response: { "success": true }
Node Types
| type | description | key data fields |
|---|---|---|
| prompt | Text-to-image generation | prompt, model, aspectRatio, resolution, resultImageUrl |
| image | Display a mockup/image | mockup: { imageUrl, ... } |
| output | Result viewer | resultImageUrl, resultVideoUrl, sourceNodeId |
| merge | Combine 2+ images with AI | prompt, model, resultImageUrl |
| edit | Edit image with Mockup Machine | uploadedImage, referenceImage, tags[], model, designType |
| upscale | AI upscaling | targetResolution, resultImageUrl, connectedImage |
| mockup | AI mockup from presets | selectedPreset, selectedColors[], withHuman, customPrompt |
| text | Editable text block | text: string |
| logo | Logo upload node | logoImageUrl, logoBase64 |
| chat | Conversational AI | messages[], model, systemPrompt, connectedImage1..4 |
Edges
{ "id": "e1", "source": "prompt-1", "target": "output-1", "sourceHandle": "output", "targetHandle": "input" }
Media Upload
POST /api/canvas/image/upload— Upload image (base64) to R2GET /api/canvas/image/upload-url— Presigned URL for large imagesPOST /api/canvas/video/upload— Upload videoPOST /api/canvas/pdf/upload— Upload PDFDELETE /api/canvas/image?url=<encoded>— Delete image
Key Patterns for Agents
- Node IDs must be unique — use UUID or timestamp suffix
- Always PUT the full nodes array — no PATCH for individual nodes
- Prefer R2 URLs over base64 — base64 expires after 7 days
- Max 10,000 nodes per project, 15 MB payload
Visant Copilot — Pricing Guide
Credit Costs by Model & Resolution
| Model | Resolution | Google Price (USD) | Visant Overhead | Total Cost | Credits |
|---|---|---|---|---|---|
| Nano Banana 2 Lite | ~1K (HD) | $0.034 | $0.013 | $0.047 | 1 |
| Gemini 3.1 Flash | 512px | $0.045 | $0.013 | $0.058 | 1 |
| Gemini 3.1 Flash | 1K (HD) | $0.067 | $0.013 | $0.080 | 2 |
| Gemini 3.1 Flash | 2K | $0.101 | $0.013 | $0.114 | 3 |
| Gemini 3.1 Flash | 4K | $0.151 | $0.013 | $0.164 | 4 |
| Gemini 3 Pro | 1K (HD) | $0.134 | $0.013 | $0.147 | 3 |
| Gemini 3 Pro | 2K | $0.134 | $0.013 | $0.147 | 5 |
| Gemini 3 Pro | 4K | $0.240 | $0.013 | $0.253 | 7 |
| GPT Image 2 | 1K (HD) | $0.053 | $0.013 | $0.066 | 2 |
| GPT Image 2 | 2K | $0.211 | $0.013 | $0.224 | 4 |
| GPT Image 2 | 4K | $0.211 | $0.013 | $0.224 | 4 |
| Seedream 5 Lite | 2K | $0.035 | $0.013 | $0.048 | 2 |
| Seedream 5 Lite | 3K | $0.045 | $0.013 | $0.058 | 3 |
| Seedream 5 Lite | 4K | $0.055 | $0.013 | $0.068 | 4 |
| Seedream 4.5 | 2K | $0.040 | $0.013 | $0.053 | 2 |
| Seedream 4.5 | 3K | $0.045 | $0.013 | $0.058 | 3 |
| Seedream 4.5 | 4K | $0.055 | $0.013 | $0.068 | 4 |
| Seedream 4.0 | 2K | $0.025 | $0.013 | $0.038 | 2 |
| Seedream 4.0 | 3K | $0.035 | $0.013 | $0.048 | 3 |
| Seedream 4.0 | 4K | $0.045 | $0.013 | $0.058 | 4 |
| Reve 1 | 1K | $0.100 | $0.013 | $0.113 | 2 |
| Reve 1 | 2K | $0.100 | $0.013 | $0.113 | 3 |
| Ideogram 4 | 1K | $0.060 | $0.013 | $0.073 | 2 |
| Ideogram 4 | 2K | $0.060 | $0.013 | $0.073 | 3 |
| Ideogram 3 | 1K | $0.060 | $0.013 | $0.073 | 2 |
| Ideogram 3 | 2K | $0.060 | $0.013 | $0.073 | 3 |
Video Generation
| Model | Resolution | Cost per 8s | Credits |
|---|---|---|---|
| Veo 3.1 Lite | 720p (8s) | $0.40 | 12 |
| Veo 3.1 Fast | 720p/1080p (8s) | $0.96 | 24 |
| Veo 3.1 Standard | 720p/1080p (8s) | $3.20 | 72 |
| Seedance 2.0 | 1080p (5s) | $0.92 | 35 |
| Seedance 2.0 Fast | 1080p (5s) | $0.46 | 20 |
| Seedance 1.5 Pro | 1080p (5s) | $0.65 | 25 |
| Seedance 1.0 Lite | 720p (5s) | $0.25 | 10 |
| Kling v3 (std) | 720p (5s) | $0.70 | 20 |
| Kling v3 (pro) | 1080p (5s) | $0.70 | 30 |
| Kling v3 (4K) | 4K (5s) | $2.10 | 50 |
| Kling v2.5 Turbo | 720p (5s) | $0.35 | 15 |
Other Operations
- AI Chat (4 messages): 1 credit
- Brand Analysis (Complete (10 steps)): 10 credits
- AI Text (single call) (~2K tokens): 1 credit
Infrastructure Overhead (per image)
- Image processing — Resizing, optimization, format conversion ($0.005)
- CDN delivery — Cloudflare R2 storage + global delivery ($0.003)
- API overhead — Rate limiting, auth, monitoring ($0.005)
Credit Packages
| Credits | Price (BRL) | Price (USD) | Per Credit | ~HD Images | ~4K Images | ~Fast Videos |
|---|---|---|---|---|---|---|
| 20 | R$9.90 | $1.80 | $0.090 | ~10 | ~5 | ~0 |
| 50 | R$25.90 | $4.71 | $0.094 | ~25 | ~12 | ~2 |
| 100 | R$45.90 | $8.35 | $0.084 | ~50 | ~25 | ~4 |
| 500 | R$198.00 | $36.00 | $0.072 | ~250 | ~125 | ~20 |