Skip to main content
Because the Deepshi API is OpenAI-compatible, you can use it in LangChain with the standard OpenAI chat model class. Just point it at the Deepshi base URL and key.

Python

pip install langchain-openai
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="deepshi-3.0",
    base_url="https://api.deepshi.ai/v1",
    api_key="YOUR_DEEPSHI_API_KEY",
)

print(llm.invoke("Write a haiku about the sea.").content)

JavaScript / TypeScript

npm install @langchain/openai
import { ChatOpenAI } from "@langchain/openai";

const llm = new ChatOpenAI({
  model: "deepshi-3.0",
  configuration: { baseURL: "https://api.deepshi.ai/v1" },
  apiKey: process.env.DEEPSHI_API_KEY,
});

const res = await llm.invoke("Write a haiku about the sea.");
console.log(res.content);
Swap model for any id in the catalog. Tool calling and streaming work through LangChain’s standard interfaces.