Prerequisites
Get API Key
Log in to laozhang.ai console to obtain your API key
Configure Billing Mode
Edit token settings and choose one of the following billing modes. Actual billing rules are determined by the current console configuration:
- Volume Priority (Recommended): Uses balance billing first, automatically switches when balance is insufficient. Suitable for most users
- Pay-per-call: Direct deduction for each call. Suitable for strict budget control scenarios
The two modes differ by billing path: volume priority uses balance first, while pay-per-call deducts per request. Always confirm the current price in the console.

Model Overview
The legacy Sora Image integration returns image URLs through the chat completions interface. It is intended for projects that still maintain the legacy model IDs. New projects should evaluate the currently recommended image-generation APIs first, and availability and billing are determined by the console.Billing is console-driven
The legacy route may continue to serve existing integrations, but do not hardcode per-image prices in code or public docs. Confirm token group, billing mode, and model status before use.
The legacy route may continue to serve existing integrations, but do not hardcode per-image prices in code or public docs. Confirm token group, billing mode, and model status before use.
Interface Capabilities
- Legacy model ID compatibility: For existing projects that still use
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
- Console-controlled status: Availability, pricing, and parameter support may change with route configuration
Model Information
| Model | Model ID | Billing Method | Price | Features |
|---|---|---|---|---|
| Sora Image | sora_image | Console-defined | Console-defined | Legacy text-to-image model |
| GPT-4o Image | gpt-4o-image | Console-defined | Console-defined | Legacy image-generation model |
🚀 Quick Start
Basic Example
Batch Generation Example
📐 Aspect Ratio Guide
Sora Image supports three preset ratios, specified by adding ratio markers at the end of prompts:| Ratio Marker | Aspect Ratio | Use Case | Example |
|---|---|---|---|
| 【2:3】 | Vertical | Portrait, phone wallpaper | Beautiful flowers【2:3】 |
| 【3:2】 | Horizontal | Landscape, banner images | Magnificent mountains【3:2】 |
| 【1:1】 | Square | Social media avatar, icons | Cute puppy【1:1】 |
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- Confirm availability, billing mode, and current price in the console
-
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
- Validate important production prompts with a fixed test set
- 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
- GPT-Image-1: Current image-generation model family with its own billing model
- Confirm current pricing and availability in the console before choosing a route
Q: Can I use English prompts?
A: Yes. Chinese and English prompts are supported, but production prompts should be validated with your own test set.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: No strict limit, but recommended to keep prompts concise and descriptive for best results.🔗 Related Resources
- Sora Image Editing - Edit existing images
- GPT-4o Image Documentation - Alternative model
- Pricing Calculator - Real-time pricing
- API Key Management - Create and manage tokens
🎨 Pro Tip: Add detailed descriptions, artistic styles, and lighting conditions to your prompts for better results. The model excels at understanding natural language!