API documentation

Beta documentation for developers.

[!WARNING] This documentation is for Beta Dev Only.

Woozlit Developer API Documentation

Welcome to the Woozlit Developer API! This API allows you to use Woozlit's AI models in your own applications, IDEs, and workflows.

Getting Started

1. Get Developer Access

To use the Woozlit API, you need developer access:

  • Log in to your Woozlit account
  • Contact an administrator to request developer access
  • Once approved, you'll see the "Developer" badge on your account

2. Create an API Key

  1. Go to Settings > Account in Woozlit
  2. Scroll to the Developer API Keys section
  3. Click Create Key
  4. Give your key a descriptive name (e.g., "Production Server", "VS Code Extension")
  5. Copy the key immediately - you won't be able to see it again!

Important: Store your API key securely. Anyone with access to it can use your account's token quota.

API Endpoint

POST https://woozlit.com/api/woozlit/v1/chat/completions

The Woozlit API is compatible with the OpenAI Chat Completions API format, making it easy to integrate with existing tools and libraries.

Authentication

Include your API key in the Authorization header:

Authorization: Bearer woozlit_YOUR_API_KEY_HERE

Available Models

All Woozlit models are available via the API with the woozlit/ prefix:

OpenAI Models

  • woozlit/gpt-4o
  • woozlit/gpt-4o-mini
  • woozlit/gpt-4-turbo
  • woozlit/gpt-3.5-turbo

Anthropic Models

  • woozlit/claude-3-5-sonnet-20241022
  • woozlit/claude-3-5-haiku-20241022
  • woozlit/claude-3-opus-20240229

Google Models

  • woozlit/gemini-2.0-flash-exp
  • woozlit/gemini-1.5-pro
  • woozlit/gemini-1.5-flash

DeepSeek Models

  • woozlit/deepseek-chat
  • woozlit/deepseek-reasoner

Request Format

{
  "model": "woozlit/gpt-4o-mini",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Hello, how are you?"
    }
  ],
  "stream": true,
  "temperature": 0.7,
  "max_tokens": 1000
}

Parameters

  • model (required): The model to use (must include woozlit/ prefix)
  • messages (required): Array of message objects with role and content
  • stream (optional): Enable streaming responses (default: true)
  • temperature (optional): Controls randomness (0-2, default: 0.7)
  • max_tokens (optional): Maximum tokens in response
  • top_p (optional): Nucleus sampling parameter
  • frequency_penalty (optional): Penalize repeated tokens
  • presence_penalty (optional): Penalize tokens based on presence

Response Format

Streaming Response

When stream: true, the API returns Server-Sent Events (SSE):

data: {"id":"woozlit-123","object":"chat.completion.chunk","created":1234567890,"model":"woozlit/gpt-4o-mini","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}

data: {"id":"woozlit-123","object":"chat.completion.chunk","created":1234567890,"model":"woozlit/gpt-4o-mini","choices":[{"index":0,"delta":{"content":"!"},"finish_reason":"stop"}]}

Non-Streaming Response

When stream: false:

{
  "id": "woozlit-1234567890",
  "object": "chat.completion",
  "created": 1234567890,
  "model": "woozlit/gpt-4o-mini",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I'm doing well, thank you for asking."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 15,
    "completion_tokens": 12,
    "total_tokens": 27
  }
}

Code Examples

cURL

curl https://woozlit.com/api/woozlit/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer woozlit_YOUR_API_KEY_HERE" \
  -d '{
    "model": "woozlit/gpt-4o-mini",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

Python

import requests

API_KEY = "woozlit_YOUR_API_KEY_HERE"
API_URL = "https://woozlit.com/api/woozlit/v1/chat/completions"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

data = {
    "model": "woozlit/gpt-4o-mini",
    "messages": [
        {"role": "user", "content": "Hello!"}
    ],
    "stream": False
}

response = requests.post(API_URL, headers=headers, json=data)
result = response.json()
print(result["choices"][0]["message"]["content"])

Python with Streaming

import requests
import json

API_KEY = "woozlit_YOUR_API_KEY_HERE"
API_URL = "https://woozlit.com/api/woozlit/v1/chat/completions"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

data = {
    "model": "woozlit/gpt-4o-mini",
    "messages": [
        {"role": "user", "content": "Write a short poem"}
    ],
    "stream": True
}

response = requests.post(API_URL, headers=headers, json=data, stream=True)

for line in response.iter_lines():
    if line:
        line = line.decode("utf-8")
        if line.startswith("data: "):
            json_str = line[6:]
            if json_str.strip() != "[DONE]":
                try:
                    chunk = json.loads(json_str)
                    content = chunk["choices"][0]["delta"].get("content", "")
                    print(content, end="", flush=True)
                except json.JSONDecodeError:
                    pass

Node.js

const fetch = require("node-fetch");

const API_KEY = "woozlit_YOUR_API_KEY_HERE";
const API_URL = "https://woozlit.com/api/woozlit/v1/chat/completions";

async function chat() {
  const response = await fetch(API_URL, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "woozlit/gpt-4o-mini",
      messages: [{ role: "user", content: "Hello!" }],
      stream: false,
    }),
  });

  const data = await response.json();
  console.log(data.choices[0].message.content);
}

chat();

Using with OpenAI SDK

The Woozlit API is compatible with the OpenAI SDK:

from openai import OpenAI

client = OpenAI(
    api_key="woozlit_YOUR_API_KEY_HERE",
    base_url="https://woozlit.com/api/woozlit/v1"
)

response = client.chat.completions.create(
    model="woozlit/gpt-4o-mini",
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)

print(response.choices[0].message.content)

Usage Limits

  • Free Users: 1,000,000 tokens per month
  • Premium Users: Unlimited tokens
  • Token usage from the API counts toward your monthly quota
  • If you exceed your limit, the API will return a 429 Too Many Requests error

Rate Limiting

To prevent abuse, the API implements rate limiting:

  • Usage is tracked per API key
  • If limits are exceeded, you'll receive a 429 error
  • Contact support if you need higher limits

Error Handling

Common Error Codes

  • 401 Unauthorized: Invalid or missing API key
  • 403 Forbidden: Account disabled or developer access revoked
  • 429 Too Many Requests: Monthly token limit exceeded
  • 400 Bad Request: Invalid request format or parameters
  • 500 Internal Server Error: Server error (contact support if persistent)

Error Response Format

{
  "error": "Monthly token limit exceeded. Your usage will reset next month."
}

Best Practices

  1. Store API keys securely: Never commit keys to version control
  2. Use environment variables: Store keys in .env files
  3. Monitor usage: Check your usage in the Woozlit dashboard
  4. Handle errors gracefully: Implement retry logic with exponential backoff
  5. Use streaming for long responses: Better user experience and timeout prevention
  6. Set appropriate timeouts: Prevent hanging requests
  7. Rotate keys regularly: For enhanced security

Support

Changelog

Version 1.0.0 (December 2025)

  • Initial release of Woozlit Developer API
  • Support for all major AI model providers
  • OpenAI-compatible API format
  • Streaming and non-streaming responses
  • Token usage tracking

Happy Building!