Create image generation

http
POST /projects/{project_reference}/image-generations

Generate 1 to 10 images from a text prompt with the EU image model and return their URLs; every image is billed in credits. Requires project.files.write.

Servers

JSON
[  {    "url": "https://api.veryfront.com"  }]

Authentication

JSON
[  {    "bearerAuth": []  }]
JSON
{  "bearerAuth": {    "type": "http",    "scheme": "bearer",    "bearerFormat": "JWT or API Key",    "description": "Use a JWT bearer token or a Veryfront API key in the `Authorization` header."  }}

Parameters

NameLocationRequiredDescription
project_referencepathYesProject slug, UUID, or domain that identifies the project.

Parameter contracts

JSON
[  {    "schema": {      "$ref": "#/components/schemas/ProjectReference"    },    "required": true,    "description": "Project slug, UUID, or domain that identifies the project.",    "name": "project_reference",    "in": "path"  }]

Request body

JSON
{  "content": {    "application/json": {      "schema": {        "type": "object",        "properties": {          "prompt": {            "type": "string",            "minLength": 1,            "maxLength": 1000,            "description": "Text description of the desired image (max 1000 characters)"          },          "count": {            "type": "integer",            "minimum": 1,            "maximum": 10,            "default": 1,            "description": "Number of images to generate (1-10, default: 1)"          },          "seed": {            "type": "integer",            "minimum": 1,            "maximum": 999999,            "description": "Random seed for reproducible generation"          }        },        "required": [          "prompt"        ]      },      "example": {        "prompt": "A futuristic cityscape at sunset with flying cars",        "count": 2      }    }  }}

Responses

200

Images are generated by the EU Azure FLUX.2-pro deployment and stored as project uploads. Returned as API upload URLs.

JSON
{  "description": "Images are generated by the EU Azure FLUX.2-pro deployment and stored as project uploads. Returned as API upload URLs.",  "content": {    "application/json": {      "schema": {        "type": "object",        "properties": {          "requested_count": {            "type": "integer",            "minimum": 1,            "maximum": 10,            "description": "Number of requested image slots, including failed and skipped items."          },          "generated_count": {            "type": "integer",            "minimum": 1,            "maximum": 10,            "description": "Images successfully generated and stored."          },          "failed_count": {            "type": "integer",            "minimum": 0,            "description": "Items that failed, including admission refusals before provider work; not a count of billable calls."          },          "skipped_count": {            "type": "integer",            "minimum": 0,            "description": "Items not attempted because an earlier refusal or configuration failure stopped the batch."          },          "results": {            "type": "array",            "items": {              "oneOf": [                {                  "type": "object",                  "properties": {                    "index": {                      "type": "integer",                      "minimum": 0,                      "maximum": 9,                      "description": "Zero-based position in the requested batch."                    },                    "outcome": {                      "type": "string",                      "enum": [                        "generated"                      ]                    },                    "url": {                      "type": "string",                      "minLength": 1                    },                    "upload_id": {                      "type": [                        "string",                        "null"                      ],                      "description": "Owned upload ID when this surface creates one; null for legacy CDN assets."                    },                    "error": {                      "type": "null"                    }                  },                  "required": [                    "index",                    "outcome",                    "url",                    "upload_id",                    "error"                  ]                },                {                  "type": "object",                  "properties": {                    "index": {                      "type": "integer",                      "minimum": 0,                      "maximum": 9,                      "description": "Zero-based position in the requested batch."                    },                    "outcome": {                      "type": "string",                      "enum": [                        "failed"                      ]                    },                    "url": {                      "type": "null"                    },                    "upload_id": {                      "type": "null"                    },                    "error": {                      "type": "object",                      "properties": {                        "code": {                          "type": "string",                          "enum": [                            "generation-failed",                            "storage-failed",                            "insufficient-credits",                            "provider-spend-limit",                            "provider-spend-unavailable",                            "batch-stopped",                            "not-configured"                          ]                        }                      },                      "required": [                        "code"                      ],                      "description": "Safe failure classification; never contains raw provider or storage errors."                    }                  },                  "required": [                    "index",                    "outcome",                    "url",                    "upload_id",                    "error"                  ]                },                {                  "type": "object",                  "properties": {                    "index": {                      "type": "integer",                      "minimum": 0,                      "maximum": 9,                      "description": "Zero-based position in the requested batch."                    },                    "outcome": {                      "type": "string",                      "enum": [                        "skipped"                      ]                    },                    "url": {                      "type": "null"                    },                    "upload_id": {                      "type": "null"                    },                    "error": {                      "type": "object",                      "properties": {                        "code": {                          "type": "string",                          "enum": [                            "batch-stopped"                          ]                        }                      },                      "required": [                        "code"                      ]                    }                  },                  "required": [                    "index",                    "outcome",                    "url",                    "upload_id",                    "error"                  ]                }              ],              "description": "One outcome per requested image, in request order. Skipped items were not attempted."            },            "minItems": 1,            "maxItems": 10          }        },        "required": [          "requested_count",          "generated_count",          "failed_count",          "skipped_count",          "results"        ],        "description": "A batch with at least one stored image. requested_count equals generated_count + failed_count + skipped_count. A batch with no stored images remains an error."      }    }  }}

400

Invalid input - prompt too long or invalid count

JSON
{  "description": "Invalid input - prompt too long or invalid count",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

401

Unauthorized

JSON
{  "description": "Unauthorized",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

402

Payment required - not enough credits for the first image

JSON
{  "description": "Payment required - not enough credits for the first image",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

403

Forbidden - insufficient permissions

JSON
{  "description": "Forbidden - insufficient permissions",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

404

Project not found

JSON
{  "description": "Project not found",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

500

Server error - Image generation failed

JSON
{  "description": "Server error - Image generation failed",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

503

Service unavailable - Image generation not configured, the AI provider spend limit is reached, provider spend cannot be verified, or no image was produced

JSON
{  "description": "Service unavailable - Image generation not configured, the AI provider spend limit is reached, provider spend cannot be verified, or no image was produced",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

Referenced contracts

components/parameters/ProjectReference

JSON
{  "schema": {    "$ref": "#/components/schemas/ProjectReference"  },  "required": true,  "description": "Project slug, UUID, or domain that identifies the project.",  "name": "project_reference",  "in": "path"}

components/schemas/ProjectReference

JSON
{  "type": "string"}

components/schemas/Problem

JSON
{  "type": "object",  "properties": {    "cause": {      "type": "string",      "enum": [        "schedule_concurrency_forbidden",        "schedule_fire_in_progress",        "schedule_run_limit_reached"      ],      "description": "Schedule admission refusal."    },    "idempotency": {      "type": "object",      "properties": {        "state": {          "type": "string",          "enum": [            "in_progress",            "payload_mismatch",            "outcome_unknown"          ]        },        "operation": {          "type": "string",          "minLength": 1        },        "retryable": {          "type": "boolean"        },        "retry_after_seconds": {          "type": [            "integer",            "null"          ],          "minimum": 0        },        "expires_at": {          "type": [            "string",            "null"          ]        },        "recovery": {          "type": "object",          "properties": {            "available": {              "type": "boolean"            },            "description": {              "type": "string"            },            "resource_url": {              "type": "string"            }          },          "required": [            "available",            "description"          ]        }      },      "required": [        "state",        "operation",        "retryable",        "retry_after_seconds",        "expires_at"      ],      "description": "Replay status, retry timing, and recovery lookup."    },    "type": {      "type": "string",      "description": "URI reference identifying the problem type",      "example": "https://api.veryfront.com/errors/validation-failed"    },    "title": {      "type": "string",      "description": "Short human-readable summary of the problem",      "example": "Validation Failed"    },    "status": {      "type": "integer",      "minimum": 100,      "maximum": 599,      "description": "HTTP status code",      "example": 400    },    "code": {      "type": "string",      "description": "Stable machine-readable error code",      "example": "RUN_INVALID_INPUT"    },    "detail": {      "type": "string",      "description": "Human-readable explanation specific to this occurrence",      "example": "The 'email' field must be a valid email address"    },    "instance": {      "type": "string",      "description": "URI reference identifying the specific occurrence",      "example": "/projects/my-project/members"    },    "slug": {      "type": "string",      "description": "Stable identifier for the problem type",      "example": "validation-failed"    },    "category": {      "type": "string",      "enum": [        "AUTH",        "RESOURCE",        "VALIDATION",        "DATABASE",        "SUBSCRIPTION",        "INTEGRATION",        "INTERNAL"      ],      "description": "API error category",      "example": "VALIDATION"    },    "suggestion": {      "type": "string",      "description": "Suggested action to resolve the problem",      "example": "Check the request body and query parameters against the API documentation."    },    "errors": {      "type": "array",      "items": {        "type": "object",        "properties": {          "field": {            "type": "string",            "description": "Field path that caused the error",            "example": "email"          },          "message": {            "type": "string",            "description": "Error message for this field",            "example": "Invalid email format"          },          "code": {            "type": "string",            "description": "Error code for this field",            "example": "INVALID_FORMAT"          }        },        "required": [          "field",          "message"        ]      },      "description": "Detailed field-level errors for validation failures"    }  },  "required": [    "type",    "title",    "status"  ]}

Operation contract

JSON
{  "operationId": "createImageGeneration",  "tags": [    "ai-gateway/Inference/Image generation"  ],  "security": [    {      "bearerAuth": []    }  ],  "summary": "Create image generation",  "description": "Generate 1 to 10 images from a text prompt with the EU image model and return their URLs; every image is billed in credits. Requires project.files.write.",  "parameters": [    {      "$ref": "#/components/parameters/ProjectReference"    }  ],  "requestBody": {    "content": {      "application/json": {        "schema": {          "type": "object",          "properties": {            "prompt": {              "type": "string",              "minLength": 1,              "maxLength": 1000,              "description": "Text description of the desired image (max 1000 characters)"            },            "count": {              "type": "integer",              "minimum": 1,              "maximum": 10,              "default": 1,              "description": "Number of images to generate (1-10, default: 1)"            },            "seed": {              "type": "integer",              "minimum": 1,              "maximum": 999999,              "description": "Random seed for reproducible generation"            }          },          "required": [            "prompt"          ]        },        "example": {          "prompt": "A futuristic cityscape at sunset with flying cars",          "count": 2        }      }    }  },  "responses": {    "200": {      "description": "Images are generated by the EU Azure FLUX.2-pro deployment and stored as project uploads. Returned as API upload URLs.",      "content": {        "application/json": {          "schema": {            "type": "object",            "properties": {              "requested_count": {                "type": "integer",                "minimum": 1,                "maximum": 10,                "description": "Number of requested image slots, including failed and skipped items."              },              "generated_count": {                "type": "integer",                "minimum": 1,                "maximum": 10,                "description": "Images successfully generated and stored."              },              "failed_count": {                "type": "integer",                "minimum": 0,                "description": "Items that failed, including admission refusals before provider work; not a count of billable calls."              },              "skipped_count": {                "type": "integer",                "minimum": 0,                "description": "Items not attempted because an earlier refusal or configuration failure stopped the batch."              },              "results": {                "type": "array",                "items": {                  "oneOf": [                    {                      "type": "object",                      "properties": {                        "index": {                          "type": "integer",                          "minimum": 0,                          "maximum": 9,                          "description": "Zero-based position in the requested batch."                        },                        "outcome": {                          "type": "string",                          "enum": [                            "generated"                          ]                        },                        "url": {                          "type": "string",                          "minLength": 1                        },                        "upload_id": {                          "type": [                            "string",                            "null"                          ],                          "description": "Owned upload ID when this surface creates one; null for legacy CDN assets."                        },                        "error": {                          "type": "null"                        }                      },                      "required": [                        "index",                        "outcome",                        "url",                        "upload_id",                        "error"                      ]                    },                    {                      "type": "object",                      "properties": {                        "index": {                          "type": "integer",                          "minimum": 0,                          "maximum": 9,                          "description": "Zero-based position in the requested batch."                        },                        "outcome": {                          "type": "string",                          "enum": [                            "failed"                          ]                        },                        "url": {                          "type": "null"                        },                        "upload_id": {                          "type": "null"                        },                        "error": {                          "type": "object",                          "properties": {                            "code": {                              "type": "string",                              "enum": [                                "generation-failed",                                "storage-failed",                                "insufficient-credits",                                "provider-spend-limit",                                "provider-spend-unavailable",                                "batch-stopped",                                "not-configured"                              ]                            }                          },                          "required": [                            "code"                          ],                          "description": "Safe failure classification; never contains raw provider or storage errors."                        }                      },                      "required": [                        "index",                        "outcome",                        "url",                        "upload_id",                        "error"                      ]                    },                    {                      "type": "object",                      "properties": {                        "index": {                          "type": "integer",                          "minimum": 0,                          "maximum": 9,                          "description": "Zero-based position in the requested batch."                        },                        "outcome": {                          "type": "string",                          "enum": [                            "skipped"                          ]                        },                        "url": {                          "type": "null"                        },                        "upload_id": {                          "type": "null"                        },                        "error": {                          "type": "object",                          "properties": {                            "code": {                              "type": "string",                              "enum": [                                "batch-stopped"                              ]                            }                          },                          "required": [                            "code"                          ]                        }                      },                      "required": [                        "index",                        "outcome",                        "url",                        "upload_id",                        "error"                      ]                    }                  ],                  "description": "One outcome per requested image, in request order. Skipped items were not attempted."                },                "minItems": 1,                "maxItems": 10              }            },            "required": [              "requested_count",              "generated_count",              "failed_count",              "skipped_count",              "results"            ],            "description": "A batch with at least one stored image. requested_count equals generated_count + failed_count + skipped_count. A batch with no stored images remains an error."          }        }      }    },    "400": {      "description": "Invalid input - prompt too long or invalid count",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "401": {      "description": "Unauthorized",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "402": {      "description": "Payment required - not enough credits for the first image",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "403": {      "description": "Forbidden - insufficient permissions",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "404": {      "description": "Project not found",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "500": {      "description": "Server error - Image generation failed",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "503": {      "description": "Service unavailable - Image generation not configured, the AI provider spend limit is reached, provider spend cannot be verified, or no image was produced",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    }  },  "x-documentation-source-tag": "Image generation",  "x-canonical-documentation": {    "domain": "ai-gateway",    "resource": "Inference",    "subgroup": "Image generation",    "name": "Create image generation",    "description": "Generate 1 to 10 images from a text prompt with the EU image model and return their URLs; every image is billed in credits. Requires project.files.write.",    "operationId": "createImageGeneration"  },  "x-mint": {    "href": "/cloud/rest/api-reference/ai-gateway-inference-image-generation/create-image-generation"  }}