Generate images programmatically using the Kwiki AI API.
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 | Description | Default |
|---|---|---|---|
promptrequired | string | The text prompt describing what to generate. Max 1000 characters. | - |
quality | "fast" | "hires" | Generation quality. Fast uses 1 credit, hires uses 2 credits. | "fast" |
style | "realistic" | "anime" | Visual style for the generation. | "realistic" |
Success:
{
"id": "gen_abc12345",
"status": "completed",
"type": "t2i",
"image_url": "https://cdn.kwikiai.com/generations/...",
"credits_used": 1,
"created_at": "2025-12-25T10:30:00Z"
}Failure (HTTP 503):
{
"error": "generation_failed",
"message": "Generation timed out. Please try again."
}The API uses standard HTTP status codes: - 200 → Success, response contains 'image_url' and 'credits_used' - 503 → Generation failed, response contains 'error' and 'message' Credits are only charged on successful generations. If generation fails, you are not charged.
curl -X POST https://kwikiai.com/api/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "busty blonde woman, huge tits, nude, bedroom, seductive pose, looking at camera",
"quality": "fast",
"style": "realistic"
}'import requests
response = requests.post(
"https://kwikiai.com/api/v1/generate",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"prompt": "gorgeous asian woman, big natural tits, naked, spread legs on bed, wet pussy, looking at camera",
"quality": "fast",
"style": "realistic"
}
)
result = response.json()
print(result["image_url"])const response = await fetch("https://kwikiai.com/api/v1/generate", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
prompt: "thick redhead MILF, massive ass, nude, bent over, looking back, bedroom POV",
quality: "fast",
style: "realistic"
})
});
const result = await response.json();
console.log(result.image_url);Create an API route to proxy requests and keep your API key secure on the server.
// app/api/generate/route.ts
import { NextResponse } from "next/server";
export async function POST(request: Request) {
const { prompt } = await request.json();
const response = await fetch("https://kwikiai.com/api/v1/generate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KWIKI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt,
quality: "fast",
style: "realistic",
}),
});
const result = await response.json();
if (!response.ok) {
return NextResponse.json(result, { status: response.status });
}
return NextResponse.json({ imageUrl: result.image_url });
}| Error Code | Status | Description |
|---|---|---|
missing_api_key | 401 | No API key was provided in the request. |
invalid_api_key | 401 | The API key is invalid or has been revoked. |
invalid_request | 400 | Request body is not valid JSON or not an object. |
validation_error | 400 | The request body is invalid. Check the 'field' property for details. |
insufficient_credits | 402 | Not enough credits. Response includes credits_required and credits_available. |
content_blocked | 403 | Content was blocked by moderation. Revise your prompt. |
rate_limited | 429 | Too many requests. Check the retry_after value in seconds. |
internal_error | 500 | An unexpected server error occurred. Try again later. |
generation_failed | 503 | Generation service is temporarily unavailable. Try again later. |
Rate limit headers are included in every response: X-RateLimit-Remaining and X-RateLimit-Reset.
Each generation consumes credits from your account:
Free users have 5 credits per day. Upgrade to Pro for more credits.
Maintain the same character across multiple generations using reference images.
Transform existing images with AI using style transfer and guided editing.
Generate short AI videos from text prompts or animate still images.
Inpaint, outpaint, and edit specific regions of images with AI.
Generate multiple images in a single API call with variations.
Submit jobs and receive results via webhook for long-running generations.
Questions? Contact us at contact@kwikiai.com
© 2026 Kwiki AI. All rights reserved.