Lovart API Documentation

Integrate powerful Lovart AI design capabilities into your applications with our comprehensive RESTful API and SDKs.

RESTful APIJavaScript & Python SDKsWebhook Support99.9% Uptime

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

https://api.lovart.pro

Authentication

All Lovart API requests require authentication using an API key. Include your API key in the Authorization header:

// Include in every request header
Authorization: Bearer YOUR_API_KEY
⚠️ Security: Keep your API key secure. Never expose it in client-side code or public repositories.

API Endpoints

Endpoints Overview

POST/v1/design/generateGenerate Design
GET/v1/design/{id}Get Design Status
POST/v1/image/uploadUpload Image
POST/v1/image/enhanceEnhance Image
POST/v1/image/remove-backgroundRemove Background
GET/v1/templatesList Templates
GET/v1/modelsList Models
GET/v1/user/meGet User Info
GET/v1/user/usageGet Usage Statistics
POST/v1/design/generate

Generate 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"
}
GET/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"
}
POST/v1/image/upload

Upload 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
}
POST/v1/image/enhance

Enhance 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
  }
}
POST/v1/image/remove-background

Remove 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"
  }
}
GET/v1/templates

List 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
}
GET/v1/models

List 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
    }
  ]
}
GET/v1/user/me

Get 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
  }
}
GET/v1/user/usage

Get 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.

PlanRequests/minDaily LimitConcurrent
Free101002
Pro605,00010
Enterprise300Unlimited50

Error Codes

CodeStatusDescription
200OKRequest succeeded
400Bad RequestInvalid parameters or missing required fields
401UnauthorizedInvalid or missing API key
403ForbiddenInsufficient permissions for this endpoint
429Too Many RequestsRate limit exceeded
500Server ErrorInternal server error — contact support

Official SDKs

🟨 JavaScript / TypeScript SDK

Full-featured SDK for Node.js and browser environments with TypeScript support.

npm install @lovart/sdk
  • ✅ 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.

pip install lovart
  • ✅ 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.

Need Help with the Lovart API?

📚

Documentation

Comprehensive guides and references

Read Guides →
💬

Community

Join the developer community

Join Discord →
✉️

Email Support

Get help from our dev team

Contact Support →