Skip to main content
The Deepshi API is OpenAI-compatible, so the official OpenAI SDKs work out of the box. You only change the base URL and the API key.

Python

Install the SDK:
pip install openai
Configure the client:
from openai import OpenAI

client = OpenAI(
    base_url="https://api.deepshi.ai/v1",
    api_key="sk-bf-...",  # your Deepshi key
)

resp = client.chat.completions.create(
    model="deepshi-3.0",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

JavaScript / TypeScript

Install the SDK:
npm install openai
Configure the client:
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.deepshi.ai/v1",
  apiKey: process.env.DEEPSHI_API_KEY,
});

const resp = await client.chat.completions.create({
  model: "deepshi-3.0",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);

Environment variables

The OpenAI SDKs also read configuration from the environment. Set these and you can drop the explicit arguments:
export OPENAI_BASE_URL="https://api.deepshi.ai/v1"
export OPENAI_API_KEY="sk-bf-..."
Because the request and response shapes match OpenAI’s, most libraries and agent frameworks built on the OpenAI API work too. Just override the base URL and key. See Migrating from OpenAI.

What’s supported

The chat completions surface follows the OpenAI schema. A few notes:
  • Set the model to a Deepshi catalog id (for example deepshi-3.0), not an OpenAI model name, unless you’re deliberately calling a frontier model exposed by Deepshi.
  • Parameters a given model doesn’t support are ignored rather than rejected.
  • Streaming uses the same stream: true flag and SSE format. See Streaming.