API Documentation

Generate images programmatically using the Kwiki AI API.

Authentication

All API requests require authentication using your API key. Include it in the Authorization header:

header
Authorization: Bearer YOUR_API_KEY

Get your API key from your account settings.

Generate Image

POST/api/v1/generate

Parameters

ParameterTypeDescriptionDefault
promptrequiredstringThe 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"

Response

Success:

json
{
  "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):

json
{
  "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.

Examples

cURL

bash
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"
  }'

Python

python
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"])

JavaScript

javascript
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);

Next.js (App Router)

Create an API route to proxy requests and keep your API key secure on the server.

typescript
// 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 Codes

Error CodeStatusDescription
missing_api_key401No API key was provided in the request.
invalid_api_key401The API key is invalid or has been revoked.
invalid_request400Request body is not valid JSON or not an object.
validation_error400The request body is invalid. Check the 'field' property for details.
insufficient_credits402Not enough credits. Response includes credits_required and credits_available.
content_blocked403Content was blocked by moderation. Revise your prompt.
rate_limited429Too many requests. Check the retry_after value in seconds.
internal_error500An unexpected server error occurred. Try again later.
generation_failed503Generation service is temporarily unavailable. Try again later.

Rate Limits

  • 10 requests per minute
  • 100 requests per hour

Rate limit headers are included in every response: X-RateLimit-Remaining and X-RateLimit-Reset.

Credits

Each generation consumes credits from your account:

  • Fast quality: 1 credit per image
  • Hires quality: 2 credits per image

Free users have 5 credits per day. Upgrade to Pro for more credits.

Coming Soon

Character Consistency

Maintain the same character across multiple generations using reference images.

Image-to-Image

Transform existing images with AI using style transfer and guided editing.

Video Generation

Generate short AI videos from text prompts or animate still images.

Image Editing

Inpaint, outpaint, and edit specific regions of images with AI.

Batch Generation

Generate multiple images in a single API call with variations.

Async Mode & Webhooks

Submit jobs and receive results via webhook for long-running generations.

Questions? Contact us at contact@kwikiai.com

© 2026 Kwiki AI. All rights reserved.