Developer API

Build with Katama

One API key gives you access to 44+ AI models for image generation, video creation, upscaling and chat. Credit-metered, money-safe, and MCP-native out of the box.

Endpoints

Six endpoints, every capability

POST/api/v1/generate

Generate images, video, chat completions or upscale — one endpoint, all models.

generate:imagegenerate:videogenerate:chatgenerate:upscale
GET/api/v1/models

List all available models with credit costs and pricing. Public — no auth required.

GET/api/v1/balance

Check your current credit balance and plan. Requires API key.

GET/api/v1/generations

List your past generations with status, output URLs, and credit costs. Paginated.

GET/api/v1/generations/:id

Get a single generation by ID — poll status, retrieve output URL when complete.

POST/api/mcp

MCP (Model Context Protocol) over HTTP. Connect Claude Desktop, Cursor or any MCP client.

generate_imagegenerate_videoenhance_promptlist_models

Quick start

Generate an image in one request

REST API

curl -X POST https://katama.ai/api/v1/generate \
  -H "Authorization: Bearer kat_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "image",
    "model": "flux-1-schnell",
    "prompt": "A samurai standing on a cliff at sunrise, cinematic",
    "width": 1024,
    "height": 768
  }'

MCP config (Claude Desktop / Cursor)

{
  "mcpServers": {
    "katama": {
      "url": "https://katama.ai/api/mcp",
      "headers": {
        "Authorization": "Bearer kat_live_..."
      }
    }
  }
}

Why build on Katama

Everything you need, nothing you don't

One API key

Create a key in Settings, scope it per capability, use it across REST and MCP.

Credit-metered

Pay only for what you generate. Same credits, same models, same pricing as the app.

Money-safe

Reserve-settle pattern: you're only charged for successful generations. Failures release the hold.

Rate-limited fairly

Per-key rate limits protect the platform without throttling normal usage.

44+ models

Access every model Katama offers — Flux, Kling, Runway, Wan, Hailuo, Claude and more.

MCP native

First-class MCP server. Claude Desktop and Cursor connect directly — no wrapper needed.

Webhooks

Real-time generation events

Register HTTPS endpoints to receive generation.completed and generation.failed events. Up to 5 per account. Manage webhooks in Settings → Developer or via the API.

Webhook payload (HMAC-SHA256 signed)

POST https://your-server.com/webhook
X-Katama-Signature: t=1720780800,v1=<hmac>
X-Katama-Event: generation.completed
Content-Type: application/json

{
  "event": "generation.completed",
  "generation": {
    "id": "gen_...",
    "kind": "image",
    "model": "flux-1-schnell",
    "status": "succeeded",
    "outputUrl": "https://...",
    "creditsCharged": 2,
    "error": null
  }
}

Verify the signature

import { createHmac } from "crypto";

function verify(body, header, secret) {
  const [tPart, vPart] = header.split(",");
  const timestamp = tPart.split("=")[1];
  const expected = createHmac("sha256", secret)
    .update(`${timestamp}.${body}`)
    .digest("hex");
  return vPart.split("=")[1] === expected;
}

Authentication

Simple bearer token auth

Authorization: Bearer kat_live_...

# Keys are created in Settings → Developer
# Each key is scoped (image, video, chat, upscale)
# Only the SHA-256 hash is stored — the full key is shown once
# Revoke instantly from the dashboard