CHUA ONE API quickstart
Create a project key and send your first CHUA ONE model API request.
Before you begin
- Create a project API key and allow the model you plan to call. Set up keys and permissions
- Store the key in your shell; do not put it in browser code or source control.
export CHUA_API_KEY='YOUR_KEY' - Check current service status.
List models available to your key
curl 'https://chuaone.si/v1/models' \
-H "Authorization: Bearer $CHUA_API_KEY"GET /v1/models returns the published models visible to this project key. Listing models does not run a generation request.
Send a text request
Authorization: Bearer $CHUA_API_KEY— project API keyContent-Type: application/jsonIdempotency-Key— a unique value for every new request; reuse it only when retrying the same request
curl -i 'https://chuaone.si/v1/chat/completions' \
-H "Authorization: Bearer $CHUA_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: YOUR_UNIQUE_REQUEST_ID' \
-d '{"model":"gpt-5.4","messages":[{"role":"user","content":"Explain what an API is in one sentence."}],"max_tokens":128}'A successful response includes choices, usage, and the X-CHUA-Request-ID receipt header. Availability depends on the current published route and service status.
Read the full text API guide · Generate an image · Generate a video
Video requests: HappyHorse 1.1 T2V
Video generation is asynchronous. Creation returns HTTP 202 with an id; query that id until status is succeeded, failed, or review.
curl -i 'https://chuaone.si/v1/videos/generations' \
-H "Authorization: Bearer $CHUA_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: YOUR_UNIQUE_REQUEST_ID' \
-d '{"model":"happyhorse-1.1-t2v","prompt":"A paper boat floating on a quiet pond","duration":3,"resolution":"720p"}'Check status
curl 'https://chuaone.si/v1/videos/YOUR_REQUEST_ID' \
-H "Authorization: Bearer $CHUA_API_KEY"Example response shape (illustrative values only):
{
"id": "00000000-0000-0000-0000-000000000000",
"model": "happyhorse-1.1-t2v",
"status": "succeeded",
"charged_micros": 0,
"currency": "CNY",
"content": { "video_url": "https://supplier.example/video.mp4" },
"usage": { "output_seconds": 3 },
"delivery_note": "Time-limited supplier URL; save the video promptly."
}The delivery URL is time-limited. Save the completed video promptly. queued and running responses omit content. Read the full video API guide.
Common errors
KEY_INVALID- The key is invalid, expired or revoked.
MODEL_UNAVAILABLE/MODEL_NOT_ALLOWED- The model is not published, ready, or allowed for this key.
RATE_LIMIT- The key reached its request limit. Follow retryAfterSeconds when returned.
CUSTOMER_INFERENCE_DISABLED- Requests are temporarily unavailable. Check the service status before retrying.
Troubleshoot and decide when to retry · Check usage and charges
Continue integrating
API reference · Python and JavaScript · Production checklist