curl --request POST \
--url https://api.evolink.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2-beta",
"prompt": "A beautiful colorful sunset over the ocean"
}
'{
"created": 1757156493,
"id": "task-unified-1757156493-imcg5zqt",
"model": "gpt-image-2-beta",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 100
},
"type": "image",
"usage": {
"billing_rule": "per_call",
"credits_reserved": 2.5
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: gpt-image-2-beta",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}GPT Image 2 Image Generation Beta
- GPT Image 2 (gpt-image-2-beta) model supports text-to-image, image-to-image, and image editing modes
- Asynchronous processing mode, use the returned task ID to query status
- Generated image links are valid for 7 days, please save them promptly
- In rare cases, generated results are delivered via official original links, which may expire in less than 7 days. Download and save them promptly.
Size support:
- Currently only supports
size=auto, or ratio sizes (such assize="1:1") withresolution="1K" - When
size=auto, theresolutionfield is ignored and treated as 1K resolution="2K"/resolution="4K"and explicit pixel sizes (such as1024x1024) are not currently supported- For 2K, 4K, or explicit pixel control, use gpt-image-2
Billing (per_call):
- Billed at the 1K tier only
nis fixed at 1;qualityis not exposed on this channel
curl --request POST \
--url https://api.evolink.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2-beta",
"prompt": "A beautiful colorful sunset over the ocean"
}
'{
"created": 1757156493,
"id": "task-unified-1757156493-imcg5zqt",
"model": "gpt-image-2-beta",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 100
},
"type": "image",
"usage": {
"billing_rule": "per_call",
"credits_reserved": 2.5
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: gpt-image-2-beta",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}Authorizations
All APIs require Bearer Token authentication
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header:
Authorization: Bearer YOUR_API_KEY
Body
Generated image size. Supports two modes:
1. auto (default)
The model automatically determines the output size. In this mode, the resolution field is ignored and treated as 1K.
2. Ratio (must be used with resolution="1K")
1:1: Square3:2/2:3: Landscape / Portrait4:3/3:4: Landscape / Portrait5:4/4:5: Common social media16:9/9:16: Widescreen landscape / portrait21:9/9:21: Ultra-wide landscape / portrait2:1/1:2: Landscape / Portrait3:1/1:3: Panorama landscape / portrait (maximum aspect ratio)
Note: Explicit pixel sizes (such as 1024x1024) are not currently supported. For explicit pixel control, use gpt-image-2.
"16:9"
Resolution tier. Effective only when size is a ratio. Currently only 1K is supported.
When ignored:
- When
size=auto, this field is ignored and treated as 1K (no need to pass this parameter)
Landscape / square output dimensions (portrait dimensions are the landscape width/height swapped):
| Ratio | 1K |
|---|---|
1:1 | 1024×1024 |
2:1 | 1456×720 |
3:1 | 1776×592 |
3:2 | 1248×832 |
4:3 | 1184×880 |
5:4 | 1152×912 |
16:9 | 1360×768 |
21:9 | 1568×672 |
Note: 2K / 4K are not currently supported. For higher resolution, use gpt-image-2.
1K "1K"
Reference image URL list for image-to-image and image editing features
Notes:
- Up to
16reference images per request - Supported formats:
.jpeg,.jpg,.png,.webp - Image URLs must be directly accessible by the server, or URLs that trigger direct download (typically URLs ending with image extensions like
.png,.jpg)
16[
"https://example.com/image1.png",
"https://example.com/image2.png"
]
HTTPS callback URL for task completion
Callback Timing:
- Triggered when task is completed, failed, or cancelled
- Sent after billing confirmation
Security Restrictions:
- HTTPS protocol only
- Internal IP addresses are prohibited (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.)
- URL length must not exceed
2048characters
Callback Mechanism:
- Timeout:
10seconds - Maximum
3retries after failure (at1/2/4seconds after failure) - Callback response format is consistent with task query API
- 2xx status code is considered successful, other codes trigger retry
"https://your-domain.com/webhooks/image-task-completed"
Response
Image task created successfully