> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aireserve.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit image edit job

> Edit existing images: send `model`, a `prompt` describing the change, and `images` — one to nine public HTTPS URLs (the promptless utility models `bria-background-remove` and `topaz-image-upscale` take one image and no `prompt`). Asynchronous — answers **202** with a job (`{ id, status }`); poll `GET /v1/images/edits/{job_id}` until `status` is `succeeded` or `failed` and read the output URL from `result.images[0].url`. Billed per output image at the provider's list price (plus a per-input fee where the provider charges one), reserved at submit and settled when the job completes. Unknown and video model ids answer `400`.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/images/edits
openapi: 3.0.3
info:
  title: AI Reserve Gateway API
  description: >-
    The AI Reserve API surface — inference, durable environments, workspaces,
    sandboxes, executions, agent runs, GPU infrastructure, and fine-tuning — all
    behind one endpoint and one API key.
  version: 1.0.0
servers:
  - url: https://api.aireserve.com
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: >-
      Per-end-customer usage, cost, and billable amounts for organizations that
      tag requests with their own customers.
  - name: Dedicated GPU endpoints
    description: >-
      OpenAI-compatible inference on your organization's own dedicated
      HuggingFace vLLM deployments, called with an ordinary AI Reserve API key.
      GPU time is billed from the wallet; requests add no per-token charge.
  - name: GPU Infrastructure
    description: >-
      Provision and manage provider-hidden GPU instances. The recommended
      Instances API accepts workload requirements and an hourly price ceiling;
      AI Reserve handles provider placement internally. Every mutation is
      asynchronous and returns an operation to poll.
  - name: Environments
    description: Immutable, versioned runtime definitions.
  - name: Workspaces
    description: Durable project storage pinned to one environment version.
  - name: Sandboxes
    description: >-
      Ephemeral provider-disclosed compute allocated from sealed quotes.
      Requests remain provider-neutral.
  - name: Executions
    description: Durable asynchronous operations and command, service, or agent executions.
  - name: Agent Runs
    description: Durable Agent SDK runs with replayable events and external artifacts.
  - name: Customer keys
    description: >-
      Mint, list, and revoke API keys pinned to your own end customers (and
      their organizations), so spend splits per customer without per-request
      tagging.
  - name: AWS CLI login
    description: >-
      Browser-authorization endpoints consumed by `aws login --profile …` (AWS
      CLI v2.32.0+). All three routes are unauthenticated — the caller has no
      credential until `/v1/token` succeeds.
  - name: Fine-tuning
    description: >-
      Fine-tune open models on your own data. Data lives in an S3 bucket inside
      your organization's AWS hub account; you name a base, LoRA or full, a
      price ceiling and how the result must be servable, and AI Reserve places
      the run on a backend internally. The result is a model in your bucket you
      can deploy or download.
  - name: 'Admin: Catalog'
    description: Discover the operations available to this token.
  - name: 'Admin: Analytics'
    description: Usage, spend and attribution reads.
  - name: 'Admin: API Keys'
    description: Organization and team inference keys.
  - name: 'Admin: Billing'
    description: Wallet, ledger and invoice reads.
  - name: 'Admin: Compute'
    description: GPU machines and persistent storage (quote, launch, inspect, stop).
  - name: 'Admin: Compute Runtime'
    description: >-
      Portable environments, workspaces, sandboxes, executions, operations and
      durable agent runs.
  - name: 'Admin: Containers'
    description: The organization's AWS account, ECS services, logs and secrets.
  - name: 'Admin: Files'
    description: Organization shared files.
  - name: 'Admin: Members'
    description: 'People in the organization: invite, profile, team, access, role.'
  - name: 'Admin: Models & Routing'
    description: Model availability, defaults, fallbacks and routing.
  - name: 'Admin: Organization'
    description: Retention, logging, branding, sign-in domains, classification.
  - name: 'Admin: Personal'
    description: The caller's own usage, budget, API keys and preferences.
  - name: 'Admin: Teams & Budgets'
    description: Teams, spend caps and allocations.
  - name: 'Admin: Training'
    description: Fine-tuning datasets, runs, models and deployments.
paths:
  /v1/images/edits:
    post:
      tags:
        - Images
      summary: Submit image edit job
      description: >-
        Edit existing images: send `model`, a `prompt` describing the change,
        and `images` — one to nine public HTTPS URLs (the promptless utility
        models `bria-background-remove` and `topaz-image-upscale` take one image
        and no `prompt`). Asynchronous — answers **202** with a job (`{ id,
        status }`); poll `GET /v1/images/edits/{job_id}` until `status` is
        `succeeded` or `failed` and read the output URL from
        `result.images[0].url`. Billed per output image at the provider's list
        price (plus a per-input fee where the provider charges one), reserved at
        submit and settled when the job completes. Unknown and video model ids
        answer `400`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - images
              properties:
                model:
                  minLength: 1
                  maxLength: 256
                  type: string
                prompt:
                  minLength: 1
                  maxLength: 32000
                  type: string
                images:
                  minItems: 1
                  maxItems: 9
                  type: array
                  items:
                    minLength: 1
                    maxLength: 4096
                    pattern: ^https?://
                    type: string
                size:
                  pattern: ^\d{3,4}[x*]\d{3,4}$
                  type: string
                seed:
                  minimum: -1
                  maximum: 2147483647
                  type: integer
                user:
                  type: string
            example:
              model: nano-banana-2-edit
              prompt: Replace the sky with a dramatic sunset
              images:
                - https://example.com/photo.png
      responses:
        '202':
          description: >-
            Job accepted. Poll `GET /v1/images/edits/{job_id}` until `status` is
            `succeeded` or `failed`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageEditJob'
              example:
                id: 9c3f1a2b-4d5e-6f7a-8b9c-0d1e2f3a4b5c
                object: image.generation.job
                kind: image
                model: nano-banana-2-edit
                status: queued
                created_at: 1762459200
                completed_at: null
                result: null
                error: null
                artifact_expires_at: null
                upstream_deleted_at: null
        '400':
          description: >-
            Validation error — the model is not an image-editing model, a prompt
            is missing (or sent to a promptless model), or an image URL is not
            HTTPS.
        '401':
          description: Missing or invalid API key.
        '402':
          description: Wallet balance insufficient to reserve the job's price.
        '403':
          description: >-
            No client context attached to the key, or the model is not on the
            key's allowlist.
        '429':
          description: Rate limit or the organization's concurrent image-job cap exceeded.
        '503':
          description: >-
            The provider rejected the job or is unavailable. Nothing was
            charged; retry.
components:
  schemas:
    ImageEditJob:
      type: object
      description: >-
        An asynchronous image-edit job. Submit answers it with `status: queued`;
        polling returns the same object until it is terminal.
      required:
        - id
        - object
        - kind
        - model
        - status
        - created_at
        - completed_at
        - result
        - error
      properties:
        id:
          type: string
          format: uuid
          description: Job id — the path parameter for `GET /v1/images/edits/{job_id}`.
        object:
          type: string
          enum:
            - image.generation.job
        kind:
          type: string
          enum:
            - image
        model:
          type: string
          description: The image-editing model id the job was submitted with.
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
          description: '`succeeded` and `failed` are terminal.'
        created_at:
          type: integer
          description: Unix seconds.
        completed_at:
          type: integer
          nullable: true
          description: Unix seconds once the job is terminal.
        result:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            Set when `status` is `succeeded`. The edited image URLs are under
            `images[].url`.
          properties:
            images:
              type: array
              items:
                type: object
                additionalProperties: true
                properties:
                  url:
                    type: string
                    format: uri
                  width:
                    type: integer
                  height:
                    type: integer
        error:
          type: string
          nullable: true
          description: Set when `status` is `failed`. A failed job is never charged.
        artifact_expires_at:
          type: integer
          nullable: true
          description: >-
            Unix seconds after which the provider may delete the output;
            download before then.
        upstream_deleted_at:
          type: integer
          nullable: true
        served_model:
          type: string
          description: Present when a same-weights sibling served the job.
        served_provider:
          type: string
          description: Present alongside `served_model`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your AI Reserve API key (aireserve_api_…) from the API Keys page in the
        portal (https://portal.aireserve.com/keys).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.