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

Authorizations

X-API-Key
string
header
required

Body

application/json

Request body for the generate endpoint.

Provide a text prompt describing the image you want to create. Reference profiles inline using [[profile_id]] syntax to specify which people should appear in the generated image.

prompt
string
default:""

Text prompt describing the desired edit.

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

Response

Successful Response

Response returned by the edit and generate endpoints.

images
string[]
required

Base64-encoded PNG output image(s).

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.