DEVELOPER FIELD NOTES / DOCS CHECKED 2026-09-23
DeepSeek
API endpoint & setup.
This is the documented OpenAI-compatible base URL. Use a DeepSeek model ID; OpenAI model names do not transfer across providers.
SDK base URL
https://api.deepseek.comFull request endpoint · POST
https://api.deepseek.com/chat/completionsRead the official DeepSeek documentation ↗ · Checked 2026-09-23; no live API call made.
A small starting point.
Install the library shown below. Set AI_MODEL to a model available to your account and DEEPSEEK_API_KEY to your key. In cURL, replace YOUR_MODEL_ID. Replace any workspace placeholders before running.
Python
# pip install openai
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DEEPSEEK_API_KEY"],
base_url="https://api.deepseek.com",
)
response = client.chat.completions.create(
model=os.environ["AI_MODEL"], messages=[{"role": "user", "content": "Hello!"}]
)
print(response)Node.js
// npm install openai
// Server-side Node.js; never expose API keys in a browser.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.DEEPSEEK_API_KEY,
baseURL: "https://api.deepseek.com",
});
const response = await client.chat.completions.create({
"model": process.env.AI_MODEL,
"messages": [
{
"role": "user",
"content": "Hello!"
}
]
});
console.log(response);cURL
curl 'https://api.deepseek.com/chat/completions' \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"model": "YOUR_MODEL_ID",
"messages": [
{
"role": "user",
"content": "Hello!"
}
]
}'Before moving this into production.
Check model availability, billing, rate limits and supported parameters in the provider documentation. Start with a small request from your backend. Keep keys out of client-side JavaScript and source control.
These examples show the request shape and configuration. They do not test your credentials or guarantee access to a model.
Compare other AI API endpoints →