Enhance or restyle a portrait photo
Crops the caller's own photo to a square and returns up to four square
portraits, one per image provider. Without prompt they are enhanced
versions that keep the subject's identity. With prompt they restyle
the photo as the prompt asks ("this person as a 1920s detective"): the
person is kept unless the prompt asks otherwise. The prompt and the
photo are each moderated before any provider is called. image is
upload:<uploadId> (a portrait upload from POST /v1/uploads, which
stays usable afterwards) or a public https link to a jpg, png or webp of
at most 10 MB. If the photo shows a real person other than the creator,
have that person's permission first.
The outputs, price, charging and Idempotency-Key work as for
POST /v1/generation/portraits. Requires generation:write and
avatars:write.
X-Api-Key<token>Secret embed API key (sk_atmee_...; keys minted before 2026-09
carry sk_live_...), held by the customer's own backend and never
sent to a browser. Format: X-Api-Key: sk_atmee_....
Idempotency-Key*stringA new UUID minted for this request. Reuse it only to retry the same request: a retry never charges twice and returns the first result. A malformed key, or a key already used with different inputs, gets 400 invalid_input.
length <= 255application/json- body
image*stringThe photo to enhance, upload:<uploadId> or a public https link (jpg, png or webp, at most 10 MB).
1 <= length <= 2048prompt?stringHow to restyle the photo ("as a 1920s detective, film noir lighting"). The person in the photo is kept unless the prompt asks otherwise. Absent or blank, the photo is only enhanced.
length <= 2000engine?stringThe avatar engine the photo is for. v1 (the default) turns the face to the camera, shoulders up, and blurs the background; v2 keeps the pose, gaze, hands, framing and background and only improves quality. Pass the engine the avatar will be created with.
"v1""v2"avatarId?stringAn existing avatar the photo is for, to replace its photo; its own engine is used. Leave engine out when this is given (a different engine is invalid_input). Refused before any charge as avatar_not_found (404) when the account has no such avatar, and as avatar_not_allowed (403) when an avatar-scoped API key is for another avatar.
uuidlength <= 36The enhanced or restyled portraits (or the replayed first result).
application/json- response
portraits*array<>1 <= items <= 4microcreditsCharged*integerWhat this call charged (100 microcredits = 1 credit); 0 on a replay.
replayed*booleanTrue when an earlier call with the same Idempotency-Key was replayed.
failedProviders*array<string>The providers that returned nothing usable.
curl -X POST 'https://api.atmanity.us/v1/generation/enhancements' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "image": "string"}'{ "portraits": [ { "upload": "upload:3f1c2a9e-8d4b-4f6a-9c2e-1b7d5a0e4c11", "url": "http://example.com", "expiresAt": "2019-08-24T14:15:22Z", "preview": "string", "provider": "string", "unavailable": true } ], "microcreditsCharged": 0, "replayed": true, "failedProviders": [ "string" ]}
