Prerequisites
1
Get API Key
Log in to the LaoZhang API console to get your API key.
2
Configure Billing Mode
The legacy route required a token billing mode of Usage first (按量优先) or Per-call (按次计费). Calls failed when no billing mode was set.

Model Overview
The legacy Sora Image route generated images through the chat completions interface (/v1/chat/completions) and returned image URLs in the reply content.
Interface Capabilities
- Legacy model IDs:
sora_imageorgpt-4o-image - Chat completions interface: Submit prompts through
/v1/chat/completionsand parse the returned image URL - Aspect-ratio parameters: Supports 2:3, 3:2, and 1:1
- URL return: Responses include downloadable image links
Model Information
Request Examples
Basic Example
Batch Generation Example
Aspect Ratio Guide
Sora Image supports three preset ratios, specified by adding ratio markers at the end of prompts:Size Usage Examples
Best Practices
1. Prompt Optimization
2. Error Handling
3. Result Saving
Advanced Tips
1. Stylized Generation
2. Scene Templates
Important Notes
-
Model Selection:
sora_image: Legacy Sora Image routegpt-4o-image: Legacy image-generation model ID- Neither ID is in the current public model catalog
-
Ratio Markers:
- Add ratio marker at end of prompt:
【2:3】,【3:2】, or【1:1】 - Markers must use Chinese brackets
【】 - Without marker, uses default ratio
- Add ratio marker at end of prompt:
-
URL Extraction:
- Response contains image URLs in Markdown format
- Use regex to extract:
!\[.*?\]\((https?://[^)]+)\) - Download images promptly after generation
-
Prompt Language:
- Chinese and English prompts are supported
- Keep prompts concise and explicit for more stable outputs
FAQ
Q: How is Sora Image different from GPT-Image-1?
A:- Sora Image: Legacy route through the chat completions interface; no longer in the public model catalog
- GPT-Image-1: Earlier GPT Image models on the Images API, still available with token billing; see GPT-Image-1 image generation (archived)
- For new integrations, use GPT Image 2.5
Q: Can I use English prompts?
A: Yes. Chinese and English prompts are both supported.Q: How to specify aspect ratio?
A: Add ratio marker at end of prompt:Your prompt【2:3】
Q: Are generated images downloadable?
A: Yes, extract URLs from response and download immediately. URLs may expire after some time.Q: What’s the maximum prompt length?
A: Keep prompts under about 500 characters; concise, descriptive prompts work best.Related Resources
- GPT Image 2.5 API: the current GPT Image models for generation and editing
- Choose an image generation API: compare the image models on sale now
- Sora Image editing (archived)
- GPT-Image-1 image generation (archived)
- Console pricing: real-time prices
- API Key Management: create and manage tokens