---
title: "Enhance"
method: POST
path: "/v2/phota/enhance"
tags: ["Studio"]
---

# Enhance

`POST /v2/phota/enhance`

## Request

- Base URL: `https://api.photalabs.com`
- URL: `https://api.photalabs.com/v2/phota/enhance`
- Auth: API key in header `X-API-Key`

Enhance a single image.

Enhancement parameters are inferred automatically. Optionally provide
a text prompt to guide the enhancement. Returns images or signed download URLs.

## Request body

- EnhanceRequest: Request body for the enhance endpoint. Enhances the provided input image without requiring a text prompt, aspect ratio, or resolution -- those parameters are inferred automatically. The image can be provided as a raw base64-encoded string or a publicly accessible URL. Both formats are accepted and detected automatically.
  - `async` boolean: Submit asynchronously. Returns 202 with a job_id to poll at GET /v1/jobs/{job_id} instead of holding the connection until the image is ready.
  - `callback_url` string, nullable: Optional https URL we POST the signed result to on completion. Best-effort (polling remains authoritative). Requires async=true.
  - `client_request_id` string, nullable: Idempotency key. A retried submit with the same value returns the original job instead of creating (and charging for) a new one.
  - `response_mode` 'bytes' | 'urls': Response delivery mode. 'bytes': return base64-encoded image data (default). 'urls': return signed download URLs (24-hour expiry) instead of image bytes.
  - `image` string, required: Input image as a raw base64 string or publicly accessible URL. 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.
  - `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: Number of output images to generate (1-4).
  - `output_format` 'png' | 'jpg': Output image format (png, jpg). Default: png (will change to jpg on 2026-05-08).
  - `prompt` string, nullable: Optional text instructions to guide the enhancement.

## Response `200`

Successful Response

- EditResponse: Response returned by the edit, generate, and enhance endpoints.
  - `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.
  - `known_subjects` KnownGeneratedSubjectCounts, required: Counts of known subjects generated, keyed by profile ID.
    - `counts` object: Mapping of profile ID to the number of times that subject was generated.

## Other responses

- `202`: Async job accepted; poll job_id at poll_url.
- `400`: Invalid request, content moderation violation, or profiles of mixed model versions.
- `401`: Invalid API key in the X-API-Key header.
- `402`: Insufficient prepaid credit balance.
- `403`: Missing X-API-Key header (no API key provided).
- `404`: Resource not found.
- `422`: No image was produced (not charged, retryable), or request validation failed.
- `500`: Internal error.
- `503`: Service temporarily unavailable.
- `504`: Synchronous request exceeded the 600s limit; resubmit with `async: true`.

---

[API](https://skmtc.dev/photalabs/apis/phota-api.md) - [All operations](https://skmtc.dev/photalabs/apis/phota-api/llms.txt) - [OpenAPI document](https://skmtc.dev/photalabs/apis/phota-api/revisions/951f156f1f6c?raw)
