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

# Migrating from OpenAI

> Move an existing OpenAI integration to Deepshi with minimal changes.

If your app already calls the OpenAI API, switching to Deepshi is a two-line change. Deepshi speaks the same protocol, so your prompts, SDKs, and most tooling keep working.

## The two changes

<Steps>
  <Step title="Change the base URL">
    Point your client at `https://api.deepshi.ai/v1` instead of OpenAI's base URL.
  </Step>

  <Step title="Use your Deepshi key">
    Replace your OpenAI key with your Deepshi key. See [Authentication](/get-started/authentication).
  </Step>
</Steps>

```diff theme={null}
  from openai import OpenAI

  client = OpenAI(
-     base_url="https://api.openai.com/v1",
-     api_key=OPENAI_API_KEY,
+     base_url="https://api.deepshi.ai/v1",
+     api_key=DEEPSHI_API_KEY,
  )
```

## Update model names

Set the `model` field to a Deepshi catalog id; check the [models catalog](/models/text-models) for available ids, including the frontier models Deepshi exposes.

```diff theme={null}
-  model="gpt-4o",
+  model="deepshi-3.0",
```

## What carries over

* Chat completions request/response shapes.
* Streaming (`stream: true`) and the SSE format.
* Tool / function calling.
* Most libraries and agent frameworks built on the OpenAI API, as long as you override the base URL and key.

## Things to check

* **Pricing and credits** work differently. Deepshi uses prepaid, USD-denominated credits. See [Credits & billing](/get-started/pricing-credits).
* **Error codes** mostly match OpenAI, with `402` specifically meaning you're out of credits. See [Errors](/resources/errors).
* **Parameters** a given model doesn't support are ignored rather than rejected.
