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. Supported sizes and quality levels depend on the model. Available models include OpenAI/Azure DALL·E and GPT-Image and Google Imagen — swap the model string to change provider. Use /v2/models/all to list every image model.

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": {},
  "moderation": "low"
}'

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, for models that support one.

output_formatstringoptional

Encoding of the generated image, for models that let you choose it. Defaults to the provider default.

parametersobjectoptional

Provider-specific passthrough merged into the upstream request, for models that take extra options. Ignored by models that do not.

moderationstringoptional

Content-moderation level for OpenAI GPT image models: low (default) for less restrictive filtering, or auto for OpenAI's standard filtering. Ignored by every other model and host, including Azure.

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