Zum Inhalt springen
DeutschlandGPT

Edit image

Edits an existing image from a prompt, optionally with an inpainting mask. Compatible with the OpenAI /v1/images/edits API — send multipart/form-data (not JSON).

Only image models flagged edit-capable work here: call /v2/models/all and use a model whose supports_edits is true. Each such model also reports an edit block with supports_mask and max_input_images. A mask is accepted only by models whose edit.supports_mask is true (OpenAI GPT-Image, FLUX inpaint/fill, Ideogram); natural-language and multi-reference edit models (Gemini Flash Image, FLUX.2, Seedream, Nano Banana) reject a mask with 400. Images are returned as base64-encoded data (b64_json).

Provider-specific knobs (e.g. OpenAI input_fidelity/background, fal strength/guidance_scale) can be sent in the parameters JSON field; OpenAI background, input_fidelity and output_format may also be sent as their own form fields.

POSThttps://api.deutschlandgpt.de/v2/images/edits

Example request

curl https://api.deutschlandgpt.de/v2/images/edits \
  -X POST \
  -H "Authorization: Bearer $DGPT_API_KEY"

Response

200application/json
{
  "created": 0,
  "data": [
    {
      "b64_json": "string",
      "revised_prompt": "string"
    }
  ],
  "usage": {
    "imageCount": 0,
    "quality": "string",
    "dimension": "string",
    "costInEuro": 0
  }
}

Image edit response

createdinteger

Unix timestamp

dataobject[]
b64_jsonstring

Base64-encoded edited image data

revised_promptstring

The prompt as revised by the model (when provided)

usageobject
imageCountinteger
qualitystring
dimensionstring
costInEuronumber

Actual cost in EUR for this request

Response codes

200

Image edit response

object
400

Missing image/prompt, a mask on a mask-less model, or too many input images

401

Unauthorized

402

Insufficient credits

404

Model not found or does not support editing

Was this page helpful?