API Reference
Complete API documentation for CHMU Hub. OpenAI-compatible endpoints for chat, image, and video generation.
Base URL
https://api.chmuhub.com/v1/publicAuthentication
Include your API key as a Bearer token in the Authorization header.
Authorization: Bearer sk-chmuhub-...POST/chat/completions
Send messages to an AI language model. Fully compatible with OpenAI Chat Completions API. Supports streaming (SSE).
Parameters
Name
Type
required
Description
modelstringrequiredModel ID (e.g. gpt-5, claude-sonnet-4.5)messagesarrayrequiredArray of {role, content} message objectsstreambooleanoptionalEnable streaming (default: true)temperaturenumberoptionalSampling temperature (0-2)max_tokensintegeroptionalMaximum tokens to generateExamples
curl https://api.chmuhub.com/v1/public/chat/completions \
-H "Authorization: Bearer sk-chmuhub-..." \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"stream": false
}'Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "gpt-5",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help?" },
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 20, "completion_tokens": 8, "total_tokens": 28 }
}POST/images/generations
Generate images from text prompts. Async operation — returns a task_id for polling.
Parameters
Name
Type
required
Description
modelstringrequiredModel ID (e.g. gpt-image-2, midjourney-v7)promptstringrequiredText description of the imageresolutionstringoptionalResolution (1k, 2k, 4k)aspect_ratiostringoptionalAspect ratio (1:1, 16:9, 9:16)nintegeroptionalNumber of images to generateExamples
curl https://api.chmuhub.com/v1/public/images/generations \
-H "Authorization: Bearer sk-chmuhub-..." \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A sunset over mountains, oil painting style",
"resolution": "2k"
}'Response
{
"task_id": "img_abc123...",
"status": "GENERATING",
"model": "gpt-image-2"
}POST/videos/generations
Start an async video generation task. Returns a task_id for polling.
Parameters
Name
Type
required
Description
modelstringrequiredModel ID (e.g. sora-2, veo-3.1-fast)promptstringrequiredText description of the videodurationintegeroptionalVideo duration in secondsaspect_ratiostringoptionalAspect ratio (16:9, 9:16)qualitystringoptionalQuality level (720p, 1080p)image_urlstringoptionalReference image URL (image-to-video)Examples
curl https://api.chmuhub.com/v1/public/videos/generations \
-H "Authorization: Bearer sk-chmuhub-..." \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "A golden retriever running in a sunlit field",
"duration": 10
}'Response
{
"task_id": "vid_abc123...",
"status": "GENERATING",
"model": "sora-2",
"estimated_time": 120
}GET/tasks/{taskId}
Poll the status of an async task. Returns status, progress, and result URLs when complete.
Parameters
Name
Type
required
Description
taskIdstringrequiredTask ID from generation response (path parameter)Examples
curl "https://api.chmuhub.com/v1/public/tasks/vid_abc123" \
-H "Authorization: Bearer sk-chmuhub-..."Response
// In progress:
{ "status": "GENERATING", "progress": 45 }
// Completed:
{
"status": "COMPLETED",
"videoUrl": "https://storage.chmuhub.com/videos/vid_abc123/output.mp4",
"thumbnailUrl": "https://storage.chmuhub.com/videos/vid_abc123/thumb.jpg"
}GET/models
List all available models and their capabilities.
Examples
curl https://api.chmuhub.com/v1/public/models \
-H "Authorization: Bearer sk-chmuhub-..."Response
{
"object": "list",
"data": [
{ "id": "gpt-5", "object": "model", "type": "text", "name": "GPT-5" },
{ "id": "sora-2", "object": "model", "type": "video", "name": "Sora 2" },
{ "id": "gpt-image-2", "object": "model", "type": "image", "name": "GPT Image 2" }
]
}