Quick Start
This page shows how to organize an API reference like the DeepSeek docs: endpoint description, parameter table, and multi-language call examples.
Your first call
Using the "chat completions" endpoint as an example, with curl / Python / Node variants.
- curl
- Python
- Node.js
curl https://api.example.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{"model":"example-chat","messages":[{"role":"user","content":"hi"}]}'
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.example.com/v1")
resp = client.chat.completions.create(
model="example-chat",
messages=[{"role": "user", "content": "hi"}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.example.com/v1" });
const resp = await client.chat.completions.create({
model: "example-chat",
messages: [{ role: "user", content: "hi" }],
});
console.log(resp.choices[0].message.content);