Integrate Onpi into any client that speaks the OpenAI API. One base URL, one key, five models.
All traffic goes through a single endpoint:
https://onpi.live/v1
Authentication is by key, in the Authorization header:
Authorization: Bearer sk-xxxxxxxxxxxxxxxx
Keys are created in the dashboard, under Tokens. Each key can have its own quota, model limit, IP restriction and group. All new accounts start in the Onpi group, which grants access to all five models.
curl https://onpi.live/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ONPI_API_KEY" \
-d '{
"model": "deepseek-chat",
"messages": [
{"role": "user", "content": "Explain what an API gateway is in two sentences."}
]
}'
The response follows the OpenAI format: choices[0].message.content, with usage reporting input, output and cached tokens.
from openai import OpenAI
client = OpenAI(
api_key="sk-...",
base_url="https://onpi.live/v1",
)
r = client.chat.completions.create(
model="deepseek-chat",
messages=[{"role": "user", "content": "Hello!"}],
)
print(r.choices[0].message.content)
| Model | What for | Endpoint |
|---|---|---|
deepseek-chat | General purpose: conversation, code, tools, vision. | openai |
deepseek-reasoner | Step-by-step reasoning, returns reasoning_content before the answer. | openai |
deepseek-search | Built-in web search, with sources cited in the text. | deepseek-tools-search |
deepseek-latest | Alias that always points to the most recent version. | openai |
Onpi | The platform's own conversational model. | openai |
The live list is at GET /v1/models (requires a key) and prices are on the pricing page.
/v1/embeddings and /v1/images/generations return 404. Vision is supported by deepseek-chat (see section 8).Usage is metered per token and deducted from your balance. DeepSeek models use dynamic pricing, with two tiers per 1M tokens:
| Model | Input | Output | Cache read |
|---|---|---|---|
deepseek-chatdeepseek-latestdeepseek-reasonerdeepseek-search | $0.15 peak: $0.30 | $0.60 peak: $1.20 | $0.003 peak: $0.006 |
Onpi | $0.20 | $0.20 | — |
Asia/Shanghai time zone (UTC+8). Outside those hours, and at weekends, the standard price applies. The dashboard shows the real cost of each call in the usage log.Balance and quotas: the internal quota unit is 500,000 per dollar. Every new account receives 400 quota units as a welcome credit. Balance is purchased in the dashboard, under Wallet.
Add "stream": true. The response arrives as SSE, one data: per chunk, ending with data: [DONE].
curl -N https://onpi.live/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ONPI_API_KEY" \
-d '{"model":"deepseek-chat","stream":true,
"messages":[{"role":"user","content":"Count to 10."}]}'
With usage included in the final chunk when you send "stream_options": {"include_usage": true}.
deepseek-reasoner returns the reasoning in its own field, reasoning_content, before the final answer in content:
{
"choices": [{
"message": {
"role": "assistant",
"reasoning_content": "The user asked for 2+2...",
"content": "4"
},
"finish_reason": "stop"
}]
}
When streaming, the reasoning arrives in delta.reasoning_content and the text in delta.content. Show them separately if you want the full "thinking" experience.
The tools parameter in the OpenAI format is accepted and forwarded to the model. Example:
{
"model": "deepseek-chat",
"messages": [{"role": "user", "content": "What is the weather in Maputo?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Current weather in a city",
"parameters": {"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"]}
}
}],
"tool_choice": "auto"
}
For internet search use deepseek-search: it queries the web and returns the text with [citation:N] markers in the response body.
{"model": "deepseek-search",
"messages": [{"role": "user", "content": "What is today's date? Search."}]}
Send the image as image_url, either a public URL or a base64 data URL, using deepseek-chat:
{
"model": "deepseek-chat",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Describe this image."},
{"type": "image_url",
"image_url": {"url": "data:image/png;base64,iVBORw0KGgo..."}}
]
}]
}
To try it in the browser, use the playground — your key stays in your browser only.
| Code | Response | Meaning |
|---|---|---|
| 401 | Invalid token | Invalid, revoked or missing key. |
| 403 | model_not_allowed | Key has no access to that model or group. |
| 429 | rate_limit | Requests-per-minute limit reached. |
| 402 / 400 | insufficient_quota / invalid_request | Insufficient balance or malformed request. |
| 503 | model_not_found | No channel available for that model in the group. |
Provider OpenAI → Base URL https://onpi.live/v1, API Key sk-.... The model list is read automatically from /v1/models.
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="deepseek-chat",
api_key="sk-...",
base_url="https://onpi.live/v1",
)
Provider "OpenAI Compatible", same base URL, and pick deepseek-chat for speed or deepseek-reasoner for tasks that need reasoning.
Just replace https://api.openai.com/v1 with https://onpi.live/v1 and use an Onpi key.