| Method | Path | Body |
|---|---|---|
| POST | /v2/image |
multipart — image_file |
| POST | /v2/image/estimate-credits |
JSON |
| POST | /v2/image/text-2-image |
JSON |
| POST | /v2/image/image-2-image |
JSON — image_url |
| POST | /v2/image/elements |
JSON — image_urls |
| POST | /v2/image/replace-background |
JSON |
| POST | /v2/image/edit-image |
JSON |
| POST | /v2/image/face-swap |
JSON — image_urls |
| POST | /v2/image/try-on |
JSON — human + clothes URLs |
image_url / image_urls.results on the asset. Use async_mode: true when supported; poll until status is success.data wrapperresults; poll by asset id when async_mode is trueX-Api-Key: YOUR_API_KEY on every request.
Legacy form-data routes (with data wrapper on some responses) remain at /image/*, /video/*, /audio/*, and /text/* (tagged (Legacy) in the schema).
Uploads an image file to Vimmerse storage so you can reference it by URL in other POST /v2/image/ routes.
This is the only v2 image route that uses multipart/form-data. All generation and edit routes expect JSON with image_url or image_urls.
JPEG, PNG, WebP (including transparency where supported).
import requests
url = "https://api.vimmerse.net/v2/image"
headers = {"X-Api-Key": "YOUR_API_KEY"}
with open("/path/to/photo.png", "rb") as f:
response = requests.post(
url,
headers=headers,
files={"image_file": ("photo.png", f, "image/png")},
timeout=120,
)
response.raise_for_status()
asset = response.json()
print(asset["results"]) # uploaded file URL(s)
New Image URLs
Bad Request
Insufficient Credit
Validation Error
{- "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
- "customer_id": "customer123",
- "primary_user_id": "user-abc-123",
- "args": {
- "prompt": "A serene landscape with mountains and a lake at sunset",
- "quantity": 1,
- "option": "AutoI",
- "aspect_ratio": "16:9",
- "enhance_image": false,
- "async_mode": false
}, - "thumbnails": [ ],
- "status": "success",
- "mime_type": "image/png",
- "app_name": "text-to-image",
- "quantity": 1,
- "credits": 12,
- "created_at": "2025-05-06T16:35:59.840508+00:00",
- "updated_at": "2025-05-06T16:36:12.102933+00:00",
- "history": [ ]
}Returns how many credits an image generation request would charge for the given app_name, option, quantity, and optional prompt, without creating an asset.
Uses the same billing rules as POST /v2/image/ generation routes. Send Content-Type: application/json.
import requests
url = "https://api.vimmerse.net/v2/image/estimate-credits"
headers = {"Content-Type": "application/json"}
payload = {
"app_name": "text-to-image",
"option": "NanoBanana",
"quantity": 2,
"prompt": "Product photo of running shoes on a gradient background",
}
response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.json())
Credit estimate and breakdown
Validation Error
{- "total_credits": 0,
- "breakdown": { }
}Generates one or more images from a text prompt.
Send Content-Type: application/json. The response is an asset object; output URLs are in results.
| Field | Type | Default | Description |
|---|---|---|---|
prompt |
string | — | Text description of the desired image |
quantity |
integer | 1 |
Number of images (1–4) |
option |
string | AutoI |
Model/tool; AutoI picks automatically |
aspect_ratio |
string | 16:9 |
e.g. 21:9, 16:9, 4:3, 1:1, 9:16 |
enhance_image |
boolean | false |
Apply 1× super-resolution post-processing |
async_mode |
boolean | false |
Return immediately with status: processing |
webhook_url |
string | — | Optional callback URL when complete |
import requests
url = "https://api.vimmerse.net/v2/image/text-2-image"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"prompt": "A serene landscape with mountains and a lake at sunset, cinematic lighting",
"quantity": 2,
"option": "AutoI",
"aspect_ratio": "16:9",
"enhance_image": False,
"async_mode": False,
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
asset = response.json()
print(asset["id"], asset["status"], asset["results"])
Authorization (string) or Authorization (null) (Authorization) | |
Username (string) or Username (null) (Username) | |
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type) |
Asset with generated image URL(s) in results
Bad Request
Insufficient Credit
Validation Error
{- "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
- "customer_id": "customer123",
- "primary_user_id": "user-abc-123",
- "args": {
- "prompt": "A serene landscape with mountains and a lake at sunset",
- "quantity": 1,
- "option": "AutoI",
- "aspect_ratio": "16:9",
- "enhance_image": false,
- "async_mode": false
}, - "thumbnails": [ ],
- "status": "success",
- "mime_type": "image/png",
- "app_name": "text-to-image",
- "quantity": 1,
- "credits": 12,
- "created_at": "2025-05-06T16:35:59.840508+00:00",
- "updated_at": "2025-05-06T16:36:12.102933+00:00",
- "history": [ ]
}Transforms or reimagines a source image using a text prompt.
Provide image_url (from upload or any public HTTPS URL). Response asset URLs are in results.
| Field | Type | Default | Description |
|---|---|---|---|
image_url |
string | required | Source image URL |
prompt |
string | "" |
Desired edits or style |
option |
string | AutoI |
Edit model/mode |
aspect_ratio |
string | — | Optional output ratio |
quantity |
integer | 1 |
Variations (1–4) |
enhance_image |
boolean | false |
Super-resolution post-processing |
async_mode |
boolean | false |
Async processing |
webhook_url |
string | — | Optional callback |
import requests
url = "https://api.vimmerse.net/v2/image/image-2-image"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"image_url": "https://media.vimmerse.net/example/uploads/shoe.png",
"prompt": "Make the shoe blue with a sky background",
"option": "AutoI",
"aspect_ratio": "16:9",
"quantity": 1,
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])
Authorization (string) or Authorization (null) (Authorization) | |
Username (string) or Username (null) (Username) | |
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type) |
Asset with generated image URL(s) in results
Bad Request
Insufficient Credit
Validation Error
{- "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
- "customer_id": "customer123",
- "primary_user_id": "user-abc-123",
- "args": {
- "prompt": "A serene landscape with mountains and a lake at sunset",
- "quantity": 1,
- "option": "AutoI",
- "aspect_ratio": "16:9",
- "enhance_image": false,
- "async_mode": false
}, - "thumbnails": [ ],
- "status": "success",
- "mime_type": "image/png",
- "app_name": "text-to-image",
- "quantity": 1,
- "credits": 12,
- "created_at": "2025-05-06T16:35:59.840508+00:00",
- "updated_at": "2025-05-06T16:36:12.102933+00:00",
- "history": [ ]
}Generates or edits an image using a main image plus reference images (characters, objects, environments).
Pass all images as image_urls: the first URL is the main image; the rest are references. Limits depend on option (see field description in the schema).
import requests
url = "https://api.vimmerse.net/v2/image/elements"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"image_urls": [
"https://media.vimmerse.net/example/main.png",
"https://media.vimmerse.net/example/ref_character.png",
],
"prompt": "Place the character naturally in the scene, photorealistic",
"option": "AutoI",
"aspect_ratio": "16:9",
"quantity": 1,
"swap_faces": False,
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])
Authorization (string) or Authorization (null) (Authorization) | |
Username (string) or Username (null) (Username) | |
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type) |
Asset with generated image URL(s) in results
Bad Request
Insufficient Credit
Validation Error
{- "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
- "customer_id": "customer123",
- "primary_user_id": "user-abc-123",
- "args": {
- "prompt": "A serene landscape with mountains and a lake at sunset",
- "quantity": 1,
- "option": "AutoI",
- "aspect_ratio": "16:9",
- "enhance_image": false,
- "async_mode": false
}, - "thumbnails": [ ],
- "status": "success",
- "mime_type": "image/png",
- "app_name": "text-to-image",
- "quantity": 1,
- "credits": 12,
- "created_at": "2025-05-06T16:35:59.840508+00:00",
- "updated_at": "2025-05-06T16:36:12.102933+00:00",
- "history": [ ]
}Removes, replaces, or restyles the background of an image.
option |
image2_url |
Behavior |
|---|---|---|
RemoveBackground |
omit | Transparent PNG foreground |
ReplaceBackground |
required | New background image |
RestyleBackground |
required | Style reference image |
import requests
url = "https://api.vimmerse.net/v2/image/replace-background"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"image_url": "https://media.vimmerse.net/example/product.png",
"option": "RemoveBackground",
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])
payload = {
"image_url": "https://media.vimmerse.net/example/product.png",
"image2_url": "https://media.vimmerse.net/example/studio_bg.png",
"option": "ReplaceBackground",
}
Authorization (string) or Authorization (null) (Authorization) | |
Username (string) or Username (null) (Username) | |
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type) |
Asset with modified image URL(s) in results
Bad Request
Insufficient Credit
Validation Error
{- "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
- "customer_id": "customer123",
- "primary_user_id": "user-abc-123",
- "args": {
- "prompt": "A serene landscape with mountains and a lake at sunset",
- "quantity": 1,
- "option": "AutoI",
- "aspect_ratio": "16:9",
- "enhance_image": false,
- "async_mode": false
}, - "thumbnails": [ ],
- "status": "success",
- "mime_type": "image/png",
- "app_name": "text-to-image",
- "quantity": 1,
- "credits": 12,
- "created_at": "2025-05-06T16:35:59.840508+00:00",
- "updated_at": "2025-05-06T16:36:12.102933+00:00",
- "history": [ ]
}Edits an image: remove text, upscale, reframe, expand aspect ratio, or inpaint masked regions.
option |
Required fields |
|---|---|
RemoveText |
image_url |
Upscale |
image_url |
ExpandToAspectRatio |
image_url, aspect_ratio |
Inpaint |
image_url, mask_url, prompt |
LumaReframe |
image_url, reframe_parameters |
import requests
url = "https://api.vimmerse.net/v2/image/edit-image"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"image_url": "https://media.vimmerse.net/example/sign.png",
"option": "RemoveText",
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])
payload = {
"image_url": "https://media.vimmerse.net/example/room.png",
"mask_url": "https://media.vimmerse.net/example/room_mask.png",
"option": "Inpaint",
"prompt": "Add a mountain view through the window",
"quantity": 1,
}
Authorization (string) or Authorization (null) (Authorization) | |
Username (string) or Username (null) (Username) | |
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type) |
Asset with modified image URL(s) in results
Bad Request
Insufficient Credit
Validation Error
{- "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
- "customer_id": "customer123",
- "primary_user_id": "user-abc-123",
- "args": {
- "prompt": "A serene landscape with mountains and a lake at sunset",
- "quantity": 1,
- "option": "AutoI",
- "aspect_ratio": "16:9",
- "enhance_image": false,
- "async_mode": false
}, - "thumbnails": [ ],
- "status": "success",
- "mime_type": "image/png",
- "app_name": "text-to-image",
- "quantity": 1,
- "credits": 12,
- "created_at": "2025-05-06T16:35:59.840508+00:00",
- "updated_at": "2025-05-06T16:36:12.102933+00:00",
- "history": [ ]
}Swaps faces in a target image using one or more reference face images.
image_urls[0] — target image containing face(s) to replace image_urls[1:] — reference faces order_indices — optional mapping of target face indices (left-to-right from 0)import requests
url = "https://api.vimmerse.net/v2/image/face-swap"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"image_urls": [
"https://media.vimmerse.net/example/group_photo.png",
"https://media.vimmerse.net/example/face_a.png",
"https://media.vimmerse.net/example/face_b.png",
],
"option": "NanoBananaFaceSwap",
"face_only_mode": True,
"multi_face_mode": True,
"order_indices": [0, 1],
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])
Authorization (string) or Authorization (null) (Authorization) | |
Username (string) or Username (null) (Username) | |
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type) |
Asset with face-swapped image URL(s) in results
Bad Request
Insufficient Credit
Validation Error
{- "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
- "customer_id": "customer123",
- "primary_user_id": "user-abc-123",
- "args": {
- "prompt": "A serene landscape with mountains and a lake at sunset",
- "quantity": 1,
- "option": "AutoI",
- "aspect_ratio": "16:9",
- "enhance_image": false,
- "async_mode": false
}, - "thumbnails": [ ],
- "status": "success",
- "mime_type": "image/png",
- "app_name": "text-to-image",
- "quantity": 1,
- "credits": 12,
- "created_at": "2025-05-06T16:35:59.840508+00:00",
- "updated_at": "2025-05-06T16:36:12.102933+00:00",
- "history": [ ]
}Virtual try-on: composites clothing from clothes_image_url onto the person in human_image_url.
import requests
url = "https://api.vimmerse.net/v2/image/try-on"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"human_image_url": "https://media.vimmerse.net/example/model.png",
"clothes_image_url": "https://media.vimmerse.net/example/jacket.png",
"option": "NanoBananaTryOn",
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])
Authorization (string) or Authorization (null) (Authorization) | |
Username (string) or Username (null) (Username) | |
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type) |
Asset with try-on image URL(s) in results
Bad Request
Insufficient Credit
Validation Error
{- "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
- "customer_id": "customer123",
- "primary_user_id": "user-abc-123",
- "args": {
- "prompt": "A serene landscape with mountains and a lake at sunset",
- "quantity": 1,
- "option": "AutoI",
- "aspect_ratio": "16:9",
- "enhance_image": false,
- "async_mode": false
}, - "thumbnails": [ ],
- "status": "success",
- "mime_type": "image/png",
- "app_name": "text-to-image",
- "quantity": 1,
- "credits": 12,
- "created_at": "2025-05-06T16:35:59.840508+00:00",
- "updated_at": "2025-05-06T16:36:12.102933+00:00",
- "history": [ ]
}