OpenAI Compatible
Use MisterPilot as a drop-in OpenAI replacement
Point any OpenAI SDK at https://misterpilot.online/v1
— your API key, any model supported by DeepSeek.
1. Python OpenAI SDK
Install the OpenAI package and swap base_url — that's it.
pip install
pip install openai
python — streaming
from openai import OpenAI
client = OpenAI(
base_url="https://misterpilot.online/v1",
api_key="sk-your-deepseek-api-key",
)
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in one paragraph."},
],
temperature=0.7,
max_tokens=1024,
)
print(response.choices[0].message.content)
python — streaming (smooth token-by-token)
from openai import OpenAI
client = OpenAI(
base_url="https://misterpilot.online/v1",
api_key="sk-your-deepseek-api-key",
)
stream = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Write a haiku about coding."}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
2. cURL Direct HTTP
Call the API directly from the terminal with zero dependencies.
Method
POST
Endpoint
/v1/chat/completions
Content-Type
application/json
Auth
Authorization: Bearer <key>
cURL — non-streaming
curl https://misterpilot.online/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-deepseek-api-key" \
-d '{
"model": "deepseek-v4-pro",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"temperature": 0.7,
"max_tokens": 256
}'
cURL — streaming (SSE)
curl https://misterpilot.online/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-deepseek-api-key" \
-d '{
"model": "deepseek-v4-pro",
"messages": [
{"role": "user", "content": "Count from 1 to 20, one number per line."}
],
"stream": true
}'
3. API Key Resolution
Your key is resolved in this priority order. You only need to provide it one way.
#1
Authorization: Bearer <key> header
#2
"apikey" field in the JSON body
#3
Default from config.yaml
4. Built-in PII Protection
Every user message is automatically scanned and redacted before it reaches the LLM. Emails, phone numbers, IP addresses, credit card numbers, SSNs, and more are replaced with placeholders — no configuration required.
example — automatically redacted
# This message:
{ "role": "user", "content": "My email is alice@company.com, call me at +1-555-123-4567" }
# Becomes this before reaching the LLM:
{ "role": "user", "content": "My email is [EMAIL_0], call me at [PHONE_0]" }
5. Supported Models
Default
deepseek-v4-pro
Also available
deepseek-v4-flash (any model your DeepSeek API key grants access to)