# createImageGeneration

```graphql
mutation CreateImageGeneration($input: CreateImageGenerationInput!) {
  createImageGeneration(input: $input) {
    sources
    count
    requestedCount
    generatedCount
    failedCount
    skippedCount
    results {
      index
      outcome
      url
      uploadId
    }
  }
}
```

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.

## Arguments

| Name                     | Type                        | Required | Description                                                 |
| ------------------------ | --------------------------- | -------- | ----------------------------------------------------------- |
| `input`                  | CreateImageGenerationInput! | Yes      |                                                             |
| `input.projectReference` | String!                     | Yes      | Project UUID, slug or configured domain.                    |
| `input.prompt`           | String!                     | Yes      | Text description of the desired image (max 1000 characters) |
| `input.count`            | Int                         |          | Number of images to generate (1-10, default: 1)             |
| `input.seed`             | Int                         |          | Random seed for reproducible generation                     |

## Variables

```json
{
  "input": {
    "projectReference": "string",
    "prompt": "string"
  }
}
```

## Responses

| Status | Description                                         |
| ------ | --------------------------------------------------- |
| 200    | The ImageGeneration! in data.createImageGeneration. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation CreateImageGeneration($input: CreateImageGenerationInput!) {\n  createImageGeneration(input: $input) {\n    sources\n    count\n    requestedCount\n    generatedCount\n    failedCount\n    skippedCount\n    results {\n      index\n      outcome\n      url\n      uploadId\n    }\n  }\n}",
  "variables": {
    "input": {
      "projectReference": "string",
      "prompt": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "createImageGeneration": {
      "sources": [
        "string"
      ],
      "count": 0,
      "requestedCount": 0,
      "generatedCount": 0,
      "failedCount": 0,
      "skippedCount": 0,
      "results": [
        {
          "index": 0,
          "outcome": "generated",
          "url": "https://example.com",
          "uploadId": "string"
        }
      ]
    }
  }
}
```
