100+ OSS models with one OpenAI-compatible API.
A focused set of OpenAI-compatible API examples for Qubrid AI. Use the same OpenAI client patterns and point them at https://platform.qubrid.com/v1 to access models like DeepSeek, Qwen, Llama, Mistral, Kimi and more.
- Export your Qubrid key:
export QUBRID_API_KEY="your_api_key_here"- Use OpenAI-compatible clients with the Qubrid base URL:
from openai import OpenAI
client = OpenAI(
base_url="https://platform.qubrid.com/v1",
api_key="QUBRID_API_KEY",
)
stream = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V4-Flash",
messages=[
{"role": "user", "content": "Explain quantum computing in simple terms"}
],
max_tokens=393216,
temperature=1,
top_p=1,
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
print("\n")import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://platform.qubrid.com/v1',
apiKey: 'QUBRID_API_KEY',
});
const stream = await client.chat.completions.create({
model: 'deepseek-ai/DeepSeek-V4-Flash',
messages: [
{ role: 'user', content: 'Explain quantum computing in simple terms' }
],
max_tokens: 393216,
temperature: 1,
top_p: 1,
stream: true,
});
for await (const chunk of stream) {
if (chunk.choices[0]?.delta?.content) {
process.stdout.write(chunk.choices[0].delta.content);
}
}
console.log('\n');package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
url := "https://platform.qubrid.com/v1/chat/completions"
payload := map[string]interface{}{
"model": "deepseek-ai/DeepSeek-V4-Flash",
"messages": []map[string]string{
{"role": "user", "content": "Explain quantum computing in simple terms"},
},
"temperature": 1,
"max_tokens": 393216,
"stream": true,
"top_p": 1,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer QUBRID_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
_, _ = client.Do(req)
}curl -X POST "https://platform.qubrid.com/v1/chat/completions" \
-H "Authorization: Bearer QUBRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-ai/DeepSeek-V4-Flash",
"messages": [
{"role": "user", "content": "Explain quantum computing in simple terms"}
],
"temperature": 1,
"max_tokens": 393216,
"stream": true,
"top_p": 1
}'-
Run an example in
python/,javascript/,go/, orcurl/. -
Swap
modelfor the OSS model you want to use.
pip install openainpm install openaigo get github.com/sashabaranov/go-openaicurl is available on most systems and works with the HTTP examples.
qubrid-examples/
│
├── chat/
│ ├── python/
│ ├── javascript/
│ ├── go/
│ └── curl/
│
├── vision/
│ ├── python/
│ ├── javascript/
│ └── curl/
│
├── voice/
│ ├── text-to-speech/
│ └── speech-to-text/
│
├── ocr/
│ ├── python/
│ └── curl/
│
├── embeddings/
│
├── README.md
├── LICENSE
└── .gitignore
Qubrid delivers 100+ open-source and commercial models through a single OpenAI-compatible API. Example supported models include:
deepseek-ai/DeepSeek-V4-Flashdeepseek-ai/DeepSeek-V4-Prodeepseek-ai/DeepSeek-V3deepseek-ai/DeepSeek-R1-0528qwen/qwen3-Plusqwen/qwen3-Flashqwen/qwen3-Maxqwen/qwen3-VL-Plusqwen/qwen3-VL-Flashqwen/qwen3-Coder-Plusqwen/qwen3-Coder-Flashqwen/qwen3-Coder-Nextqwen/qwen3-Nextmistralai/Mistral-7B-Instruct-v0.3moonshotai/Kimi-K2.6moonshotai/Kimi-K2-Thinkingmoonshotai/Kimi-K2-Instructmoonshotai/Kimi-K2.5nvidia/NVIDIA-Nemotron-3-Super-120B-A12Bnvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16google/gemini-3.1-pro-previewgoogle/gemini-3-flash-previewgoogle/gemini-2.5-progoogle/gemini-2.5-flashanthropic/claude-opus-4-7anthropic/claude-opus-4-6anthropic/claude-opus-4-5anthropic/claude-sonnet-4-6anthropic/claude-haiku-4-5-20251001openai/gpt-4oopenai/gpt-4o-miniopenai/gpt-4.1openai/gpt-5.4openai/gpt-5.4-miniopenai/gpt-5.4-nanometa-llama/Llama-3.3-70B-Instructmicrosoft/Fara-7Btencent/HunyuanOCRzai-org/GLM-4.7zai-org/GLM-5miniMaxAI/MiniMax-M2.5
Replace the
modelfield to target any compatible OSS model supported by Qubrid.
This repository contains ready-to-run examples organized by capability and language. Click files to open examples.
Chat
- Python: chat/python/chat.py
- JavaScript: chat/javascript/chat.js
- Go: chat/go/chat.go
- curl: chat/curl/chat.sh
Vision (image understanding)
- Python: vision/python/vision.py
- JavaScript: vision/javascript/vision.js
- Go: vision/go/vision.go
- curl: vision/curl/vision.sh
Voice - Text-to-Speech
- curl: voice/text-to-speech/curl/tts.sh
- Python: voice/text-to-speech/python/tts.py
- JavaScript: voice/text-to-speech/javascript/tts.js
- Go: voice/text-to-speech/go/tts.go
Voice - Speech-to-Text
- curl: voice/speech-to-text/curl/transcribe.sh
- Python: voice/speech-to-text/python/transcribe.py
- JavaScript: voice/speech-to-text/javascript/transcribe.js
- Go: voice/speech-to-text/go/transcribe.go
OCR (basic / layout-preserving)
- curl basic: ocr/curl/basic/ocr.sh
- curl layout: ocr/curl/layout/ocr_layout.sh
- python basic: ocr/python/basic/ocr.py
- python layout: ocr/python/layout/ocr_layout.py
- javascript basic: ocr/javascript/basic/ocr.js
- javascript layout: ocr/javascript/layout/ocr_layout.js
- go basic: ocr/go/basic/ocr.go
- go layout: ocr/go/layout/ocr_layout.go
Embeddings
- See embeddings/
- Run curl examples (make executable):
chmod +x path/to/example.sh
./path/to/example.sh- Run Python examples (install
requests):
python3 path/to/example.py- Run JavaScript examples (Node.js may require a fetch polyfill):
node path/to/example.js- Run Go examples:
go run path/to/example.goQubrid is an OpenAI-compatible API layer, so you can keep the same request shapes and client patterns. The main change is the target endpoint and the API key source.
- Keep the same OpenAI SDK or REST payloads.
- Replace the OpenAI endpoint with
https://platform.qubrid.com/v1. - Use
QUBRID_API_KEYfor authentication. - Keep the
model,messages, and other request fields the same.
# Existing OpenAI usage
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
# Qubrid usage
client = OpenAI(
base_url="https://platform.qubrid.com/v1",
api_key=os.getenv("QUBRID_API_KEY"),
)// Existing OpenAI usage
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
// Qubrid usage
const client = new OpenAI({
baseURL: 'https://platform.qubrid.com/v1',
apiKey: process.env.QUBRID_API_KEY,
});We welcome contributions that improve examples, expand model coverage, or add integrations.
- Open issues for bug reports or missing examples.
- Submit PRs with focused changes.
- Keep code idiomatic and dependency minimal.
- Add docs for new examples or runtime requirements.
- Documentation: https://docs.platform.qubrid.com/
- Community / Discord: https://discord.com/invite/Btsqxa6ZnQ
This repository is licensed under the MIT License.
Use these fields in any language when making Qubrid chat completion requests.
Authorization(header, required):Bearer <token>model(string, required): The language model to use.messages(array, required): Conversation messages in chat format.max_tokens(integer): Maximum number of tokens to generate.temperature(number): Controls randomness in output.top_p(number): Nucleus sampling parameter.stream(boolean): Whether to stream responses incrementally.
Example chat message structure:
{
"model": "openai/gpt-oss-120b",
"messages": [
{"role": "user", "content": "Summarize this support ticket into bullet-point next steps for the agent."}
],
"max_tokens": 4096,
"temperature": 0.7,
"top_p": 1,
"stream": true
}Convert text into natural-sounding speech using AI voice models.
- Endpoint:
POST /v1/audio/generations - Authorization:
Bearer <token>(header) - Body (application/json):
model(string, required) - TTS model to use. Example:qwen3-tts-flashtext(string, required) - Text to synthesize.voice(string, required) - Voice preset. Example:Cherrylanguage_type(string) - Language setting, e.g.Auto
Response (200 application/json):
{
"created": 1710000000,
"data": [
{ "url": "https://cdn.qubrid.com/generated/audio.mp3" }
]
}Transcribe audio files to text.
- Endpoint:
POST /api/v1/qubridai/audio/transcribe - Authorization:
Bearer <token>(header) - Body:
multipart/form-datafile(file, required) - Audio file (wav, mp3, etc.)model(string, required) - STT model. Example:openai/whisper-large-v3
Response (200 application/json):
{
"text": "Today is a wonderful day to build something people love!"
}Use vision-language models to analyze images via chat-style requests.
- Endpoint:
POST /v1/chat/completions - Authorization:
Bearer <token>(header) - Body (application/json):
model(string, required) - Example:Qwen/Qwen3-VL-Plusmessages(array, required) - Chat-style payload that can include text and image items.max_tokens(integer, default: 16384)temperature(number, default: 0.1)top_p(number, default: 1)stream(boolean, default: true)
Response (200 application/json): standard OpenAI-compatible chat completion response or streamed chunks. Example fields:
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1710000000,
"model": "Qwen/Qwen3-VL-Plus",
"choices": [{ "index": 0, "message": { /* ... */ }, "finish_reason": "stop" }],
"usage": { "prompt_tokens": 120, "completion_tokens": 48, "total_tokens": 168 },
"x_metrics": { "ttft_seconds": 0.41, "tps": 38.4, "total_time_seconds": 1.92 }
}OCR endpoints accept chat-style image inputs and return extracted text. Use the OCR-specialized vision model for best results.
- Endpoint:
POST /v1/chat/completions - Authorization:
Bearer <token>(header) - Body (application/json):
model(string, required) - Example:Hunyuan/Hunyuan-OCR-1Bmessages(array, required) - Chat-style input with text instructions and image contentmax_tokens(integer, default: 8192)temperature(number, default: 0.1)top_p(number, default: 1)stream(boolean, default: false)
Response (200 application/json): standard chat completion response containing extracted text and metadata:
{
"id": "chatcmpl-ocr-123456",
"object": "chat.completion",
"created": 1710000000,
"model": "Hunyuan/Hunyuan-OCR-1B",
"choices": [{ "index": 0, "message": { /* extracted text */ }, "finish_reason": "stop" }]
}