Krea Image API

Image generation endpoints

Documentation

Specifications

Code Examples

Other Resources

OpenAPI Specification

krea-ai-image-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Krea Assets Image API
  version: v1
  description: Asset management endpoints for uploading and managing images, videos, audio files, and 3D models
servers:
- url: https://api.krea.ai
  description: Krea API
security:
- bearerAuth: []
tags:
- name: Image
  description: Image generation endpoints
paths:
  /generate/image/bfl/flux-1-dev:
    post:
      tags:
      - Image
      description: 'Fast model. Best for LoRAs.

        | Compute Units | Average Completion Time |

        |---------------|-------------------------|

        | ~3 | ~7 seconds |

        > **Deprecated request fields:**

        >

        > - `imageUrl` -> `image_url` until 2026-06-19

        > - `presetStyles` -> `styles` until 2026-06-19

        > - `styleImages` -> `style_images` until 2026-06-19

        > - `imageStyleRefs` -> `image_style_references` until 2026-06-19

        >

        > Deprecated fields are accepted for compatibility only and are not shown in the request schema.

        '
      summary: Flux
      x-krea-deprecated-field-aliases:
      - from: imageUrl
        to: image_url
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      - from: presetStyles
        to: styles
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      - from: styleImages
        to: style_images
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      - from: imageStyleRefs
        to: image_style_references
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      parameters:
      - name: X-Webhook-URL
        in: header
        required: false
        schema:
          type: string
          format: uri
        description: URL to receive a POST request when the job completes. The webhook will receive the job data including results.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  maxLength: 1800
                strength:
                  type: number
                  default: 1
                seed:
                  type: number
                  default: 3317551338
                steps:
                  type: integer
                  minimum: 1
                  maximum: 100
                  default: 25
                width:
                  type: number
                  minimum: 512
                  maximum: 2368
                  default: 1024
                height:
                  type: number
                  minimum: 512
                  maximum: 2368
                  default: 1024
                guidance_scale_flux:
                  type: number
                  minimum: 0
                  maximum: 24
                  default: 3
                image_url:
                  type:
                  - string
                  - 'null'
                  format: uri
                styles:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      strength:
                        type: number
                        minimum: -2
                        maximum: 2
                    required:
                    - id
                    - strength
                  description: Styles (typically LoRAs) to use for the generation
                style_images:
                  type: array
                  items:
                    type: object
                    properties:
                      strength:
                        type: number
                        minimum: -2
                        maximum: 2
                      url:
                        type: string
                        format: uri
                    required:
                    - strength
                  description: Image prompts to use for the generation
                image_style_references:
                  type: array
                  items:
                    type: object
                    properties:
                      strength:
                        type: number
                        minimum: -2
                        maximum: 2
                      url:
                        type: string
                        format: uri
                    required:
                    - strength
                  description: Style references to use for the generation
              required:
              - prompt
              additionalProperties: false
            example:
              prompt: An anime-inspired cyberpunk market in Neo Tokyo's heart.
      responses:
        '200':
          description: The resulting job data. This will be returned in a pending state until the job is completed. See [`/jobs/{id}`](#tag/default/get/jobs/{id}) for retrieving the results.
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                    format: uuid
                  status:
                    type: string
                    enum:
                    - backlogged
                    - queued
                    - scheduled
                    - processing
                    - sampling
                    - intermediate-complete
                    - completed
                    - failed
                    - cancelled
                  created_at:
                    type: string
                    format: date-time
                  completed_at:
                    type: 'null'
                  result:
                    type: 'null'
                required:
                - job_id
                - status
                - created_at
                - completed_at
                - result
        '400':
          description: The request body is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: You are not authenticated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: You have run out of credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: You have reached the maximum number of concurrent jobs.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
  /generate/image/bfl/flux-1-kontext-dev:
    post:
      tags:
      - Image
      description: 'Frontier model designed for image editing, optimized for Krea

        | Compute Units | Average Completion Time |

        |---------------|-------------------------|

        | ~6 | ~23 seconds |

        > **Deprecated request fields:**

        >

        > - `imageUrl` -> `image_url` until 2026-06-19

        > - `styleImages` -> `style_images` until 2026-06-19

        >

        > Deprecated fields are accepted for compatibility only and are not shown in the request schema.

        '
      summary: Flux Kontext
      x-krea-deprecated-field-aliases:
      - from: imageUrl
        to: image_url
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      - from: styleImages
        to: style_images
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      parameters:
      - name: X-Webhook-URL
        in: header
        required: false
        schema:
          type: string
          format: uri
        description: URL to receive a POST request when the job completes. The webhook will receive the job data including results.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  maxLength: 1800
                strength:
                  type: number
                  default: 1
                seed:
                  type: number
                  default: 3261419148
                steps:
                  type: integer
                  minimum: 1
                  maximum: 100
                  default: 25
                width:
                  type: number
                  minimum: 512
                  maximum: 2368
                  default: 1024
                height:
                  type: number
                  minimum: 512
                  maximum: 2368
                  default: 1024
                guidance_scale_flux:
                  type: number
                  minimum: 0
                  maximum: 24
                  default: 3
                image_url:
                  type:
                  - string
                  - 'null'
                  format: uri
                style_images:
                  type: array
                  items:
                    type: object
                    properties:
                      strength:
                        type: number
                        minimum: -2
                        maximum: 2
                      url:
                        type: string
                        format: uri
                    required:
                    - strength
                  maxItems: 1
                  description: Image prompts to use for the generation
              required:
              - prompt
              additionalProperties: false
            example:
              prompt: Treehouses in the Amazon, woven amidst emerald canopies.
      responses:
        '200':
          description: The resulting job data. This will be returned in a pending state until the job is completed. See [`/jobs/{id}`](#tag/default/get/jobs/{id}) for retrieving the results.
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                    format: uuid
                  status:
                    type: string
                    enum:
                    - backlogged
                    - queued
                    - scheduled
                    - processing
                    - sampling
                    - intermediate-complete
                    - completed
                    - failed
                    - cancelled
                  created_at:
                    type: string
                    format: date-time
                  completed_at:
                    type: 'null'
                  result:
                    type: 'null'
                required:
                - job_id
                - status
                - created_at
                - completed_at
                - result
        '400':
          description: The request body is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: You are not authenticated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: You have run out of credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: You have reached the maximum number of concurrent jobs.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
  /generate/image/google/nano-banana-pro:
    post:
      tags:
      - Image
      description: 'World''s most intelligent model.

        | Resolution | Compute Units |

        |------------|---------------|

        | 1K | 60.1 |

        | 2K | 60.1 |

        | 4K | 120 |

        > **Deprecated request fields:**

        >

        > - `imageUrls` -> `image_urls` until 2026-06-19

        > - `aspectRatio` -> `aspect_ratio` until 2026-06-19

        > - `styleImages` -> `style_images` until 2026-06-19

        >

        > Deprecated fields are accepted for compatibility only and are not shown in the request schema.

        '
      summary: Nano Banana Pro
      x-krea-deprecated-field-aliases:
      - from: imageUrls
        to: image_urls
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      - from: aspectRatio
        to: aspect_ratio
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      - from: styleImages
        to: style_images
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      parameters:
      - name: X-Webhook-URL
        in: header
        required: false
        schema:
          type: string
          format: uri
        description: URL to receive a POST request when the job completes. The webhook will receive the job data including results.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  minLength: 3
                width:
                  type: number
                  description: Width of the generated image.
                height:
                  type: number
                  description: Height of the generated image.
                image_urls:
                  type: array
                  items:
                    type: string
                    format: uri
                  description: Image prompts to use for the generation. If provided, style images are ignored.
                aspect_ratio:
                  type: string
                  enum:
                  - '21:9'
                  - '1:1'
                  - '4:3'
                  - '3:2'
                  - '2:3'
                  - '5:4'
                  - '4:5'
                  - '3:4'
                  - '16:9'
                  - '9:16'
                resolution:
                  type: string
                  enum:
                  - 1K
                  - 2K
                  - 4K
                  default: 1K
                style_images:
                  type: array
                  items:
                    type: object
                    properties:
                      strength:
                        type: number
                        minimum: -2
                        maximum: 2
                      url:
                        type: string
                        format: uri
                    required:
                    - strength
                  description: Image prompts to use for the generation
              required:
              - prompt
              additionalProperties: false
            example:
              prompt: Rolling sand dunes, with the silhouette of a solitary camel caravan at dusk.
      responses:
        '200':
          description: The resulting job data. This will be returned in a pending state until the job is completed. See [`/jobs/{id}`](#tag/default/get/jobs/{id}) for retrieving the results.
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                    format: uuid
                  status:
                    type: string
                    enum:
                    - backlogged
                    - queued
                    - scheduled
                    - processing
                    - sampling
                    - intermediate-complete
                    - completed
                    - failed
                    - cancelled
                  created_at:
                    type: string
                    format: date-time
                  completed_at:
                    type: 'null'
                  result:
                    type: 'null'
                required:
                - job_id
                - status
                - created_at
                - completed_at
                - result
        '400':
          description: The request body is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: You are not authenticated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: You have run out of credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: You have reached the maximum number of concurrent jobs.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
  /generate/image/google/nano-banana-2:
    post:
      tags:
      - Image
      description: 'Cheaper quality version of Nano Banana.

        | Resolution | Compute Units |

        |------------|---------------|

        | 1K | 34.4 |

        | 2K | 57.8 |

        | 4K | 86.5 |

        > **Deprecated request fields:**

        >

        > - `imageUrls` -> `image_urls` until 2026-06-19

        > - `aspectRatio` -> `aspect_ratio` until 2026-06-19

        > - `styleImages` -> `style_images` until 2026-06-19

        >

        > Deprecated fields are accepted for compatibility only and are not shown in the request schema.

        '
      summary: Nano Banana 2
      x-krea-deprecated-field-aliases:
      - from: imageUrls
        to: image_urls
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      - from: aspectRatio
        to: aspect_ratio
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      - from: styleImages
        to: style_images
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      parameters:
      - name: X-Webhook-URL
        in: header
        required: false
        schema:
          type: string
          format: uri
        description: URL to receive a POST request when the job completes. The webhook will receive the job data including results.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  minLength: 3
                width:
                  type: number
                  description: Width of the generated image.
                height:
                  type: number
                  description: Height of the generated image.
                image_urls:
                  type: array
                  items:
                    type: string
                    format: uri
                  description: Image prompts to use for the generation. If provided, style images are ignored.
                aspect_ratio:
                  type: string
                  enum:
                  - '4:1'
                  - '21:9'
                  - '1:1'
                  - '4:3'
                  - '3:2'
                  - '2:3'
                  - '5:4'
                  - '4:5'
                  - '3:4'
                  - '16:9'
                  - '9:16'
                  - '1:4'
                  - '1:8'
                resolution:
                  type: string
                  enum:
                  - 1K
                  - 2K
                  - 4K
                  default: 1K
                style_images:
                  type: array
                  items:
                    type: object
                    properties:
                      strength:
                        type: number
                        minimum: -2
                        maximum: 2
                      url:
                        type: string
                        format: uri
                    required:
                    - strength
                  description: Image prompts to use for the generation
              required:
              - prompt
              additionalProperties: false
            example:
              prompt: A sprawling vineyard, with a rustic chateau overlooking the grape-laden vines.
      responses:
        '200':
          description: The resulting job data. This will be returned in a pending state until the job is completed. See [`/jobs/{id}`](#tag/default/get/jobs/{id}) for retrieving the results.
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                    format: uuid
                  status:
                    type: string
                    enum:
                    - backlogged
                    - queued
                    - scheduled
                    - processing
                    - sampling
                    - intermediate-complete
                    - completed
                    - failed
                    - cancelled
                  created_at:
                    type: string
                    format: date-time
                  completed_at:
                    type: 'null'
                  result:
                    type: 'null'
                required:
                - job_id
                - status
                - created_at
                - completed_at
                - result
        '400':
          description: The request body is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: You are not authenticated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: You have run out of credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: You have reached the maximum number of concurrent jobs.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
  /generate/image/google/nano-banana:
    post:
      tags:
      - Image
      description: 'Most versatile intelligent model.

        | Compute Units |

        |---------------|

        | 22.3 |

        > **Deprecated request fields:**

        >

        > - `imageUrls` -> `image_urls` until 2026-06-19

        > - `aspectRatio` -> `aspect_ratio` until 2026-06-19

        > - `styleImages` -> `style_images` until 2026-06-19

        >

        > Deprecated fields are accepted for compatibility only and are not shown in the request schema.

        '
      summary: Nano Banana
      x-krea-deprecated-field-aliases:
      - from: imageUrls
        to: image_urls
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      - from: aspectRatio
        to: aspect_ratio
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      - from: styleImages
        to: style_images
        sunset_date: '2026-06-19'
        reason: Public API request fields are moving to snake_case.
        migration_url: https://docs.krea.ai/developers/deprecations#public-api-snake-case-fields
      parameters:
      - name: X-Webhook-URL
        in: header
        required: false
        schema:
          type: string
          format: uri
        description: URL to receive a POST request when the job completes. The webhook will receive the job data including results.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  minLength: 1
                width:
                  type: number
                  description: Width of the generated image.
                height:
                  type: number
                  description: Height of the generated image.
                image_urls:
                  type: array
                  items:
                    type: string
                    format: uri
                  description: Image prompts to use for the generation. If provided, style images are ignored.
                aspect_ratio:
                  type: string
                  enum:
                  - '21:9'
                  - '1:1'
                  - '4:3'
                  - '3:2'
                  - '2:3'
                  - '5:4'
                  - '4:5'
                  - '3:4'
                  - '16:9'
                  - '9:16'
                style_images:
                  type: array
                  items:
                    type: object
                    properties:
                      strength:
                        type: number
                        minimum: -2
                        maximum: 2
                      url:
                        type: string
                        format: uri
                    required:
                    - strength
                  description: Image prompts to use for the generation
              required:
              - prompt
              additionalProperties: false
            example:
              prompt: Seaside town at dusk, lantern boats setting sail, echoing serene slice-of-life anime aesthetics.
      responses:
        '200':
          description: The resulting job data. This will be returned in a pending state until the job is completed. See [`/jobs/{id}`](#tag/default/get/jobs/{id}) for retrieving the results.
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                    format: uuid
                  status:
                    type: string
                    enum:
                    - backlogged
                    - queued
                    - scheduled
                    - processing
                    - sampling
                    - intermediate-complete
                    - completed
                    - failed
                    - cancelled
                  created_at:
                    type: string
                    format: date-time
                  completed_at:
                    type: 'null'
                  result:
                    type: 'null'
                required:
                - job_id
                - status
                - created_at
                - completed_at
                - result
        '400':
          description: The request body is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: You are not authenticated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: You have run out of credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: You have reached the maximum number of concurrent jobs.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
  /generate/image/bfl/flux-1.1-pro:
    post:
      tags:
      - Image
      description: 'Advanced yet efficent model from BFL.

        | Compute Units |

        |---------------|

        | 22.9 |'
      summary: Flux 1.1 Pro
      parameters:
      - name: X-Webhook-URL
        in: header
        required: false
        schema:
          type: string
          format: uri
        description: URL to receive a POST request when the job completes. The webhook will receive the job data including results.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  minLength: 1
                width:
                  type: number
                  minimum: 256
                  maximum: 1440
                height:
                  type: number
                  minimum: 256
                  maximum: 1440
      

# --- truncated at 32 KB (111 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/krea-ai/refs/heads/main/openapi/krea-ai-image-api-openapi.yml