Skip to content
API referenceCreate an image edit

Create an image edit

POST/v1/images/edits

Create an image edit.

Compatible with OpenAI's create-image-edit endpoint: send one or more source images and a prompt as multipart/form-data and get the edited images back. Send a single image as image, or several (up to 16) as repeated image[] parts, as the OpenAI SDKs do for a list. Each image must have an image/* content type. model, prompt and at least one image are required, and n must be an integer; otherwise a 400. OpenAI credentials only; any other provider is a 422.

Authenticate with a BYOK virtual key or with x-provider and x-api-key; a PLATFORM virtual key is a 400. The key's checks, the plan's limits and the organization's approved-provider policy (403) apply. Without x-retry-count a failed call is retried up to 3 times on 429 and 5xx.

Authorization

  • AuthorizationBearer <slug>.<secret>

    A virtual key's API key (vk-....<secret>), as Authorization: Bearer. What the OpenAI SDK sends from its api_key. Used by the inference endpoints.

  • orx-virtual-keyheader

    A virtual key's API key in the x-virtual-key header, for clients that keep Authorization for something else.

  • orx-api-keyheader

    Direct credentials: the provider's own API key in x-api-key, with the provider named in x-provider (for example openai). On /v1/messages a virtual key is accepted in x-api-key too, which is what the Claude SDK sends.

Headers

  • x-providerstring

    With direct credentials: the provider x-api-key belongs to, for example openai or anthropic (case and dashes are normalised). Not used with a virtual key.

  • x-retry-countinteger<int32>

    How many times to retry a failed provider call, 0 to 5. Without the header, chat completions, Claude Messages and prompt completions do not retry, and the other endpoints retry up to 3 times. Retries back off exponentially from 1 second and honour a numeric Retry-After. The number made is in the x-retry-count response header.

  • x-retry-status-codesstring

    Comma-separated provider status codes to retry on. Default 429,500,502,503,504,529.

Request body multipart/form-data

  • imagestring<binary>

    The image to edit. Send several as repeated image[] parts instead.

  • image[]string<binary>

    One of several images to edit (gpt-image models, up to 16).

  • maskstring<binary>

    Optional mask whose fully transparent areas mark where the image is edited.

  • promptstring

    A text description of the edit.

  • modelstring

    The image model, for example gpt-image-1 or dall-e-2.

  • ninteger

    How many images to generate. Optional; the provider's default otherwise.

  • sizestring

    The size of the generated images, for example 1024x1024. Optional.

  • response_formatstring

    url or b64_json: how the images are returned. Optional.

Responses

200application/json
  • createdinteger<int64>

    When the images were created, as a Unix timestamp in seconds.

  • dataobject[]

    The images, one per n requested.

    Child attributes
    • urlstring

      A URL to download the image from, when response_format is url. The provider's URL, valid for a limited time.

    • b64_jsonstring

      The image as base64-encoded data, when response_format is b64_json (always, for the gpt-image models).

    • revised_promptstring

      The prompt the model actually used, when it rewrote yours (dall-e-3). Absent otherwise.

NVIDIA Inception Program member

VectorAxis is built by GK Labs, a member of NVIDIA Inception.