Hi Anna team,
We are experiencing an intermittent HTTP 502 Bad Gateway error when generating an avatar image in our app on the Anna staging environment.
The error occurs while calling the Anna image-generation Host API:
await anna.image.generate({
prompt: avatarPrompt,
n: 1,
size: "1024x1024",
output_format: "png",
resolution: "1K",
});
When a reference image is provided, the related avatar workflow uses:
const upload = await anna.upload.inline({
filename: referenceFile.name,
mime_type: referenceFile.type,
content_b64: referenceImageBase64,
purpose: "image_input",
});
await anna.image.edit({
image_url: upload.download_url,
prompt: avatarPrompt,
n: 1,
output_format: "png",
resolution: "1K",
});
Error details:
- Function: Avatar image generation
- Host API:
image.generate(and potentiallyupload.inline → image.editfor reference-image generation) - Host:
staging.anna.partners - Timestamp: July 22, 2026 at 05:49:01 UTC
- HTTP status:
502 Bad Gateway - Cloudflare Ray ID:
a1f028d9ad850e6c - Browser status: Working
- Cloudflare status: Working
- Host status: Error
The response body is a Cloudflare HTML error page indicating that the Anna staging origin server returned an invalid or unavailable upstream response. This appears to be a staging host or upstream image-service issue rather than a client-side validation error.
Could you please check the staging server and image-generation gateway logs around the timestamp above? We would also appreciate confirmation on whether retry logic is recommended for image.generate and image.edit requests that fail with HTTP 502.
Thank you.