# Generate an image based on a prompt with idempotency key **POST /images/generate-with-idempotency** Creates an image using an AI model based on the provided prompt and parameters. ## Servers - Local development server: http://localhost:8080/api (Local development server) - Production server: https://api.huy-devops.site/api (Production server) ## Authentication methods - Bearer auth ## Parameters ### Headers - **idempotency-key** (string) A unique key to ensure idempotent requests. ### Body: application/json (object) Parameters for the image generation - **prompt** (string) The text prompt to generate the image from. - **aspectRatio** (string) The aspect ratio of the generated image. - **artStyle** (string) the - **artDescription** (string) - **themeStyle** (string) - **themeDescription** (string) - **model** (string) AI model - **provider** (string) provider of AI model ## Responses ### 200 Image generated successfully #### Body: application/json (object) - **success** (boolean) - **code** (integer(int32)) - **message** (string) - **data** (object) ### 400 Bad Request #### Body: application/json (object) - **success** (boolean) - **code** (integer) - **errorCode** (string) - **message** (string) - **timestamp** (string(date-time)) ### 429 Too Many Requests #### Body: application/json (object) - **success** (boolean) - **code** (integer) - **errorCode** (string) - **message** (string) - **timestamp** (string(date-time)) ### 500 Internal Server Error - Failed to generate image #### Body: application/json (object) - **success** (boolean) - **code** (integer) - **errorCode** (string) - **message** (string) - **timestamp** (string(date-time)) [Powered by Bump.sh](https://bump.sh)