CogView 4 API
activeCogView 4 — Zhipu AI's text-to-image model. Ultra-affordable at just 4 credits per image with standard and HD quality options.
Quick Start
Send a request to the CogView 4 API:
| 1 | curl -X POST https://apiin.one/api/v1/images/generations \ |
| 2 | -H "Authorization: Bearer YOUR_API_KEY" \ |
| 3 | -H "Content-Type: application/json" \ |
| 4 | -d '{ |
| 5 | "model": "cogview-4", |
| 6 | "prompt": "A futuristic robot assistant helping in a modern kitchen, clean design", |
| 7 | "size": "1024*1024", |
| 8 | "quality": "hd" |
| 9 | }' |
API Endpoint
/api/v1/images/generationsSend a POST request with your API key to generate content using CogView 4.
Headers
Bearer YOUR_API_KEY
application/json
Body Parameters
Model identifier: cogview-4
Text description of the image (max 1000 chars)
Image size: 1024*1024, 768*1344, 864*1152, etc. Defaults to 1024*1024.
Quality: standard or hd Defaults to hd.
Example Request
| 1 | { |
| 2 | "model": "cogview-4", |
| 3 | "prompt": "A futuristic robot assistant helping in a modern kitchen, clean design", |
| 4 | "size": "1024*1024", |
| 5 | "quality": "hd" |
| 6 | } |
Example Response
Successful task creation response.
| 1 | { |
| 2 | "code": 200, |
| 3 | "message": "success", |
| 4 | "data": { |
| 5 | "task_id": "n48xxxx_cv4", |
| 6 | "status": "IN_PROGRESS" |
| 7 | } |
| 8 | } |
Check Task Status
For asynchronous tasks, poll the status endpoint to check when your task is complete:
/api/v1/tasks/{task_id}Returns the current status of a generation task. Poll until status is 'completed' or 'failed'.
| 1 | curl https://apiin.one/api/v1/tasks/task_abc123 \ |
| 2 | -H "Authorization: Bearer aio_your_key" |
Use Cases
- ✓High-volume image generation at minimal cost
- ✓Generate concept art and creative visuals
- ✓Build affordable AI image features into apps
- ✓Batch generate marketing visuals
API Tester
Test the CogView 4 API directly from your browser:
Error Codes
| 1 | { |
| 2 | "error": { |
| 3 | "code": 400, |
| 4 | "message": "Invalid parameters", |
| 5 | "type": "invalid_request" |
| 6 | } |
| 7 | } |
Frequently Asked Questions
How much does CogView 4 cost?
Only 4 credits per image (~$0.008), making it one of the most affordable image models available.
What sizes are supported?
Supported sizes: 1024*1024, 768*1344, 864*1152, 1344*768, 1152*864, 1440*720, 720*1440.
What quality options are available?
Two quality modes: "standard" and "hd" (high definition).
Why Use CogView 4 Through API in One?
Ready to use CogView 4?
Get Your API Key →