API Documentation

OpenAI-compatible REST API for LLM chat and audio transcription.

Authentication

All requests require an API key in the Authorization header:

Authorization: Bearer bsf-sk-a7x9m2p4q8r1w5y3z6v0n

Models

GET /v1/models

List all available models.

curl https://api-kaidu.kaiduweb.com/v1/models -H "Authorization: Bearer bsf-sk-a7x9m2p4q8r1w5y3z6v0n"

LLM Models

ModelParametersType
qwen3.5:27b-Q4_K_M27BLLM
qwen3.5:9B-Q4_K_M9BLLM
qwen3.5:4b-q4_K_M4BLLM
qwen2.5:0.5b0.5BLLM

STT Models

ModelAccuracyType
whisper-large-v3BestSTT
whisper-mediumVery GoodSTT
whisper-smallGoodSTT
whisper-tinyBasicSTT

Chat Completions

POST /v1/chat/completions

Generate a chat completion using an LLM model.

Parameters

ParameterTypeRequiredDescription
modelstringYesLLM model ID
messagesarrayYesConversation messages [{role, content}]
streambooleanNoStream response (default: false)
reasoning_effortstringNonone, low, medium, high (default: none)
temperaturefloatNo0.0 to 1.0 (default: 0.7)
max_tokensintegerNoMaximum tokens to generate

Example

curl -X POST https://api-kaidu.kaiduweb.com/v1/chat/completions \ -H "Authorization: Bearer bsf-sk-a7x9m2p4q8r1w5y3z6v0n" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen3.5:4b-q4_K_M", "messages": [{"role": "user", "content": "Hello"}], "reasoning_effort": "none" }'

Response

{ "id": "chatcmpl-123", "object": "chat.completion", "model": "qwen3.5:4b-q4_K_M", "choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" }, "finish_reason": "stop" }], "usage": { "prompt_tokens": 10, "completion_tokens": 8, "total_tokens": 18 } }

Audio Transcription

POST /v1/audio/transcriptions

Transcribe audio to text using Whisper.

Parameters

ParameterTypeRequiredDescription
filefileYesAudio file (wav, mp3, ogg, flac, webm, mp4)
modelstringNoWhisper model (default: whisper-large-v3)
languagestringNoISO-639-1 code (en, fr, es, etc.)
response_formatstringNojson, text, verbose_json, srt, vtt
temperaturefloatNo0.0 to 1.0 (default: 0.0)

Example

curl -X POST https://api-kaidu.kaiduweb.com/v1/audio/transcriptions \ -H "Authorization: Bearer bsf-sk-a7x9m2p4q8r1w5y3z6v0n" \ -F "file=@audio.wav" \ -F "model=whisper-large-v3" \ -F "response_format=json"

Response Formats

FormatDescription
json{"text": "..."}
textPlain text only
verbose_jsonFull details with timestamps and segments
srtSubRip subtitle format
vttWebVTT subtitle format

Audio Translation

POST /v1/audio/translations

Translate audio from any language to English.

curl -X POST https://api-kaidu.kaiduweb.com/v1/audio/translations \ -H "Authorization: Bearer bsf-sk-a7x9m2p4q8r1w5y3z6v0n" \ -F "file=@audio.wav" \ -F "model=whisper-large-v3" \ -F "response_format=json"

Python SDK

Use the official OpenAI Python SDK with this API.

pip install openai

Chat

from openai import OpenAI client = OpenAI( api_key="bsf-sk-a7x9m2p4q8r1w5y3z6v0n", base_url="https://api-kaidu.kaiduweb.com/v1" ) response = client.chat.completions.create( model="qwen3.5:4b-q4_K_M", messages=[{"role": "user", "content": "Hello"}] ) print(response.choices[0].message.content)

Transcription

with open("audio.wav", "rb") as f: result = client.audio.transcriptions.create( model="whisper-large-v3", file=f, response_format="json" ) print(result.text)

Health Check

GET /health
curl https://api-kaidu.kaiduweb.com/health