Skip to main content
POST
/
v1
/
phota
/
edit
Edit
curl --request POST \
  --url https://api.photalabs.com/v1/phota/edit \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "prompt": "",
  "images": [
    "<string>"
  ],
  "profile_ids": [
    "<string>"
  ],
  "num_output_images": 1,
  "aspect_ratio": "auto",
  "resolution": "1K",
  "base_model": "nb2",
  "output_format": "png",
  "response_mode": "bytes"
}
'
{
  "known_subjects": {
    "counts": {}
  },
  "images": [
    "<string>"
  ],
  "download_urls": [
    "<string>"
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.photalabs.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required

Body

application/json

Request body for the edit endpoint.

Input images can be provided as either raw base64-encoded bytes or publicly accessible URLs (e.g. https://example.com/photo.jpg). Both formats are accepted and detected automatically.

prompt
string
default:""

Text prompt describing the desired edit.

images
string[]

Input images as raw base64 strings or publicly accessible URLs. Both formats are auto-detected. Supported formats: JPEG, PNG, WebP, and HEIC/HEIF. Images larger than 4K (4096px) are automatically resized; for best results, provide images at 4K or below.

Maximum array length: 10
profile_ids
string[]

Subset of your account's profiles relevant to this request. Your account holds all profiles, but only pass the ones belonging to the end-user whose photo is being edited. These profiles serve as candidates for identity preservation. The fewer profiles you pass, the easier it is for our system to determine which profiles are relevant.

num_output_images
integer
default:1

Number of output images to generate (1-4).

Required range: 1 <= x <= 4
aspect_ratio
enum<string>
default:auto

Output aspect ratio (auto, 1:1, 3:4, 4:3, 9:16, 16:9).

Available options:
auto,
1:1,
3:4,
4:3,
9:16,
16:9
resolution
enum<string>
default:1K

Output resolution (1K, 4K).

Available options:
1K,
4K
base_model
enum<string>
default:nb2

Base model identifier. Omit to use the default base model. Unknown ids are rejected with 400; base models that do not support this endpoint's capability are also rejected with 400.

Available options:
flux-2,
gpt-image-2,
nb2,
qwen-image-2,
reve
output_format
enum<string>
default:png

Output image format (png, jpg). Default: png (will change to jpg on 2026-05-08).

Available options:
png,
jpg
response_mode
enum<string>
default:bytes

Response delivery mode. 'bytes': return base64-encoded image data (default). 'urls': return signed download URLs (24-hour expiry) instead of image bytes.

Available options:
bytes,
urls

Response

Successful Response

Response returned by the edit, generate, and enhance endpoints.

known_subjects
KnownGeneratedSubjectCounts · object
required

Dictionary mapping a known subject's profile_id to the number of times they were generated. If multiple variations are generated, this will be the aggregated count across all variations.

images
string[]

Output image(s) as raw base64-encoded strings. Format matches the requested output_format. Populated when response_mode='bytes', empty otherwise.

download_urls
string[]

Signed download URLs for each output image (24-hour expiry). Populated when response_mode='urls', empty otherwise.