⚡ Free, high quality & blazing fast AI generator
Generate high-quality AI images with a simple API call. Our API is designed for developers who need speed, affordability, and simplicity.
All API requests require authentication using your API key. Include it in the Authorization header:
Authorization: Bearer YOUR_API_KEYGet your API key from your account settings.
/api/v1/generate| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text description of the image to generate |
Initial response (processing):
{
"success": true,
"jobId": "gen_abc123",
"status": "processing",
"imageUrl": null
}Completed response:
{
"success": true,
"jobId": "gen_abc123",
"status": "completed",
"imageUrl": "https://cdn.example.com/images/gen_abc123.png"
}curl -X POST https://kosokuai.com/api/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A futuristic cityscape at sunset"
}'Each generation costs 1 credit and delivers high-quality results in under a second.
Rate limit headers are included in every response.
| Code | Status | Description |
|---|---|---|
unauthorized | 401 | Invalid or missing API key |
insufficient_credits | 402 | Not enough credits |
rate_limited | 429 | Too many requests |
moderation_blocked | 400 | Prompt blocked by content filter |