Documentation Index
Fetch the complete documentation index at: https://docs.laozhang.ai/llms.txt
Use this file to discover all available pages before exploring further.
Start With the Token Group
For GPT Image 2, the token group decides which route your request uses. The samegpt-image-2 model name maps to different routes in the default group and the Sora2Official group.
Default Group: Reverse Routes
Per-call billing.
gpt-image-2 is the reverse ChatGPT Web route, gpt-image-2-vip is the reverse Codex route, and both are $0.03/call.Sora2Official: Official Transit
Usage-based billing with the same pricing as the official API. The model name is still
gpt-image-2, and the request shape matches the official Images API.Online Test
You can test the output first at yingtu.ai, then move the prompt into your API integration.
Route Matrix
| Token group | Model name | Route | Billing | size | quality | Available endpoints |
|---|---|---|---|---|---|---|
| Default group | gpt-image-2 | Reverse ChatGPT Web | $0.03/call | Not supported | Not supported | Images generation, Images edits |
| Default group | gpt-image-2-vip | Reverse Codex | $0.03/call | 30 explicit 1K/2K/4K sizes | Not supported | Images generation, Images edits |
Sora2Official | gpt-image-2 | Official-transit API | Same as official pricing | Supported | Supported | Images generation, Images edits |
Which Route Should You Use?
| Need | Use |
|---|---|
| Quick access without size control | Default-group gpt-image-2 |
| Reverse route with explicit 1K/2K/4K image size control | Default-group gpt-image-2-vip |
| Existing official OpenAI GPT Image 2 code with full parameter compatibility | Sora2Official gpt-image-2 |
quality or more official parameters | Sora2Official gpt-image-2 |
Base Configuration
All routes use the same OpenAI-compatible gateway URL:Do not set the base URL to a model-specific path. The actual route is determined by the token group and the
model field.Parameter Support
Default-group gpt-image-2
Default-groupgpt-image-2 is the reverse ChatGPT Web route. Use it when you want the simplest integration and do not need size control.
size: not supportedquality: not supported- Price: $0.03/call
Default-group gpt-image-2-vip
Default-groupgpt-image-2-vip is the reverse Codex route. Use it when you need an explicit output size on a reverse route.
size: supported for 1K, 2K, and 4K outputs, with 30 explicit pixel valuesquality: not supported; do not includequalityin the request body- Price: $0.03/call
gpt-image-2-vip, pass an explicit pixel value in size; do not use auto. Common defaults are 2048x2048, 2048x1152, and 1152x2048; use the 4K tier for final large assets.
| Ratio | 1K size | 2K size | 4K size |
|---|---|---|---|
| 1:1 | 1280x1280 | 2048x2048 | 2880x2880 |
| 2:3 | 848x1280 | 1360x2048 | 2336x3520 |
| 3:2 | 1280x848 | 2048x1360 | 3520x2336 |
| 3:4 | 960x1280 | 1536x2048 | 2480x3312 |
| 4:3 | 1280x960 | 2048x1536 | 3312x2480 |
| 4:5 | 1024x1280 | 1632x2048 | 2560x3216 |
| 5:4 | 1280x1024 | 2048x1632 | 3216x2560 |
| 9:16 | 720x1280 | 1152x2048 | 2160x3840 |
| 16:9 | 1280x720 | 2048x1152 | 3840x2160 |
| 21:9 | 1280x544 | 2048x864 | 3840x1632 |
Sora2Official-group gpt-image-2
Sora2Official gpt-image-2 is the official-transit API route. Billing is usage-based with the same pricing as the official OpenAI GPT Image 2 API.
Setup:
- Create a new token in the console.
- Select the
Sora2Officialgroup for that token. - Keep
model="gpt-image-2"in the request body. - Keep the official request body and replace only the base URL and API key.
size, quality, and other parameters supported by the official API.
Common size values:
1024x10241536x10241024x15362048x20482048x11523840x21602160x3840auto
quality values:
lowmediumhighauto
Endpoint Support
This page documents only the Images API integration path: use/v1/images/generations for text-to-image and /v1/images/edits for image-to-image. In SDKs, these correspond to images.generate and images.edit.
| Need | Endpoint | Notes |
|---|---|---|
| Text-to-image | /v1/images/generations | Returns data[0].b64_json by default, or data[0].url |
| Image-to-image | /v1/images/edits | Multipart local image upload |
Sora2Official official-transit route must use official-style Images API endpoints:
| Need | Endpoint | Notes |
|---|---|---|
| Text-to-image | /v1/images/generations | Matches the official Images generation endpoint |
| Image-to-image | /v1/images/edits | Matches the official Images edit endpoint |
For the default-group reverse route,
gpt-image-2-vip, and the Sora2Official official-transit route, this guide keeps only Images generation and Images edits as the documented integration methods.Text-to-Image Examples
Default-group gpt-image-2
Do not passsize or quality.
Default-group gpt-image-2-vip
Passsize only. Do not pass quality. The example below requests a 4K landscape image.
Sora2Official-group gpt-image-2
Use the official-style Images generation endpoint. You can passsize and quality.
Image-to-Image Examples
Default-group Images Edits
Default-group gpt-image-2-vip Images Edits
Sora2Official-group Images Edits
Official-transit image editing must use/v1/images/edits, with official-style parameters.
Parse Responses
Save Images API b64_json
Read an Images API URL
FAQ
Why does gpt-image-2 mean different things on this page?
Why does gpt-image-2 mean different things on this page?
The token group decides the route. Default-group
gpt-image-2 is the reverse ChatGPT Web route. Sora2Official gpt-image-2 is the official-transit API route.Can default-group gpt-image-2 accept size?
Can default-group gpt-image-2 accept size?
No. Use
gpt-image-2-vip in the default group when you need size control.Can gpt-image-2-vip accept quality?
Can gpt-image-2-vip accept quality?
No.
gpt-image-2-vip supports size, but it does not support quality. Use gpt-image-2 in the Sora2Official group when you need quality.Can gpt-image-2-vip use 4K sizes?
Can gpt-image-2-vip use 4K sizes?
Yes.
gpt-image-2-vip supports 4K-tier size values, including 3840x2160, 2160x3840, 2880x2880, and 3840x1632. It still does not support quality.Which endpoints does this page support?
Which endpoints does this page support?
This page keeps only the Images API integration path: use
/v1/images/generations for generation and /v1/images/edits for edits.How do I migrate official OpenAI code?
How do I migrate official OpenAI code?
Create a token under the
Sora2Official group, keep the official request body, replace the base URL with https://api.laozhang.ai/v1, and replace the API key with your LaoZhang API token.Why does b64_json decoding fail?
Why does b64_json decoding fail?
The value may include a
data:image/png;base64, prefix, or it may need padding at the end. Remove the prefix first, then pad with = before decoding.