API Documentation

Integrate Sirv AI Studio with Zapier, Make, n8n, or your own applications.

Authentication

All endpoints require an API key passed in the Authorization header:

Authorization: Bearer sk_live_YOUR_API_KEY

Generate your API key in Account Settings.

Base URL

https://www.sirv.studio/api/zapier

Account

GET/me

Verify API key and get account information. Use this to test authentication.

Response

{
  "id": "user_abc123",
  "email": "user@example.com",
  "credits": 500,
  "tier": "pro"
}

Credits: FREE

Image Processing

POST/remove-bg

Remove the background from an image, leaving only the subject with transparency.

Request Body

FieldTypeRequiredDescription
image_urlstringYesURL of the image to process
modelstringNobirefnet (default, 1 credit) or bria (2 credits)

Credits: 1-2

POST/upscale

Enhance image resolution using AI upscaling.

Request Body

FieldTypeRequiredDescription
image_urlstringYesURL of the image to upscale
scalenumberNoUpscale factor: 2, 3, or 4 (default: 2)
modelstringNoesrgan (1 credit), clarity (8 credits), or topaz (8 credits)

Credits: 1-8

POST/replace-bg

Replace the background of an image with an AI-generated scene.

Request Body

FieldTypeRequiredDescription
image_urlstringYesURL of the image with subject to keep
promptstringYesText description of the new background
modelstringNobria (4 credits), flux-kontext (15 credits), or nano-banana (3 credits)

Credits: 3-15

POST/object-removal

Remove unwanted objects from an image using a mask.

Request Body

FieldTypeRequiredDescription
image_urlstringYesURL of the image to edit
mask_urlstringYesURL of mask image (white = areas to remove)

Credits: 3

POST/image-to-image

Transform an existing image based on a text prompt while preserving composition.

Request Body

FieldTypeRequiredDescription
image_urlstringYesURL of the source image
promptstringYesDescription of the transformation
modelstringNoreve-fast-edit (1 credit), zimage-i2i (2 credits), or flux2-edit (3 credits)
strengthnumberNoTransformation strength 0-1 (default: 0.75)

Credits: 1-8

POST/depth-map

Generate a depth map from an image showing relative distances from the camera.

Request Body

FieldTypeRequiredDescription
image_urlstringYesURL of the image to analyze

Useful for 3D effects, parallax scrolling, or understanding scene geometry.

Credits: FREE

POST/image-translation

Translate text within an image to another language while preserving the design.

Request Body

FieldTypeRequiredDescription
image_urlstringYesURL of the image with text to translate
target_languagestringYesTarget language (e.g., 'Spanish', 'Japanese', 'French')
source_languagestringNoSource language (auto-detected if not specified)
modelstringNogemini (3 credits), gpt-image-1.5-edit, or seedream-edit (4 credits)

Credits: 3-4

Image Generation

POST/generate

Create an image from a text description using AI.

Request Body

FieldTypeRequiredDescription
promptstringYesText description of the image to generate
modelstringNozimage (1 credit), flux2 (2 credits), gemini (8 credits), or seedream (4 credits)
aspect_ratiostringNosquare_hd, portrait_4_3, landscape_4_3 (default), landscape_16_9, portrait_16_9

Credits: 1-10

Video Generation

POST/video-generation

Generate a video from text and/or an image using AI.

Request Body

FieldTypeRequiredDescription
promptstringYesDescription of the video to generate
image_urlstringNoStarting image (required for veo31, ltx, kling)
modelstringNoveo31 (56 credits), ltx (18 credits), kling (12 credits), or sora (80 credits, text-only)
durationstringNoVideo duration in seconds (default: 5)
aspect_ratiostringNoauto, 16:9, 9:16, or 1:1
generate_audiobooleanNoGenerate audio (default: true)

Response

{
  "id": "zap_abc123",
  "video_url": "https://...",
  "credits_used": 56
}

Credit costs vary by model and duration. veo31, ltx, and kling require an input image. Only sora supports text-to-video.

Credits: 10-80 (varies by duration)

3D Model Generation

POST/image-to-3d

Generate a 3D model from an image using AI.

Request Body

FieldTypeRequiredDescription
image_urlstringYesURL of the image to convert
modelstringNotrellis (2 credits), meshy-multi (25 credits), meshy (50 credits), or seed3d (50 credits)
topologystringNotriangle (default) or quad
enable_pbrbooleanNoEnable PBR textures (default: true)

Response

{
  "id": "zap_abc123",
  "model_url": "https://...",
  "glb_url": "https://...",
  "obj_url": "https://...",
  "fbx_url": "https://...",
  "usdz_url": "https://...",
  "thumbnail_url": "https://...",
  "credits_used": 50
}

Credits: 2-50

E-commerce Tools

POST/product-lifestyle

Place a product in a realistic lifestyle scene for marketing.

Request Body

FieldTypeRequiredDescription
image_urlstringYesURL of the product image (ideally with transparent background)
scene_descriptionstringYesDescription of the lifestyle scene
positionstringNobottom_center (default), bottom_left, bottom_right, or center_horizontal

Credits: 4

POST/virtual-try-on

Virtually try clothing on a person using AI.

Request Body

FieldTypeRequiredDescription
person_image_urlstringYesURL of the person/model image
garment_image_urlstringYesURL of the clothing item

Best results with clear, front-facing photos and flat-lay or mannequin shots of the garment.

Credits: 4

POST/product-description

Generate AI-powered product descriptions from product info and/or images.

Request Body

FieldTypeRequiredDescription
namestringYesProduct name
image_urlstringNoURL of product image for visual analysis
specsstringNoProduct specifications
featuresstringNoKey features to highlight
stylestringNoprofessional (default), casual, luxury, technical, or playful
lengthstringNoshort, medium (default), or long
languagestringNoLanguage code (default: en)

Response

{
  "id": "zap_abc123",
  "description": "Introducing the...",
  "style": "professional",
  "length": "medium",
  "language": "en",
  "credits_used": 1
}

Credits: 1

POST/image-review

AI-powered image quality review and validation for e-commerce.

Request Body

FieldTypeRequiredDescription
image_urlstringYesURL of the image to review
check_backgroundbooleanNoCheck for white/clean background (default: true)
check_watermarkbooleanNoCheck for watermarks (default: true)
check_centeredbooleanNoCheck if subject is centered (default: false)
check_shadowsbooleanNoCheck for unwanted shadows (default: false)
min_widthnumberNoMinimum required width in pixels
min_heightnumberNoMinimum required height in pixels

Response

{
  "id": "zap_abc123",
  "passed": true,
  "results": [
    { "check": "white_background", "passed": true, "message": "Background is white/clean", "confidence": 95 }
  ],
  "summary": { "total_checks": 2, "passed_checks": 2, "failed_checks": 0 },
  "credits_used": 2
}

Dimension checks (min_width, min_height) are free. Each AI check costs 1 credit.

Credits: 1 per AI check

Utilities

POST/upload

Upload an image file directly for processing. Useful for localhost or password-protected sources.

Request Body

FieldTypeRequiredDescription
filefileYesImage file (multipart/form-data). Max 10MB. Formats: JPEG, PNG, GIF, WebP, AVIF, HEIC

Response

{
  "id": "zap_abc123",
  "url": "https://fal.media/files/...",
  "filename": "product.jpg",
  "size": 245832,
  "content_type": "image/jpeg"
}

Returns a temporary URL valid for 24 hours. Use this URL with other processing endpoints.

Credits: FREE

POST/alt-text

Generate descriptive alt text for an image using AI vision.

Request Body

FieldTypeRequiredDescription
image_urlstringYesURL of the image to describe
detail_levelstringNocaption (brief), detailed-caption (default), or more-detailed-caption

Response

{
  "id": "zap_abc123",
  "alt_text": "A red leather handbag with gold hardware...",
  "credits_used": 1
}

Credits: 1

Batch Processing

Process multiple images in a single request. Jobs run asynchronously - submit a batch and poll for results.

Workflow

  1. Submit batch request → receive job_id
  2. Poll /batch/status/{job_id} until status is completed
  3. Retrieve results from the status response

Batch Limits by Tier

TierMax Images per Batch
FreeNot available
Basic100
Business250
Pro500
Enterprise1,000
POST/batch/remove-bg

Remove backgrounds from multiple images asynchronously.

Request Body

FieldTypeRequiredDescription
imagesarrayYesArray of image objects
images[].idstringYesUnique identifier for tracking (returned in results)
images[].image_urlstringYesURL of the image to process
modelstringNobirefnet (default), birefnet-v2, or bria

Response

{
  "id": "zap_abc123",
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "queued",
  "total": 3,
  "estimated_credits": 3,
  "poll_url": "/api/zapier/batch/status/550e8400-...",
  "message": "Batch job queued for processing."
}

Credits: 1-2 per image

POST/batch/upscale

Upscale multiple images asynchronously.

Request Body

FieldTypeRequiredDescription
imagesarrayYesArray of image objects
images[].idstringYesUnique identifier for tracking
images[].image_urlstringYesURL of the image to upscale
scalenumberNoUpscale factor: 2-4 (default: 2)
modelstringNoesrgan (default), clarity, or topaz

Response

{
  "id": "zap_abc123",
  "job_id": "550e8400-e29b-41d4-a716-446655440001",
  "status": "queued",
  "total": 2,
  "estimated_credits": 4,
  "poll_url": "/api/zapier/batch/status/550e8400-...",
  "message": "Batch job queued for processing."
}

Credits: 2-3 per image

POST/batch/alt-text

Generate alt text for multiple images asynchronously using Gemini 2.0 Flash via OpenRouter.

Request Body

FieldTypeRequiredDescription
imagesarrayYesArray of image objects
images[].idstringYesUnique identifier for tracking
images[].image_urlstringYesURL of the image to describe
detail_levelstringNocaption, detailed-caption (default), or more-detailed-caption

Response

{
  "id": "zap_abc123",
  "job_id": "550e8400-e29b-41d4-a716-446655440002",
  "status": "queued",
  "total": 2,
  "estimated_credits": 2,
  "poll_url": "/api/zapier/batch/status/550e8400-...",
  "message": "Batch job queued for processing."
}

Credits: 1 per image

GET/batch/status/{jobId}

Check the status of a batch job and retrieve results when complete.

Request Headers

FieldTypeRequiredDescription
jobIdpathYesThe batch job ID returned from a batch endpoint

Response

// In progress:
{
  "job_id": "550e8400-...",
  "status": "processing",
  "total": 10,
  "completed": 4,
  "failed": 0,
  "pending": 6,
  "progress": 40,
  "credits_used": 4
}

// Completed (image results):
{
  "job_id": "550e8400-...",
  "status": "completed",
  "total": 3,
  "completed": 3,
  "failed": 0,
  "results": [
    { "id": "product-001", "status": "success", "image_url": "https://..." },
    { "id": "product-002", "status": "success", "image_url": "https://..." }
  ]
}

// Completed (alt text results):
{
  "job_id": "550e8400-...",
  "status": "completed",
  "results": [
    { "id": "img-001", "status": "success", "alt_text": "A red handbag..." }
  ]
}

Status values: pending, queued, processing, completed, failed. Results include image_url for image operations or alt_text for alt text operations.

Credits: FREE

WordPress Integration

Two authentication methods for WordPress plugins: OAuth flow (browser-based) or direct Sirv credentials exchange.

OAuth Flow (Recommended)

Browser-based authentication where users log in to Sirv AI Studio and get redirected back with an API key.

  1. Redirect user to /api/auth/wordpress/oauth with redirect_uri
  2. User logs in or signs up on Sirv AI Studio
  3. User is redirected back to WordPress with api_key in URL params
  4. Store the API key and use it for subsequent API calls
GET/api/auth/wordpress/oauth

Initiate OAuth flow. Redirects user to login, then back to WordPress with API key.

Request Headers

FieldTypeRequiredDescription
redirect_uristringYesWordPress admin callback URL (must contain wp-admin or admin.php, HTTPS in production)
site_urlstringNoWordPress site URL for tracking
statestringNoCSRF protection token (returned unchanged)

Response

// User is redirected to redirect_uri with these query params:
?api_key=sk_live_xxx
&credits=100
&tier=PRO
&sirv_plan=Business
&state=your_state_token

// On error:
?error=oauth_failed&state=your_state_token

redirect_uri must be HTTPS in production and contain 'wp-admin' or 'admin.php' in the path.

Credits: FREE

Direct Sirv Credentials (Alternative)

For plugins that already have access to Sirv API credentials, exchange them directly for an API key without browser redirect.

POST/api/auth/wordpress

Exchange Sirv API credentials for a Sirv AI Studio API key. Creates account if user doesn't exist.

Request Body

FieldTypeRequiredDescription
emailstringYesUser's email address
clientIdstringYesSirv API client ID
clientSecretstringYesSirv API client secret
accountAliasstringYesSirv account alias
cdnUrlstringNoCustom CDN URL (defaults to {alias}.sirv.com)

Response

{
  "success": true,
  "api_key": "sk_live_abc123...",
  "credits": 70,
  "tier": "FREE",
  "sirv_plan": "Business 50",
  "is_new_user": false
}

Validates credentials against Sirv API. New users receive 20 welcome credits + Sirv plan bonus (Business: 50, Enterprise: 150).

Credits: FREE

PHP Example (OAuth)

// 1. Redirect to OAuth
$oauth_url = 'https://www.sirv.studio/api/auth/wordpress/oauth?' . http_build_query([
    'redirect_uri' => admin_url('admin.php?page=sirv-ai-callback'),
    'site_url' => home_url(),
    'state' => wp_create_nonce('sirv_oauth'),
]);
wp_redirect($oauth_url);

// 2. Handle callback
if (isset($_GET['api_key']) && wp_verify_nonce($_GET['state'], 'sirv_oauth')) {
    update_option('sirv_studio_api_key', sanitize_text_field($_GET['api_key']));
    update_option('sirv_studio_credits', intval($_GET['credits']));
}

Response Format

All successful responses include:

{
  "id": "zap_1234567890_abc123",
  "image_url": "https://...",  // or video_url, model_url, alt_text, etc.
  "credits_used": 1
}

Error Codes

CodeHTTPDescription
UNAUTHORIZED401Missing or invalid Authorization header
INVALID_API_KEY401API key is invalid or revoked
INSUFFICIENT_CREDITS402Not enough credits for this operation
BATCH_LIMIT_EXCEEDED403Batch size exceeds your plan's limit
VALIDATION_ERROR400Invalid request parameters
RATE_LIMITED429Too many requests, please slow down
PAYLOAD_TOO_LARGE413File exceeds maximum size (10MB)
INTERNAL_ERROR500Server error, please try again

Rate Limits

TierRequests/Hour
Free20
Starter100
Pro500
Business2,000

Code Examples

cURL

curl -X POST https://www.sirv.studio/api/zapier/remove-bg \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image_url": "https://example.com/photo.jpg"}'

JavaScript/TypeScript

const response = await fetch('https://www.sirv.studio/api/zapier/remove-bg', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    image_url: 'https://example.com/photo.jpg'
  }),
});

const result = await response.json();
console.log(result.image_url); // Processed image URL

Python

import requests

response = requests.post(
    'https://www.sirv.studio/api/zapier/remove-bg',
    headers={
        'Authorization': 'Bearer sk_live_YOUR_API_KEY',
        'Content-Type': 'application/json',
    },
    json={'image_url': 'https://example.com/photo.jpg'}
)

result = response.json()
print(result['image_url'])  # Processed image URL

Integrations

Use Sirv AI Studio with your favorite automation tools: