API Documentation

Build with Komilion

Integrate intelligent model orchestration, tool execution, and voice capabilities into your apps.

API Base URL

Important: Use the correct endpoint for all API requests

https://www.komilion.com/api

This base URL is OpenAI SDK compatible. Your client will call/chat/completions automatically.

Recommended endpoints:

  • POST /chat/completions - OpenAI-compatible Chat Completions (recommended)
  • POST /chat - Legacy chat endpoint (Komilion flat JSON)
  • POST /neo/tasks - Agent Harness ("Guardian Mode") tasks
  • POST /voice/realtime - Realtime Voice (WebSocket config)
  • POST /voice/transcribe-meeting - Meeting Transcription (speaker diarization)
  • POST /voice/upload - Pre-signed upload for large audio files
  • POST /deepgram/stt - Speech-to-text (short-form)
  • POST /deepgram/tts - Text-to-speech

Policy (Cost/Quality)

Choose your driving style via policy or by using neo-mode/<policy>

model: "neo-mode/balanced"

Quick Start

Get started with Komilion API in under 2 minutes

1

Sign Up & Get API Key

Create your account at komilion.com/auth/signup, then go to Dashboard → API Keys to generate your ck_your-api-key-here key

2

Make Your First Request

Send a chat completion request and let our orchestrator select the best model

3

Start Saving

Monitor your savings and let Komilion optimize your AI costs automatically

New Capabilities

Tool Execution

Agents can run Python code, search the web, and generate images.

Realtime Voice ⭐

Bidirectional speech-to-speech with GPT. Sub-300ms latency.

Meeting Transcription ⭐

Transcribe long meetings with speaker diarization. Export as JSON, SRT, or VTT.

Speech-to-Text

Transcribe audio files with Deepgram Nova-2.

Text-to-Speech

Convert text to speech with Aura models.

API Reference

Interactive code examples in your favorite language

Authentication

Use your API key from Dashboard → API Keys as a Bearer token

# Using your API key (recommended)
curl -X POST https://www.komilion.com/api/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ck_your-api-key-here" \
  -d '{
    "model": "neo-mode",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

How to get your API key:

  1. Sign up at komilion.com/auth/signup
  2. Go to Dashboard → API Keys
  3. Click "Generate New Key"
  4. Copy your ck_your-api-key-here key

Neo Mode (Autopilot)

POST /api/chat/completions • One API call that routes to direct chat, tool-using workflows, or long-running harness jobs

Request

# Neo Mode (Autopilot) — Komilion decides workflow + best execution model(s)
curl -X POST https://www.komilion.com/api/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ck_your-api-key-here" \
  -d '{
    "model": "neo-mode/balanced",
    "messages": [
      {"role": "user", "content": "Search + summarize the latest advancements in fusion energy. Include sources."}
    ],
    "taskHint": "reasoning"
  }'

Parameters

model
Use neo-mode (or neo-mode/premium) to let Komilion route intelligently
taskHint
Optional: "writing" | "code-generation" | "reasoning" | "vision"

Direct Model (Bypass Neo)

POST /api/chat/completions • Use any specific model by its OpenRouter ID

Request

# Use a specific model (bypass Neo routing)
curl -X POST https://www.komilion.com/api/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ck_your-api-key-here" \
  -d '{
    "model": "anthropic/claude-sonnet-4-5",
    "messages": [{"role": "user", "content": "Explain monads simply"}]
  }'

Use any model from the model catalog by its full ID (e.g., anthropic/claude-sonnet-4-5). Pricing is pass-through from the provider + 25% platform fee.

Speech-to-Text

POST /api/deepgram/stt • Transcribe audio files or URLs

Request

curl -X POST https://www.komilion.com/api/deepgram/stt \
  -H "Authorization: Bearer ck_your-api-key-here" \
  -F "audio=@voice_memo.m4a"

Text-to-Speech

POST /api/deepgram/tts • Convert text to lifelike audio

Request

curl -X POST https://www.komilion.com/api/deepgram/tts \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ck_your-api-key-here" \
  -d '{
    "text": "Hello, I am your AI assistant.",
    "model": "aura-asteria-en"
  }' --output response.wav

Meeting Transcription (NEW)

POST /api/voice/transcribe-meeting • Long-form audio with speaker diarization

Key Features:

  • Speaker diarization — identifies who said what
  • Word-level timestamps and confidence scores
  • AI-powered meeting summary (optional)
  • Export: JSON, plain text, SRT, VTT subtitle formats
  • Large file support via pre-signed upload (up to 500MB)
  • Cost: ~$0.0054/min (Deepgram Nova-2 + 25% markup)

Parameters

audio
File upload (FormData) or audioKey / audioUrl (JSON)
language
Language code (e.g., "en", "sv"). Default: auto-detect
summarize
Boolean — Generate AI summary of the meeting
format
"json" (default) | "text" | "srt" | "vtt"

Implementation

# Transcribe a meeting with speaker diarization
curl -X POST https://www.komilion.com/api/voice/transcribe-meeting \
  -H "Authorization: Bearer ck_your-api-key-here" \
  -F "audio=@meeting.mp3" \
  -F "language=en" \
  -F "summarize=true"

# For large files (>4MB), use pre-signed upload:
# Step 1: Get upload URL
curl -X POST https://www.komilion.com/api/voice/upload \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ck_your-api-key-here" \
  -d '{"filename": "meeting.mp3", "contentType": "audio/mpeg"}'

# Step 2: Upload file directly to R2
curl -X PUT "<uploadUrl from step 1>" \
  -H "Content-Type: audio/mpeg" \
  --data-binary @meeting.mp3

# Step 3: Transcribe using the key
curl -X POST https://www.komilion.com/api/voice/transcribe-meeting \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ck_your-api-key-here" \
  -d '{"audioKey": "<audioKey from step 1>", "language": "en", "summarize": true}'

Realtime Voice (NEW)

POST /api/voice/realtime • Bidirectional speech-to-speech conversations via WebSocket

🎤 Talk to AI in real-time!

  • Sub-300ms latency
  • Natural conversation flow
  • Automatic voice activity detection
  • Function calling support

Policies (just pick one!)

premium
Best quality (~$0.15/min)
balanced
Good quality, cheaper (~$0.04/min) DEFAULT
frugal
Basic, cheapest (~$0.01/min)

Voices

alloyashballadcoralechosageshimmerverse

Implementation

# 1. Get WebSocket configuration (just pick a policy!)
curl -X POST https://www.komilion.com/api/voice/realtime \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ck_your-api-key-here" \
  -d '{
    "policy": "premium",
    "voice": "alloy"
  }'

# Policies:
#   "premium"  - Best quality (~$0.15/min)
#   "balanced" - Good quality, cheaper (~$0.04/min) [DEFAULT]
#   "frugal"   - Basic, cheapest (~$0.01/min)

# 2. Connect to WebSocket URL from response
# 3. Send: {"type": "session.update", "session": <sessionConfig>}
# 4. Stream audio as: {"type": "input_audio_buffer.append", "audio": "<base64>"}

Audio Format:

  • 24kHz sample rate, mono, PCM16
  • Base64 encoded when sending/receiving

Pinned Mode — Your Models, Auto-Upgraded

Pin specific models per task type. Komilion auto-upgrades within the same provider family when newer versions launch.

How it works

  1. Use the Comparison Playground to test models side-by-side
  2. Click “Pin” on the winner
  3. Future requests of that task type use your pinned model
  4. When a newer version drops (e.g., Claude Sonnet 4.5 → 5.0), Komilion upgrades automatically. Same provider, better model.

Setting pins via API

POST /api/advisor/accept
{
  "taskType": "coding",
  "modelId": "anthropic/claude-sonnet-4-5"
}
Your pinned models are visible in the Dashboard under Settings. Requires Pro plan or higher.

Advisor Mode — Weekly Optimization Emails

Get proactive recommendations based on your actual usage patterns.

What you receive

  • Weekly email digest (Mondays, 09:00 UTC)
  • Cost analysis: where you're overpaying
  • Model recommendations: better options for your task types
  • New model alerts: when a relevant model launches
  • Health warnings: when models you use have issues

Each recommendation includes

  • “Test side-by-side” button → opens Comparison Playground pre-filled with recommended models and your typical prompt
  • One-click accept → pins the recommended model
Advisor emails activate automatically once you've made 10+ API calls. Requires Pro plan or higher.

Error Responses

Komilion returns standard HTTP status codes

CodeMeaning
400Bad request (invalid parameters)
401Invalid or missing API key
402Insufficient wallet balance
429Rate limit exceeded
500Server error (automatic failover attempted)

Example error response

{
  "error": {
    "message": "Insufficient balance. Please top up at komilion.com/dashboard",
    "type": "billing_error",
    "code": 402
  }
}

Rate limit headers included in every response:

X-RateLimit-Limit: 120
X-RateLimit-Remaining: 118
X-RateLimit-Reset: 1707500000

Rate Limits

Per API key limits

TierRequests/minNotes
Free tier30/min$5 trial credits
Standard120/minPay-as-you-go
High volumeCustomContact us

Rate limits apply per API key. If you need higher limits, reach out at support@komilion.com.

Ready to Build?

Start integrating Komilion API into your applications today