Lovart API Documentation
Integrate powerful Lovart AI design capabilities into your applications with our comprehensive RESTful API and SDKs.
Quick Start
Get started with the Lovart API in minutes. All you need is an API key and a few lines of code.
Base URL
Authentication
All Lovart API requests require authentication using an API key. Include your API key in the Authorization header:
API Endpoints
Endpoints Overview
/v1/design/generate—Generate Design/v1/design/{id}—Get Design Status/v1/image/upload—Upload Image/v1/image/enhance—Enhance Image/v1/image/remove-background—Remove Background/v1/templates—List Templates/v1/models—List Models/v1/user/me—Get User Info/v1/user/usage—Get Usage Statistics/v1/design/generateGenerate Design
Generate AI-powered designs based on text prompts and parameters.
Request Body
{
"prompt": "A modern minimalist logo for a tech startup",
"model": "nano-banana-pro",
"width": 1024,
"height": 1024,
"style": "photorealistic",
"num_outputs": 1
}Response
{
"id": "design_abc123",
"status": "processing",
"estimated_time": 15,
"created_at": "2026-02-10T09:00:00Z"
}/v1/design/{id}Get Design Status
Check the status and retrieve results of a design generation request.
Response
{
"id": "design_abc123",
"status": "completed",
"output": {
"images": [
{
"url": "https://cdn.lovart.pro/output/design_abc123.png",
"width": 1024,
"height": 1024
}
]
},
"created_at": "2026-02-10T09:00:00Z",
"completed_at": "2026-02-10T09:00:15Z"
}/v1/image/uploadUpload Image
Upload images for processing, reference, or enhancement. Supports JPG, PNG, and WebP.
Request Body
// multipart/form-data
{
"file": "<binary>",
"purpose": "reference"
}Response
{
"id": "img_xyz789",
"url": "https://cdn.lovart.pro/uploads/img_xyz789.png",
"size": 1048576,
"format": "png",
"width": 1920,
"height": 1080
}/v1/image/enhanceEnhance Image
Enhance image quality using AI-powered upscaling, denoising, and optimization.
Request Body
{
"image_id": "img_xyz789",
"operations": ["upscale", "denoise"],
"upscale_factor": 2
}Response
{
"id": "enhance_def456",
"status": "completed",
"output": {
"url": "https://cdn.lovart.pro/enhanced/enhance_def456.png",
"width": 3840,
"height": 2160
}
}/v1/image/remove-backgroundRemove Background
Remove image background using AI with high precision edge detection.
Request Body
{
"image_id": "img_xyz789",
"output_format": "png"
}Response
{
"id": "rmbg_ghi012",
"status": "completed",
"output": {
"url": "https://cdn.lovart.pro/processed/rmbg_ghi012.png"
}
}/v1/templatesList Templates
Get a list of available design templates with filtering and pagination.
Response
{
"templates": [
{
"id": "tpl_001",
"name": "Social Media Post",
"category": "marketing",
"preview_url": "https://cdn.lovart.pro/templates/tpl_001.png",
"dimensions": { "width": 1080, "height": 1080 }
}
],
"total": 150,
"page": 1,
"per_page": 20
}/v1/modelsList Models
List available AI models and their capabilities.
Response
{
"models": [
{
"id": "nano-banana-pro",
"name": "Nano Banana Pro",
"type": "image-generation",
"styles": ["photorealistic", "artistic", "anime"],
"max_resolution": 2048
},
{
"id": "flux-context",
"name": "Flux Context",
"type": "image-generation",
"styles": ["photorealistic", "editorial"],
"max_resolution": 1536
}
]
}/v1/user/meGet User Info
Get current user account information and usage stats.
Response
{
"id": "user_abc",
"email": "[email protected]",
"plan": "pro",
"credits": {
"remaining": 4500,
"total": 5000,
"refresh_daily": 100
}
}/v1/user/usageGet Usage Statistics
Get detailed usage statistics and billing information.
Response
{
"period": "2026-02",
"total_requests": 342,
"credits_used": 1850,
"breakdown": {
"design_generate": 120,
"image_enhance": 89,
"remove_background": 133
}
}Code Examples
⌨️ cURL
curl -X POST https://api.lovart.pro/v1/design/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Modern logo design",
"model": "nano-banana-pro",
"width": 1024,
"height": 1024
}'🟨 JavaScript
import Lovart from '@lovart/sdk';
const lovart = new Lovart('YOUR_API_KEY');
const design = await lovart.design.generate({
prompt: 'Modern logo design',
model: 'nano-banana-pro',
width: 1024,
height: 1024,
});
console.log(design.output.images[0].url);🐍 Python
import lovart
client = lovart.Client(api_key="YOUR_API_KEY")
design = client.design.generate(
prompt="Modern logo design",
model="nano-banana-pro",
width=1024,
height=1024,
)
print(design.output.images[0].url)🔔 Webhook
// Webhook payload (POST to your endpoint)
{
"event": "design.completed",
"data": {
"id": "design_abc123",
"status": "completed",
"output": {
"images": [...]
}
},
"timestamp": "2026-02-10T09:00:15Z"
}Rate Limits
Lovart API rate limits vary by plan. Exceeding the rate limit returns a 429 Too Many Requests response.
| Plan | Requests/min | Daily Limit | Concurrent |
|---|---|---|---|
| Free | 10 | 100 | 2 |
| Pro | 60 | 5,000 | 10 |
| Enterprise | 300 | Unlimited | 50 |
Error Codes
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 400 | Bad Request | Invalid parameters or missing required fields |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Insufficient permissions for this endpoint |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Internal server error — contact support |
Official SDKs
🟨 JavaScript / TypeScript SDK
Full-featured SDK for Node.js and browser environments with TypeScript support.
- ✅ Full TypeScript types
- ✅ Promise-based async API
- ✅ Automatic retry with exponential backoff
- ✅ Webhook signature verification
🐍 Python SDK
Pythonic SDK with async support and comprehensive type hints.
- ✅ Async/await support
- ✅ Pydantic models
- ✅ Streaming responses
- ✅ CLI tool included
Lovart API FAQ
How do I get a Lovart API key?
Sign up for a Lovart account, navigate to your dashboard settings, and generate an API key. API access is available on Pro and Enterprise plans.
What are the Lovart API rate limits?
Free tier: 10 requests/minute. Pro: 60 requests/minute. Enterprise: 300 requests/minute. Rate limits are per API key.
Which image formats does the Lovart API support?
The Lovart API supports JPG, PNG, WebP for uploads, and outputs in PNG, JPG, and WebP formats. SVG output is available for specific template-based designs.
Can I use the Lovart API for commercial projects?
Yes! Pro and Enterprise plans include commercial usage rights for all API-generated content. See our Terms of Service for full details.
Is there a Lovart SDK available?
Yes, we offer official SDKs for JavaScript/TypeScript and Python. Community SDKs are also available for Go, Ruby, and PHP.