Skip to content

Image Generation

TIE provides an OpenAI-compatible image generation endpoint that routes to multiple providers. Any client that works with OpenAI's /v1/images/generations works with TIE by changing the base URL.

All requests require a Bearer token from TIE Auth.

POST /v1/images/generations
ModelProviderFormat
openai/gpt-image-1.5OpenAIurl or b64_json
openai/dall-e-3OpenAIurl or b64_json
google/imagen-4.0Google Imagen (Vertex AI)b64_json only

Use the provider/model format (e.g. openai/gpt-image-1.5). You can also omit the provider prefix for OpenAI models (e.g. dall-e-3).

Send as JSON:

ParameterTypeDefaultDescription
modelstringrequiredImage model to use (e.g. openai/gpt-image-1.5, google/imagen-4.0)
promptstringrequiredText description of the desired image
ninteger1Number of images to generate. OpenAI: 1–10. Google: 1–4.
sizestringnullImage size: 1024x1024, 1792x1024, 1024x1792. For Google models, this maps to aspect ratios (1:1, 16:9, 9:16).
qualitystringnullImage quality (OpenAI only): auto, low, medium, high, hd
response_formatstringb64_jsonurl or b64_json. Google models always return b64_json regardless of this setting.
stylestringnullImage style (dall-e-3 only): natural, vivid
Terminal window
curl -X POST https://your-tie-host/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"model": "openai/gpt-image-1.5",
"prompt": "A serene mountain landscape at sunset with a reflective lake",
"n": 1,
"size": "1024x1024",
"quality": "auto"
}'
Terminal window
curl -X POST https://your-tie-host/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"model": "google/imagen-4.0",
"prompt": "A serene mountain landscape at sunset with a reflective lake",
"n": 1,
"size": "1024x1024"
}'
Terminal window
curl -X POST https://your-tie-host/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"model": "openai/dall-e-3",
"prompt": "A serene mountain landscape at sunset with a reflective lake",
"style": "natural"
}'

The response follows OpenAI's image generation format:

{
"created": 1711900000,
"data": [
{
"b64_json": "iVBORw0KGgo...",
"url": null,
"revised_prompt": "A tranquil mountain landscape during golden hour..."
}
]
}
FieldTypeDescription
createdintegerUnix timestamp of when the response was generated
dataarrayList of generated images
data[].b64_jsonstring or nullBase64-encoded image data (when response_format is b64_json)
data[].urlstring or nullTemporary URL to the generated image (when response_format is url, OpenAI models only)
data[].revised_promptstring or nullThe prompt that was actually used (OpenAI models may revise your prompt for safety/quality)
FeatureOpenAIGoogle Imagen
Max images per request104
response_format: "url"Temporary URL returnedNot supported — always returns b64_json
style parameterSupported (dall-e-3 only)Ignored
quality parameterSupportedIgnored
revised_promptReturned when prompt is modifiedNot returned
Size handlingPassed as-is (e.g. 1024x1024)Mapped to aspect ratio (e.g. 1:1)

Since the endpoint is OpenAI-compatible, you can use the standard OpenAI SDK:

from openai import OpenAI
client = OpenAI(
base_url="https://your-tie-host/v1",
api_key="your-bearer-token",
)
response = client.images.generate(
model="openai/gpt-image-1.5",
prompt="A serene mountain landscape at sunset",
n=1,
size="1024x1024",
)
print(response.data[0].b64_json[:50]) # base64 image data
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://your-tie-host/v1",
apiKey: "your-bearer-token",
});
const response = await client.images.generate({
model: "openai/gpt-image-1.5",
prompt: "A serene mountain landscape at sunset",
n: 1,
size: "1024x1024",
});
console.log(response.data[0].b64_json?.slice(0, 50));
StatusCodeWhen
400VALIDATION_ERRORUnsupported model, n exceeds provider limit, invalid parameters
401AUTH_TOKEN_MISSINGNo Bearer token provided
502SERVICE_UPSTREAM_ERRORThe upstream provider (OpenAI or Google) returned an error
503SERVICE_UNAVAILABLERequired provider credentials not configured (e.g. OPENAI_API_KEY or GCP_PROJECT_ID)