curl --request POST \
--url https://www.gostudio.ai/api/v2/photo/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A professional headshot in a modern office"
}
'{
"status": 200,
"data": {
"kind": "generation",
"job_id": "enc_abc123",
"credits_deducted": 10,
"credit_balance": 490,
"created_at": "2023-11-07T05:31:56Z",
"output_urls": [
"<string>"
]
}
}{
"status": 400,
"error": {
"type": "validation_error",
"code": "invalid_input",
"dev": 40001,
"message": "Some information is invalid."
}
}{
"status": 401,
"error": {
"type": "authentication_error",
"code": "unauthorized",
"dev": 40100,
"message": "Missing or invalid Authorization Bearer token."
}
}{
"status": 402,
"error": {
"type": "billing_error",
"code": "insufficient_credits",
"dev": 40200,
"message": "You don't have enough credits."
}
}{
"status": 403,
"error": {
"type": "permission_error",
"code": "forbidden",
"dev": 40300,
"message": "You don't have permission for this action."
}
}{
"status": 404,
"error": {
"type": "trained_profile_not_found",
"code": 40403,
"message": "Trained profile not found."
}
}{
"status": 409,
"error": {
"type": "trained_profile_not_ready",
"code": 40901,
"message": "Trained profile is not ready."
}
}{
"status": 429,
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"dev": 42900,
"message": "You're doing that too often. Please wait a moment."
}
}{
"status": 500,
"error": {
"type": "system_error",
"code": "internal_error",
"dev": 50000,
"message": "Something went wrong on our end."
}
}Generate a photo from a text prompt
Generates one or more photos from a text prompt. Optionally locks identity to one or more trained profiles by including their IDs.
The call blocks until generation completes and returns the finished image URLs in the response. Credits are deducted before generation begins and refunded if the job fails.
If profile_ids are provided, any invalid or inactive profiles are silently filtered. If all provided profiles are invalid, the request returns trained_profile_not_found.
curl --request POST \
--url https://www.gostudio.ai/api/v2/photo/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A professional headshot in a modern office"
}
'{
"status": 200,
"data": {
"kind": "generation",
"job_id": "enc_abc123",
"credits_deducted": 10,
"credit_balance": 490,
"created_at": "2023-11-07T05:31:56Z",
"output_urls": [
"<string>"
]
}
}{
"status": 400,
"error": {
"type": "validation_error",
"code": "invalid_input",
"dev": 40001,
"message": "Some information is invalid."
}
}{
"status": 401,
"error": {
"type": "authentication_error",
"code": "unauthorized",
"dev": 40100,
"message": "Missing or invalid Authorization Bearer token."
}
}{
"status": 402,
"error": {
"type": "billing_error",
"code": "insufficient_credits",
"dev": 40200,
"message": "You don't have enough credits."
}
}{
"status": 403,
"error": {
"type": "permission_error",
"code": "forbidden",
"dev": 40300,
"message": "You don't have permission for this action."
}
}{
"status": 404,
"error": {
"type": "trained_profile_not_found",
"code": 40403,
"message": "Trained profile not found."
}
}{
"status": 409,
"error": {
"type": "trained_profile_not_ready",
"code": 40901,
"message": "Trained profile is not ready."
}
}{
"status": 429,
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"dev": 42900,
"message": "You're doing that too often. Please wait a moment."
}
}{
"status": 500,
"error": {
"type": "system_error",
"code": "internal_error",
"dev": 50000,
"message": "Something went wrong on our end."
}
}Authorizations
Supabase user JWT (or an internal service token). Send as Authorization: Bearer <token>.
Body
Text prompt for generation.
1"A professional headshot in a modern office"
IDs of trained profiles to lock identity to.
[42]
Number of images to generate.
1 <= x <= 4Output aspect ratio.
1:1, 3:4, 4:3, 9:16, 16:9 Output resolution.
1K, 2K, 4K Output image format.
png, jpg 
