Model Information
| Model ID | openai/ gpt-image-2.5-flare |
| Category | Image |
| Endpoint | /api/v1/images/generations |
| Input Modalities | text, image |
| Output Modalities | image |
Request
POST https://mogu.io/api/v1/images/generationsAuthentication: Authorization: Bearer <api-key>
Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | ✓ | Model ID: openai/ gpt-image-2.5-flare | |
| n | number (1..4) | 1 | Number of images to generate | |
| mask | url | Mask image for partial editing (PNG with alpha channel) | ||
| size | enum: 1024x1024 | 1536x1024 | 1024x1536 | 2048x2048 | auto | "auto" | Output image size | |
| image | array<url> | Reference images for editing (base64 data URL or HTTP URL) | ||
| prompt | string | ✓ | Text description of the image to generate or edit | |
| quality | enum: low | medium | high | auto | "auto" | Rendering quality | |
| background | enum: opaque | auto | "auto" | Background type | |
| output_format | enum: png | jpeg | webp | "png" | Output file format |
Multimodal Input
This model supports image input. Use the content array format:
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/photo.jpg"
}
}
]
}Multimodal Output
This model can output image. Add modalities to your request:
{
"model": "openai/ gpt-image-2.5-flare",
"messages": [
{
"role": "user",
"content": "Draw a cat"
}
],
"modalities": [
"image"
]
}Image output does not support streaming. Set stream: false.
Code Examples
curl -X POST https://mogu.io/api/v1/images/generations \
-H "Authorization: Bearer <api-key>" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/ gpt-image-2.5-flare",
"n": 1,
"size": "auto",
"prompt": "Your prompt here",
"quality": "auto",
"background": "auto",
"output_format": "png"
}'Response
Response (200 OK)
{
"created": 1700000000,
"data": [
{
"url": "https://cos.example.com/images/...signed..."
}
],
"usage": {
"input_tokens": 14,
"output_tokens": 1542,
"total_tokens": 1556
},
"credit": 90
}Error Codes
| HTTP | Type | Description |
|---|---|---|
| 400 | invalid_request_error | Invalid parameters |
| 400 | content_moderation | Content blocked by safety system |
| 400 | input_too_large | Input exceeds model limit |
| 401 | auth_error | Invalid API key |
| 402 | insufficient_credits | Not enough credits |
| 429 | rate_limit_error | Too many requests |
| 502 | provider_error | Upstream error, retry later |
| 504 | timeout_error | Request timed out |