Zum Inhalt springen
DeutschlandGPT

Create image

Generates one or more images from a text prompt. Compatible with the OpenAI /v1/images/generations API.

Images are returned as base64-encoded data (b64_json). The encoding is PNG for OpenAI/Azure models and follows output_format (default JPEG) for fal.ai models. Supported sizes and quality levels depend on the model. Available models include OpenAI/Azure DALL·E and GPT-Image, Google Imagen, and fal.ai models (flux-schnell, flux-dev, flux-pro-1.1, ideogram-v3, recraft-v3) — swap the model string to change provider. Use /v2/models/all to list every image model.

fal.ai models accept extra knobs (guidance_scale, style, rendering_speed, enable_safety_checker, …) via the parameters passthrough; these are ignored by OpenAI/Azure and Google models.

POSThttps://api.deutschlandgpt.de/v2/images/generationsTry it

Example request

curl https://api.deutschlandgpt.de/v2/images/generations \
  -X POST \
  -H "Authorization: Bearer $DGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "A serene mountain lake at sunset, pine trees reflected in calm water, photorealistic",
  "model": "dall-e-3",
  "n": 1,
  "quality": "standard",
  "size": "1024x1024",
  "response_format": "b64_json",
  "seed": 0,
  "output_format": "png",
  "parameters": {}
}'

Request body

promptstringrequired

Text description of the desired image. Max 1000 characters.

modelstringoptional

Model to use. Defaults to dall-e-3. Use /v2/models to list image models.

nintegeroptional

Number of images to generate.

qualitystringoptional

Image quality. Common values: standard, hd. Supported values depend on the model.

sizestringoptional

Image dimensions. Common values: 1024x1024, 1792x1024, 1024x1792. Supported values depend on the model.

response_formatstringoptional

Response format. Only b64_json is currently supported.

seedintegeroptional

Optional seed for reproducible generation. Supported by most fal.ai models.

output_formatstringoptional

Encoding of the generated image (fal.ai models only). Defaults to the provider default.

parametersobjectoptional

Provider-specific passthrough merged into the upstream request (fal.ai only). e.g. { "guidance_scale": 3.5, "style": "realistic_image", "enable_safety_checker": true }. Ignored by OpenAI/Azure/Vertex models.

Response

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

Image generation response

createdinteger

Unix timestamp

dataobject[]
b64_jsonstring

Base64-encoded image data

revised_promptstring

The prompt as revised by the model (DALL-E 3 only)

usageobject
imageCountinteger
qualitystring
dimensionstring
costInEuronumber

Actual cost in EUR for this request

Response codes

200

Image generation response

object
400

Invalid quality or size for this model

401

Unauthorized

402

Insufficient credits

404

Model not found

Was this page helpful?
Create image · DeutschlandGPT