Generate images through a single API — with automatic routing across Volcengine Seedream, Baidu Qianfan, and Alibaba Bailian.
Endpoint and authentication
| Item | Value |
|---|---|
| Generation endpoint | POST https://51kik.com/v1/image/v1/generations |
| Task query | GET https://51kik.com/v1/image/v1/tasks/:task_id |
| Authentication | Authorization: Bearer <API-Key> (use your API key) |
| Content-Type | application/json |
Quick example
curl -X POST https://51kik.com/v1/image/v1/generations \
-H 'Authorization: Bearer sk-xxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{"model": "doubao-seedream-5-0-260128", "prompt": "An orange cat", "size": "1024x1024"}'
{
"created": 1719000000,
"data": [{ "url": "https://..." }],
"usage": { "images": 1, "total_tokens": 4096 }
}
SDK usage (recommended)
import { RouterBrain } from '@router-brain/sdk';
const rb = new RouterBrain('sk-your-api-key');
// One-shot generation
const result = await rb.image({
model: 'doubao-seedream-5-0-260128',
prompt: 'An orange cat',
size: '1024x1024'
}).json();
console.log(result.data[0].url);
// Streaming
const stream = await rb.image({
model: 'doubao-seedream-5-0-260128',
prompt: '...',
stream: true
}).stream();
// Async task polling
const task = await rb.image({
model: 'wanx-v1',
prompt: '...',
}).task({ pollInterval: 2000 });
console.log(task.data[0].url);
Provider comparison
| Provider | Example models | Billing | Streaming | Image-to-image | Async mode |
|---|---|---|---|---|---|
| seedream | doubao-seedream-* | Per image | Yes | Yes, multi-image fusion | No |
| qianfan | stable-diffusion-xl | Per image | No | No | No |
| bailian | wanx-v1 / qwen-image-* | Per image | No | Yes | Yes |
qianfan and bailian do not support streaming. Passing
stream: truewill return an error.
Next steps
Request parameters → provider-specific pages in the sidebar