BeLive Token Hub
API ReferenceImageGemini

General API

OpenAI-compatible Gemini image generation and reference-image editing with URL output.

The compatible endpoint follows the OpenAI image format and normally returns an image URL.

Endpoint Information

ItemValue
EndpointPOST https://api.tokenhub.belivestudios.com/v1/images/generations
AuthenticationHeader Authorization: Bearer sk-your-belive-studios-key
Content-Typeapplication/json

Generate

curl https://api.tokenhub.belivestudios.com/v1/images/generations \
  -H "Authorization: Bearer sk-your-belive-studios-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.1-flash-image",
    "prompt": "A cat running through a neon street after rain, cinematic",
    "size": "1k",
    "aspect_ratio": "1:1",
    "response_format": "url"
  }'

Reference-Image Editing

Some models support reference images. Put the reference image URL in the request body's image array; use prompt only for the text editing instruction:

curl https://api.tokenhub.belivestudios.com/v1/images/generations \
  -H "Authorization: Bearer sk-your-belive-studios-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.1-flash-image",
    "prompt": "Keep the person unchanged and replace the background with a beach sunset",
    "size": "1k",
    "aspect_ratio": "16:9",
    "response_format": "url",
    "image": [
      "https://example.com/reference.jpg"
    ]
  }'

Response

Image generation and reference-image editing use the same response structure. After a successful request, the generated image URL is in data[0].url.

{
  "created": 1787888579,
  "data": [
    {
      "b64_json": "",
      "revised_prompt": "",
      "url": "https://cdn.aiznt.com/relay-temp-images/20260828/b13c70b8-5e24-4936-a54f-d158aadf980a.jpg"
    }
  ]
}
FieldTypeDescription
createdintegerUnix timestamp, in seconds, when the response was created
dataarrayList of generated image results
data[].urlstringTemporary URL for the generated image
data[].b64_jsonstringBase64 image data; normally an empty string in URL response mode
data[].revised_promptstringServer-revised prompt; normally an empty string when none is provided

Temporary image URL

Download and store the image promptly after receiving the response. Do not use the temporary URL as permanent storage.

Python

import requests

response = requests.post(
    "https://api.tokenhub.belivestudios.com/v1/images/generations",
    headers={"Authorization": "Bearer sk-your-belive-studios-key"},
    json={
        "model": "gemini-3.1-flash-image",
        "prompt": "A cat running through a neon street after rain, cinematic",
        "size": "1k",
        "aspect_ratio": "1:1",
        "response_format": "url",
    },
    timeout=300,
)
response.raise_for_status()
print(response.json()["data"][0]["url"])

Parameters

ParameterDescription
modelGemini image model ID
promptGeneration or editing instruction
imageReference image array, when supported by the selected model
sizeCommonly 1k or 2k, subject to model support
aspect_ratioRatio such as 1:1 or 16:9
response_formatUsually url

Use the current console endpoint definition for the complete fields and model capabilities.

On this page