Wixma API v1

Wixma API Reference

Generate, edit, photograph, and upscale images through one async API. This page explains every endpoint, every tool option, image input format, concurrency limit, response shape, and error code.

Quickstart

  1. 1. Open Settings, create an API key, choose scopes, budgets, rate limit, and allowed tools.
  2. 2. Upload images with POST /api/v1/uploads, reuse a generation output_url, or pass a supported image reference object.
  3. 3. Start a job with POST /api/v1/generations.
  4. 4. Poll GET /api/v1/generations/{id} until status is completed or failed.
curl https://wixma.ai/api/v1/generations \
  -H "Authorization: Bearer wx_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: product-shot-001" \
  -d '{
    "tool": "generator",
    "input": { "prompt": "A premium studio product photo of a red sneaker" },
    "options": { "quality": "medium", "aspect_ratio": "1:1", "output_format": "png" }
  }'

Core Concepts

Async jobs

Create calls return quickly with a generation id. Wixma processes the job in the background. Poll the job until it reaches a terminal state.

Credits and budgets

API jobs use your normal Wixma credits at the same prices. Per-key budgets are reserved atomically in Postgres when a generation is created.

Authentication, Scopes, and Budgets

Send your key as Authorization: Bearer wx_live_.... API access requires an active paid subscription. Keys can be scoped, paused, revoked, limited by tool, rate-limited, and capped by monthly/total/per-request credits.

generations:createscopeRequired for `POST /api/v1/generations` and MCP creation tools.
generations:readscopeRequired for generation polling and listing.
uploads:createscopeRequired for image uploads.
credits:readscopeRequired for credit and budget reads.
Idempotency-KeyheaderRecommended for create calls. Same key + same body returns the existing job; same key + different body returns `idempotency_conflict`.

Images: Uploads, URLs, History, and IDs

Image fields accept safe HTTPS image URLs or reference objects. Supported formats are PNG, JPEG, and WEBP up to 50MB.

"https://.../image.jpg"string URLUse a safe HTTPS URL from Wixma upload, generation history, Supabase storage, Fal/OpenAI CDN, Cloudinary, Imgix, or Unsplash.
{ "url": "https://..." }objectSame as URL string, useful when building typed clients.
{ "upload_id": "..." }objectReuse an upload created by the same API key. `POST /api/v1/uploads` returns this id.
{ "generation_id": "..." }objectReuse the `output_url` from a completed generation in the same Wixma account.
{
  "input": {
    "images": [
      { "upload_id": "upload_uuid_here" },
      { "generation_id": "generation_uuid_here" },
      "https://wixma.ai/storage/v1/object/public/input_images/example.jpg"
    ]
  }
}

Concurrency and Job Limits

pending and processing generations count as active jobs. If the limit is reached, create calls return queue_limit_exceeded.

free1 active jobAPI access still requires a paid subscription.
standard2 active generation slotsCarousel is available from Standard because it uses 2 slots.
plus4 active generation slotsRun two carousel jobs or several regular jobs in parallel.
pro6 active generation slotsHighest concurrency for production workflows.

Endpoints

POST/api/v1/uploadsUpload PNG, JPEG, or WEBP and receive an `upload.id` plus a reusable image URL.
POST/api/v1/generationsStart an async generation job for Generator, Editor, AI Photographer, or Upscaler.
GET/api/v1/generations/{id}Fetch one job status, output URL, cost, and error details.
GET/api/v1/generationsList API-created jobs with optional status/tool filters.
GET/api/v1/creditsRead credit balance, queue capacity, and API key budget usage.

Tool: Image Generator

Creates a new image from text only.

tool"generator"Required.
input.promptstringRequired, max 2000 characters. Describe the image you want.
options.qualitylow | medium | highDefaults to `medium`. Higher quality costs more credits.
options.aspect_ratiostringDefaults to `original`. See aspect ratios below.
options.output_formatpng | webp | jpegDefaults to `png`.
options.backgroundopaque | autoDefaults to `opaque`.

Tool: Image Editor

Edits one or more reference images with a prompt. Reference images are visual context; include the most important image first.

tool"editor"Required.
input.imagesimage[]Required, 1-16 image references.
input.promptstringOptional but recommended, max 4000 characters.
options.qualitylow | medium | highDefaults to `medium`.
options.aspect_ratiostringOutput shape. Use `original` to let the model decide.
options.output_formatpng | webp | jpegDefaults to `png`.

Tool: AI Photographer

AI Photographer is a set of guided photo-editing tools. The API and MCP tools use the same backend prompt builders as the dashboard. You send controlled mode values; Wixma expands them into the detailed internal prompts automatically.

input.text_prompt is only an optional additional instruction. It does not replace the backend prompt. For example, use it for constraints like "keep the same expression" or placement details.

mode: "carousel" is special: GPT-5 mini first creates a 10-frame shot plan, then Wixma generates 10 separate images. The billed credit cost is 10 × selected image quality + 10 planner credits, and the job uses 2 generation slots while pending or processing.

tool"photographer"Required.
input.main_imageimageRequired. The main subject or target scene.
input.secondary_imagesimage[]Optional, up to 3 references depending on mode.
input.mask_imageimageRequired only for `erase_edit`.
input.text_promptstringOptional additional instruction, max 2000 characters. Backend prompts remain active.
input.angleAngleValueRequired for `angle_change`. Must exactly match one dashboard cube angle listed below.
input.timeTimeValueOptional for `time_change`; defaults to `Bright Day`. Must match one time value below.
input.seasonSeasonValueOptional for `time_change`. Must match one season value below.
input.weatherWeatherValueOptional for `time_change`. Must match one weather value below.
options.modePhotographerModeRequired. See modes below.
options.selected_optiondeprecatedDo not use for new clients. Use `input.angle` or `input.time`/`input.season`/`input.weather` instead.
options.qualitylow | medium | highDefaults to `medium`.
options.aspect_ratiostringOutput aspect ratio.

Mode-specific requirements

These are the exact fields to send for each AI Photographer mode. All modes still use Wixma's backend prompt templates automatically.

person_placement`main_image` required. `secondary_images` recommended for the person, up to 3. `text_prompt` optional.`main_image` is the target/background scene. `secondary_images` are identity/person references.
angle_change`main_image` and `angle` required. `text_prompt` optional.`angle` must be one exact dashboard cube value. `text_prompt` can add constraints such as "keep expression".
cloth_change`main_image` required. `text_prompt` recommended. `secondary_images` optional, up to 3.`text_prompt` describes the target outfit. `secondary_images` can provide garment/style references.
time_change`main_image` required. `time` optional and defaults to `Bright Day`. `season`, `weather`, and `text_prompt` optional.`time`, `season`, and `weather` must use exact values from the lists below.
location_change`main_image` and `text_prompt` required. `secondary_images` optional, up to 3.`text_prompt` describes the target location or setting. Backend prompt preserves style, identity, lens feel, and lighting logic.
carousel`main_image` required. `text_prompt` optional. Uses 10 outputs and 2 generation slots.GPT-5 mini generates 10 shot prompts first. Cost is 10 × image quality cost + 10 planner credits.
object_placement`main_image` required. `text_prompt` recommended. `secondary_images` optional, up to 3.`text_prompt` describes the object and placement. `secondary_images` can provide object/style references.
erase_edit`main_image` and `mask_image` required. `text_prompt` optional.Empty `text_prompt` erases the masked area. A non-empty `text_prompt` describes what to fill into the mask.

Person Placement

person_placement

Use `main_image` as the target scene. Use `secondary_images` as identity/person references. Wixma composites the person naturally into the scene.

Angle Change

angle_change

Use `input.angle` with one exact dashboard cube value from the Angle values list. Wixma builds the detailed camera prompt internally.

Cloth Change

cloth_change

Describe the new outfit in `input.text_prompt`. Optional `secondary_images` can act as garment/style references.

Time And Atmosphere

time_change

Use `input.time`, optional `input.season`, and optional `input.weather`. Values must match the dashboard selector exactly.

Location Change

location_change

Describe the target location or setting in `input.text_prompt`. Wixma preserves the same subject, camera feel, color grade, and photo style while changing the environment.

Object Placement

object_placement

Insert an object described by `text_prompt`; optional reference images can define the object style.

Erase / Edit Mask

erase_edit

Requires `mask_image`. Only the masked area is replaced or removed; unmasked pixels should remain stable.

Angle values

For mode: "angle_change", input.angle must be one of these exact dashboard cube values.

bird's eye view, frontbird's eye view, front-rightbird's eye view, right sidebird's eye view, rear-rightbird's eye view, rearbird's eye view, rear-leftbird's eye view, left sidebird's eye view, front-lefthigh angle, fronthigh angle, front-righthigh angle, right sidehigh angle, rear-righthigh angle, rearhigh angle, rear-lefthigh angle, left sidehigh angle, front-lefteye level, fronteye level, front-righteye level, right sideeye level, rear-righteye level, reareye level, rear-lefteye level, left sideeye level, front-leftlow angle, frontlow angle, front-rightlow angle, right sidelow angle, rear-rightlow angle, rearlow angle, rear-leftlow angle, left sidelow angle, front-leftworm's eye view, frontworm's eye view, front-rightworm's eye view, right sideworm's eye view, rear-rightworm's eye view, rearworm's eye view, rear-leftworm's eye view, left sideworm's eye view, front-left

Time, season, and weather values

For mode: "time_change", combine one time with optional season and weather. Wixma composes the same internal atmosphere string used by the dashboard.

Deep Night

Time / lighting selector value.

Neon Night

Time / lighting selector value.

Blue Hour

Time / lighting selector value.

Dawn

Time / lighting selector value.

Bright Day

Time / lighting selector value.

Golden Hour

Time / lighting selector value.

Dusk

Time / lighting selector value.

Spring

spring color palette with fresh greens and soft seasonal light, no precipitation unless selected as weather

Summer

summer color palette with warmer light and saturated greenery, no precipitation unless selected as weather

Autumn

autumn color palette with warmer orange foliage and softer light, no precipitation unless selected as weather

Winter

winter color palette with cool tones and crisp light only; do not add snow unless Snowy weather is selected

Clear

clear clean sky, bright natural visibility, no clouds, no rain, no snow, no fog

Cloudy

clearly visible soft gray and white clouds across the sky, diffused overcast light, no rain or snow

Rainy

dark gray storm clouds, visibly falling blue-white rain streaks and droplets, wet reflective surfaces, moody low light

Snowy

very bright snowy atmosphere with a few soft clouds and visible white to pale blue falling snowflakes, no rain

Foggy

visible mist and low fog layers with softened contrast and diffused light, no rain or snow

Tool: Upscaler

Upscales a source image. Finish settings are intentionally not exposed through the public API.

tool"upscaler"Required.
input.imageimageRequired. URL, upload reference, or generation reference.
options.scale2 | 4 | "4k"Defaults to `2`. `4k` targets 2160p output.
options.noise_scalenumber0 to 0.5. Lower keeps closer to source; higher may smooth/reconstruct more aggressively. Default `0.1`.

Shared Option Reference

Aspect ratios

original

Original · Auto · auto

2.4:1

2.4:1 · Cinematic · 2400x1008

21:9

21:9 · Ultra Wide · 2560x1088

16:9

16:9 · Landscape · 2048x1152

3:2

3:2 · Photo · 1920x1280

4:3

4:3 · Classic · 1920x1440

1:1

1:1 · Square · 1536x1536

4:5

4:5 · IG Post · 1536x1920

3:4

3:4 · Portrait · 1536x2048

2:3

2:3 · Tall Photo · 1360x2032

9:16

9:16 · Reels · 1440x2560

Quality

low

Lowest credit cost. Good for drafts, quick tests, and prompt iteration.

medium

Balanced default for most production workflows.

high

Best detail and fidelity. Highest credit cost and usually slower.

Output formats

png

Default. Best when you want lossless output or transparency-capable workflows.

webp

Smaller files for web delivery.

jpeg

Small, widely compatible files for photos.

Examples

Upload then edit

const form = new FormData()
form.append("file", file)

const upload = await fetch("https://wixma.ai/api/v1/uploads", {
  method: "POST",
  headers: { Authorization: "Bearer wx_live_..." },
  body: form
}).then(r => r.json())

await fetch("https://wixma.ai/api/v1/generations", {
  method: "POST",
  headers: {
    Authorization: "Bearer wx_live_...",
    "Content-Type": "application/json",
    "Idempotency-Key": "edit-001"
  },
  body: JSON.stringify({
    tool: "editor",
    input: {
      images: [{ upload_id: upload.upload.id }],
      prompt: "Make the background look like a luxury studio."
    },
    options: { quality: "medium", aspect_ratio: "4:5" }
  })
})

AI Photographer angle change

{
  "tool": "photographer",
  "input": {
    "main_image": { "generation_id": "previous_generation_uuid" },
    "angle": "eye level, left side",
    "text_prompt": "Keep the same outfit and expression."
  },
  "options": {
    "mode": "angle_change",
    "quality": "high",
    "aspect_ratio": "4:5"
  }
}

AI Photographer carousel

{
  "tool": "photographer",
  "input": {
    "main_image": { "generation_id": "previous_generation_uuid" },
    "text_prompt": "Create a fashion carousel with the same scene, varied angles, detail shots, POV moments, and one full-body hero shot."
  },
  "options": {
    "mode": "carousel",
    "quality": "medium",
    "aspect_ratio": "4:5"
  }
}

Poll until complete

async function waitForGeneration(id) {
  while (true) {
    const res = await fetch(`https://wixma.ai/api/v1/generations/${id}`, {
      headers: { Authorization: "Bearer wx_live_..." }
    })
    const data = await res.json()
    const generation = data.generation
    if (generation.status === "completed" || generation.status === "failed") return generation
    await new Promise(resolve => setTimeout(resolve, 3000))
  }
}

Responses

{
  "object": "response",
  "request_id": "req_...",
  "generation": {
    "id": "gen_uuid",
    "object": "generation",
    "status": "pending",
    "tool": "generator",
    "output_url": null,
    "input_image": null,
    "cost_credits": 110,
    "error_code": null,
    "error": null,
    "created_at": "2026-06-07T10:00:00.000Z"
  }
}
{
  "object": "error",
  "error": {
    "code": "queue_limit_exceeded",
    "message": "Your plus plan allows 4 active generation slots at once. This request needs 2 slots.",
    "details": { "active": 4, "limit": 4, "plan": "plus", "requiredSlots": 2 }
  },
  "request_id": "req_..."
}

Errors

Errors are stable JSON objects with error.code, error.message, optional error.details, and request_id.

unauthorizedMissing or invalid Bearer key.Create a new API key and send `Authorization: Bearer wx_live_...`.
forbiddenKey is paused/revoked/expired or missing a required scope.Enable the key, check scopes, or create a new key.
subscription_requiredAPI access needs an active paid plan.Activate Standard, Plus, or Pro.
invalid_inputRequest body, URL, file, mode, aspect ratio, or image reference is invalid.Fix the field named in the message and retry.
insufficient_creditsThe account does not have enough credits for the job.Add credits or use a lower-cost quality/scale.
queue_limit_exceededThe account already has the maximum active jobs.Wait until a `pending` or `processing` job completes.
monthly_budget_exceededThe API key monthly credit budget is reached.Increase the key budget in Settings or wait for the next month.
total_budget_exceededThe API key lifetime credit budget is reached.Increase total budget or create a new key.
per_request_limit_exceededThis job costs more than the key allows per request.Raise per-request limit or lower quality/scale.
tool_not_allowedThe API key is not allowed to use this tool.Enable the tool in API key settings.
rate_limit_exceededToo many calls in the last minute.Back off and retry later.
idempotency_conflictSame `Idempotency-Key`, different request body.Use a new key for a different request body.
service_unavailableProvider or required service is temporarily unavailable.Try again later.

MCP Server

Connect Claude, Cursor, and other MCP clients to Wixma through the remote Streamable HTTP endpoint. The server uses browser authorization, so you do not paste API keys into Cursor.

{
  "mcpServers": {
    "wixma": {
      "url": "https://wixma.ai/mcp"
    }
  }
}
npx mcp-remote https://wixma.ai/mcp

Available MCP tools: wixma_upload_image, wixma_generate_image, wixma_edit_image, wixma_photographer, wixma_ai_filter, wixma_upscale_image, wixma_get_generation, wixma_list_generations, and wixma_get_credits. The MCP endpoint also answers standard ping health checks.

Input images are always passed as public HTTPS URLs. wixma_upload_image imports a URL once and returns a reusable upload_id; the generation tools also accept HTTPS URLs directly. Base64 and data URLs are rejected by design — writing image bytes into tool arguments makes MCP clients appear to hang. Wixma downloads the URL server-side, validates the real PNG/JPEG/WEBP bytes and dimensions, and rejects anything unusable before a provider job starts. The returned main_image can be passed directly to wixma_photographer, and the returned images array can be passed directly to wixma_edit_image.

When a generation is completed, wixma_get_generation returns the result both as a URL and as inline MCP image content, so clients like Claude render the finished image directly in the conversation.

wixma_ai_filter applies one of the curated Wixma AI filters (such as golden-backlight, blue-hour, polaroid, cinematic-still, noir-bw) to a photo. The professional prompts behind each filter are fixed and stay server-side; clients only choose a filter id.

// 1. Import an image from a public HTTPS URL
{
  "name": "wixma_upload_image",
  "arguments": {
    "url": "https://example.com/photo.jpg"
  }
}

// 2. Use the returned main_image
{
  "name": "wixma_photographer",
  "arguments": {
    "mode": "cloth_change",
    "main_image": { "upload_id": "upload_uuid_here" },
    "text_prompt": "elegant dark navy business suit",
    "quality": "medium",
    "aspect_ratio": "4:5"
  }
}
// Apply a curated AI filter (fixed, server-side prompt)
{
  "name": "wixma_ai_filter",
  "arguments": {
    "filter": "golden-backlight",
    "image": { "upload_id": "upload_uuid_here" },
    "quality": "medium"
  }
}
// Sequential edits: poll the first job, then use its generation id
{
  "name": "wixma_photographer",
  "arguments": {
    "mode": "location_change",
    "main_image": { "generation_id": "completed_generation_uuid" },
    "text_prompt": "ultra-realistic iPhone photo in a courtroom",
    "quality": "high",
    "aspect_ratio": "original"
  }
}