> ## 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.

# Vercel AI SDK

> Use Deepshi models with the Vercel AI SDK.

The [Vercel AI SDK](https://sdk.vercel.ai/) works with Deepshi through its OpenAI-compatible provider. Point the provider at the Deepshi base URL and key.

## Setup

```bash theme={null}
npm install ai @ai-sdk/openai-compatible
```

```javascript theme={null}
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";

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

const { text } = await generateText({
  model: deepshi("deepshi-3.0"),
  prompt: "Write a haiku about the sea.",
});

console.log(text);
```

## Streaming

Use `streamText` to render tokens as they arrive, which is ideal for chat UIs:

```javascript theme={null}
import { streamText } from "ai";

const result = streamText({
  model: deepshi("deepshi-3.0"),
  prompt: "Explain backpropagation.",
});

for await (const chunk of result.textStream) {
  process.stdout.write(chunk);
}
```

<Tip>
  Use any model id from the [catalog](/models/text-models). See [Streaming](/capabilities/text-and-chat#streaming) for how
  streaming works at the API level.
</Tip>
