Skip to content
Vecto
Developer Preview

Build with WokAPI

Programmatic access to WokGen's full AI generation surface. REST API + TypeScript SDK.

Overview

WokGen API lets you generate AI assets, enhance prompts, upscale images, and more — all via a clean REST interface.

Base URLhttps://wokgen.wokspec.org/api
FormatJSON (Content-Type: application/json)

Authentication

Pass your API key as a Bearer token in the Authorization header. Obtain keys at /account/api-keys.

Authorization: Bearer wok_your_key_here

Rate Limits

Guest
10 / day
No account needed
Free
50 / day
Free account
Plus
500 / day
+$9/mo
Pro
Unlimited
+$29/mo

Image Generation

POST/api/generate
{
  "prompt": "pixel art sword glowing red",
  "mode": "pixel",
  "tool": "generate",
  "width": 512,
  "height": 512,
  "seed": 42,
  "quality": "standard",
  "provider": "auto"
}

Response:

{
  "jobId": "job_abc123",
  "status": "completed",
  "imageUrl": "https://cdn.wokgen.io/assets/abc123.png",
  "prompt": "pixel art sword glowing red",
  "provider": "pollinations",
  "createdAt": "2026-03-01T12:00:00Z"
}

Text Generation

POST/api/text/generate
{
  "prompt": "Write a product description for...",
  "type": "product-desc",
  "tone": "professional",
  "length": "medium"
}

Voice / TTS

POST/api/voice/generate
{
  "text": "Hello, welcome to WokGen!",
  "voiceId": "default",
  "speed": 1.0
}

Music Generation

POST/api/music/generate
{
  "prompt": "upbeat 8-bit chiptune adventure theme",
  "duration": 30,
  "guidance": 3.5
}

Image Upscaling

POST/api/tools/upscale
{
  "imageUrl": "https://example.com/image.png",
  "scale": 4,
  "model": "real-esrgan"
}

Image Interrogation

POST/api/tools/interrogate
{
  "imageUrl": "https://example.com/image.png"
}

// Response: { "prompt": "pixel art sword, glowing red, dark background, 32x32" }

Prompt Enhancement

POST/api/prompt/enhance
{
  "prompt": "dragon",
  "mode": "pixel",
  "provider": "groq"
}

Code Examples

const wokgen = require('@wokspec/sdk');
const client = new wokgen.Client({ apiKey: 'your-api-key' });

const result = await client.generate({
  prompt: 'pixel art dragon',
  mode: 'pixel',
  width: 512,
  height: 512,
});
console.log(result.imageUrl);

Webhooks

Receive a POST to your endpoint when an async generation completes. Configure in API settings.

// POST to your webhook URL
{
  "event": "generation.completed",
  "jobId": "job_abc123",
  "imageUrl": "https://cdn.wokgen.io/assets/abc123.png",
  "prompt": "pixel art dragon",
  "timestamp": "2026-03-01T12:00:05Z"
}

SDK Reference

Zero-dependency TypeScript SDK — works in Node.js, Deno, and browsers.

npm install @wokspec/sdk
import { WokGenClient } from '@wokspec/sdk';
const client = new WokGenClient({ apiKey: 'wok_your_key_here' });

// Generate image
const result = await client.generate({ prompt: 'pixel art dragon', mode: 'pixel' });
console.log(result.imageUrl);

// Enhance prompt
const enhanced = await client.enhancePrompt({ prompt: 'dragon', mode: 'pixel' });

// Upscale image
const upscaled = await client.upscale({ imageUrl: result.imageUrl, scale: 4 });

Or download wokgen.ts directly — no npm install required.