API Documentation

Integrate LayerCraft's AI-powered image decomposition into your application

Quick Start

  1. 1.

    Sign up for LayerCraft

    Create an account and choose a Pro or Enterprise plan

  2. 2.

    Create an API key

    Go to Dashboard → API Keys → Create New Key

  3. 3.

    Make your first request

    Use the examples below with your API key

API Endpoints

Decompose an Image

Extract layers from an image using the API

POST
/api/v1/images/decompose
curl -X POST https://image-extraction.com/api/v1/images/decompose \
  -H "Authorization: Bearer lc_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://example.com/image.png",
    "export_format": "psd"
  }'

Get Job Status

Check the status of a decomposition job

GET
/api/v1/images/{id}
curl -X GET https://image-extraction.com/api/v1/images/job_abc123 \
  -H "Authorization: Bearer lc_live_YOUR_API_KEY"

Get Layer Files

Retrieve individual layer files from a completed job

GET
/api/v1/images/{id}/layers
curl -X GET https://image-extraction.com/api/v1/images/job_abc123/layers \
  -H "Authorization: Bearer lc_live_YOUR_API_KEY"

Get Usage Statistics

Check your current API usage and tokens

GET
/api/v1/usage
curl -X GET https://image-extraction.com/api/v1/usage \
  -H "Authorization: Bearer lc_live_YOUR_API_KEY"

Authentication

API Key Format

API keys start with lc_live_ for production and lc_test_ for testing.

Using Your API Key

Include your API key in the Authorization header:

Authorization: Bearer lc_live_YOUR_API_KEY

Response Format

{
  "success": true,
  "data": {
    "id": "job_abc123",
    "status": "completed",
    "layers": [
      {
        "index": 0,
        "name": "Layer 1",
        "url": "https://r2.image-extraction.com/jobs/job_abc123/layer-0.png"
      }
    ]
  }
}

Error Handling

400 Bad Request

Invalid parameters or malformed request

401 Unauthorized

Missing or invalid API key

403 Forbidden

Plan doesn't support this feature

429 Too Many Requests

Rate limit exceeded

500 Server Error

Internal server error (rare)

Plan Limits

Pro Plan

  • ✓ 500 API calls/month
  • ✓ All export formats (PSD, PPTX, PNG, ZIP)
  • ✓ Up to 50MB per image
  • ✓ Email support

Enterprise Plan

  • ✓ Unlimited API calls
  • ✓ All export formats
  • ✓ Up to 200MB per image
  • ✓ Priority support & SLA

© 2024 LayerCraft. All rights reserved.

Powered by Qwen-Image-Layered AI