If your application already uses the OpenAI Python SDK, testing another model does not have to mean rewriting the integration. An OpenAI-compatible endpoint lets you keep the familiar client, messages format, and response handling.
This tutorial shows a minimal DeepSeek request through JinzeAI's public beta endpoint.
1. Install the SDK
python -m pip install openai
2. Store the API key safely
Do not hard-code an API key or commit it to Git.
On macOS or Linux:
export JINZEAI_API_KEY="your_api_key_here"
On PowerShell:
$env:JINZEAI_API_KEY="your_api_key_here"
3. Create the client
import os
from openai import OpenAI
client = OpenAI(
base_url="https://jinzeai.cc/v1",
api_key=os.environ["JINZEAI_API_KEY"],
)
The important change is base_url. The rest of the SDK remains familiar.
4. Send a request
response = client.chat.completions.create(
model="deepseek-chat",
messages=[
{
"role": "user",
"content": "Explain API gateways in one sentence.",
}
],
)
print(response.choices[0].message.content)
Common errors
HTTP 401
Confirm that the API key is active and that your client sends it as a bearer token. If a key was ever exposed publicly, rotate it instead of continuing to use it.
HTTP 404
Confirm that the base URL is exactly:
https://jinzeai.cc/v1
Chat requests must use POST /chat/completions.
Slow first test
Start with a short prompt and a new conversation. Large message histories can add substantial input tokens and latency.
Try the public beta
JinzeAI is inviting early beta testers outside mainland China. The beta may include a limited free test credit, and no payment is required to test it.
Model availability and usage limits may change during beta. I would especially value feedback about setup clarity, latency, and SDK compatibility.
Top comments (0)