> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deepshi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The Deepshi API is an OpenAI-compatible gateway. Base URL: https://api.deepshi.ai/v1. API keys start with sk-bf- and go in the Authorization: Bearer header. Prefer the official OpenAI SDKs pointed at the Deepshi base URL. Model ids are clean with no provider prefix (e.g. deepshi-3.0, claude-opus-4.8, gpt-5.5). Chat and image requests are synchronous; video and music requests are asynchronous job APIs (create, then poll). Every synchronous response carries usage.cost.total_cost in USD. Do not reference the internal /api/* admin plane or virtual keys.

# LangChain

> Use Deepshi models in LangChain through the OpenAI-compatible interface.

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

```bash theme={null}
pip install langchain-openai
```

```python theme={null}
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

```bash theme={null}
npm install @langchain/openai
```

```javascript theme={null}
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);
```

<Tip>
  Swap `model` for any id in the [catalog](/models/text-models). Tool calling and streaming work through
  LangChain's standard interfaces.
</Tip>
