Quick Start
Generate your first SVG in under 5 minutes.
1. Get Your API Key
Sign up at liffai.com and navigate to your dashboard to create an API key. The Starter plan includes 100 free generations per month.
export LIFF_API_KEY="sk-liff-your-key-here"
2. Install the SDK
TypeScript / Node.js
pnpm add @liffai/sdk
Python
pip install liffai
CLI
npm install -g @liffai/cli
3. Generate Your First SVG
TypeScript
import { LiffClient } from '@liffai/sdk';
const client = new LiffClient();
const result = await client.generate({
prompt: 'A minimal logo mark for a tech startup',
model: 'liff-v3-pro',
colors: ['#DC2626'],
size: { width: 256, height: 256 },
});
// result.svg contains the optimized SVG string
// result.anchors contains anchor count metadata
// result.sizeBytes contains the SVG file size
console.log(result.svg);Python
from liffai import LiffClient
client = LiffClient()
result = client.generate(
prompt="A minimal logo mark for a tech startup",
model="liff-v3-pro",
colors=["#DC2626"],
size={"width": 256, "height": 256},
)CLI
liff generate "A minimal logo mark for a tech startup"
--model v3-pro
--color #DC2626
--size 256x256
--output ./logo.svg4. Response Format
All methods return a consistent response object:
{
"id": "gen_abc123",
"svg": "<svg xmlns=...>...</svg>",
"model": "liff-v3-pro",
"metadata": {
"anchorCount": 24,
"sizeBytes": 1247,
"viewBox": "0 0 256 256",
"colors": ["#DC2626"],
"layers": 3
},
"usage": {
"promptTokens": 42,
"generationTimeMs": 2130
}
}