Two endpoints are available: image generation and image editing. Responses use the standard OpenAI structure, with image data in data[0].b64_json

Gemini image models (such as google/gemini-3.1-flash-image-preview) can only generate images on this endpoint and cannot edit them.

Generate images#

Endpoint
POST https://xpluse.plus/v1/images/generations
Python
import base64
from openai import OpenAI

client = OpenAI(api_key="YOUR_DATAMIND_API_KEY", base_url="https://xpluse.plus/v1")

resp = client.images.generate(
    model="openai/gpt-image-2",
    prompt="A simple red apple on a white table",
    size="1024x1024",
    quality="low",
    output_format="png",
)

with open("output.png", "wb") as f:
    f.write(base64.b64decode(resp.data[0].b64_json))
cURL
curl -X POST 'https://xpluse.plus/v1/images/generations' \
  -H 'Authorization: Bearer YOUR_DATAMIND_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "openai/gpt-image-2",
    "prompt": "A simple red apple on a white table",
    "size": "1024x1024",
    "quality": "low",
    "output_format": "png"
  }' 

Gemini image models can use the same endpoint, but do not pass n(it will return 400), and they always generate only one image.

Parameter

ParameterTypeRequiredDescription
Modelsstringopenai/gpt-image-2google/gemini-3.1-flash-image-preview
promptstringNatural-language description
qualitystringauto / low / medium / high / standard / hd
nnumber1-10, default 1; Gemini does not support
sizestring1024x1024 / 1536x1024 / 1024x1536 etc.
output_formatstringpng / jpeg / webp
backgroundstringtransparent / opaque / auto

Response

JSON
{
  "created": 1777385517,
  "data": [{ "b64_json": "<image Base64>", "index": 0 }],
  "model": "openai/gpt-image-2",
  "size": "1024x1024",
  "quality": "low",
  "usage": {"input_tokens": 14, "output_tokens": 208, "total_tokens": 222}
}

Edit images#

Endpoint
POST https://xpluse.plus/v1/images/edits

Use multipart/form-data to upload image files. Only OpenAI / Azure OpenAI models are supported; Gemini calls return an unsupported error.

cURL
curl -X POST 'https://xpluse.plus/v1/images/edits' \
  -H 'Authorization: Bearer YOUR_DATAMIND_API_KEY' \
  -F 'Models="openai/gpt-image-2"' \
  -F 'prompt="Change the apple to green and keep everything else unchanged"' \
  -F 'image=@/path/to/apple.png' \
  -F 'size="auto"' \
  -F 'quality="low"' 
Python
import base64
from openai import OpenAI

client = OpenAI(api_key="YOUR_DATAMIND_API_KEY", base_url="https://xpluse.plus/v1")

with open("apple.png", "rb") as f:
    resp = client.images.edit(
        model="openai/gpt-image-2",
        image=f,
        prompt="Change the apple to green and keep everything else unchanged",
        size="auto",
        quality="low",
    )

with open("apple_edited.png", "wb") as out:
    out.write(base64.b64decode(resp.data[0].b64_json))

Last updated on June 22, 2026