SDK

Official SDKs for TypeScript/Node.js and Python. Community SDKs for other languages are also available.

TypeScript / Node.js

Install:

pnpm add @liffai/sdk

Initialization

import { LiffClient } from '@liffai/sdk'; const client = new LiffClient({ apiKey: process.env.LIFF_API_KEY, baseURL: 'https://api.liffai.com/v1' /* optional */ });

Generate

const result = await client.generate({ prompt: 'A navigation arrow icon', model: 'liff-v3-flash', colors: ['#DC2626'], size: { width: 24, height: 24 }, }); console.log(result.svg); // SVG string console.log(result.metadata.anchorCount); // 12 console.log(result.metadata.sizeBytes); // 483

Non-Destructive Redraw

const result = await client.redraw({ svg: existingSvgString, region: { x: 128, y: 0, width: 128, height: 128 }, prompt: 'Replace with a star shape', model: 'liff-v3-pro', });

Streaming

const stream = await client.generate({ prompt: 'A complex dashboard layout', model: 'liff-v3-pro', stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.svg); }

Python

Install:

pip install liffai

Usage

from liffai import LiffClient client = LiffClient() result = client.generate( prompt="A navigation arrow icon", model="liff-v3-flash", colors=["#DC2626"], size={"width": 24, "height": 24}, ) with open("arrow.svg", "w") as f: f.write(result.svg)

Other Integrations

VS Code Extension

Generate SVGs directly in your editor. Search "LIFF AI" in the Extensions Marketplace.

Figma Plugin

Insert AI-generated SVGs as Figma layers with proper grouping. Available on the Figma Community.

Coze Skills

Use LIFF AI as a Coze Skill for automated SVG generation in your AI workflows.