---
title: "Auto-enhance a real estate photo"
method: POST
path: "/api/enhance"
tags: ["Image enhancement"]
---

# Auto-enhance a real estate photo

`POST /api/enhance`

## Request

- Base URL: `https://app.pedra.ai`
- URL: `https://app.pedra.ai/api/enhance`
- Auth: none required

Improves lighting, color, and contrast on a listing photo. Costs 1 credit. Responds in ~10s.

## Request body

- object
  - `apiKey` string, required: Account API key, sent in the request body. Get one at https://app.pedra.ai under Settings → API.
  - `imageUrl` string, required: A publicly accessible HTTPS image URL or a base64 data URI (`data:image/png;base64,...`). Remote URLs are fetched within ~20s; use base64 for auth-walled or short-lived presigned URLs.
  - `highFidelity` boolean: Non-generative enhancement: adjusts only light and sharpness, keeping colors, materials, object sizes, and framing exactly as in the original photo. Best when the result must faithfully match the original. When true, preserveOriginalFraming is ignored.
  - `preserveOriginalFraming` boolean: Keep the original framing, aspect ratio, and resolution exactly (no edge crop). The enhancement is still AI-generated, so colors/materials may shift slightly — use highFidelity if they must stay identical. Ignored when highFidelity is true.
  - `preserveAspectRatio` boolean: By default, the output comes back at whatever size the AI model produces, which may not match the aspect ratio or resolution of your photo. Set to true to get the result at the exact width and height of the input image: it is center-cropped to the original aspect ratio (never stretched) and resized to the original resolution.
  - `propertyId` string: Optional id of the property (from /api/list_properties or /api/create_property) this photo/video belongs to. When set, the result is saved into that property's gallery (or, for create_video, its Videos tab) — visible and editable from the app — instead of only being returned as a URL.
  - `name` string: Optional name for the original photo (e.g. its file name). Requires `propertyId`. If the photo isn't in that property yet, it is saved there under this name in the same call (no need to call add_images_to_property first) and returned as `source.name`. A photo already in the property keeps its current name. Never drawn on the image.

## Response `200`

Success. `output` is an array with exactly one generated image.

- ImageArrayResult: Success response whose `output` is an array containing exactly one result image.
  - `message` string
  - `output` object[]: Always contains exactly one image: each endpoint processes a single `imageUrl`.
    - `url` string: URL of a generated image.
  - `source` object: The original photo this result was made from. Present when `propertyId` was sent and the input photo is already in that property, or when `name` was sent too (the photo is then saved into the property).
    - `imageId` string
    - `name` string, nullable

## Other responses

- `400`: Invalid request — bad or unreachable image URL, missing required field, or validation error.
- `403`: Not enough credits for the requested generation.
- `404`: Missing, invalid, or revoked API key.
- `405`: Wrong HTTP method — all endpoints accept POST (credits also accepts GET).

---

[API](https://skmtc.dev/pedra/apis/pedra-api.md) · [All operations](https://skmtc.dev/pedra/apis/pedra-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pedra/apis/pedra-api/revisions/87b2e76912c8?raw)
