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

# API reference

> Endpoints, request shapes, and conventions for the Deepshi API.

The Deepshi API is an OpenAI-compatible REST API. The **Endpoints** section in the sidebar has full per-endpoint reference pages with request/response schemas and an interactive playground.

## Base URL

```
https://api.deepshi.ai/v1
```

## Authentication

All requests require a bearer token:

```
Authorization: Bearer YOUR_DEEPSHI_API_KEY
```

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/get-started/authentication">
    Create a key, send it as a bearer token, and keep it safe.
  </Card>

  <Card title="Errors" icon="triangle-exclamation" href="/resources/errors">
    Status codes and the JSON error object, with handling tips.
  </Card>
</CardGroup>

## Endpoints

| Method & path                            | Description                                                                                   |
| ---------------------------------------- | --------------------------------------------------------------------------------------------- |
| `GET /v1/models`                         | List the available models                                                                     |
| `POST /v1/chat/completions`              | [Generate a chat completion](/capabilities/text-and-chat) (streaming, tools, JSON, reasoning) |
| `POST /v1/images/generations`            | [Generate an image](/capabilities/image-generation) from a prompt                             |
| `POST /v1/images/edits`                  | [Edit an image](/capabilities/image-editing) with a prompt and input image                    |
| `POST /v1/videos`                        | [Create a video job](/capabilities/video-generation) from a prompt or an image                |
| `GET /v1/videos/{id}`                    | Poll a video job for its status and result                                                    |
| `GET /v1/videos/{id}/content`            | Redirect to the finished video file                                                           |
| `DELETE /v1/videos/{id}`                 | Cancel or delete a video job                                                                  |
| `POST /v1/audio/generations`             | [Create a music job](/capabilities/audio-generation) from a prompt and lyrics                 |
| `GET /v1/audio/generations/{id}`         | Poll a music job for its status and result                                                    |
| `GET /v1/audio/generations/{id}/content` | Redirect to the finished audio file                                                           |

Chat and image requests are synchronous: the response carries the result. Video and music requests are asynchronous: they return a job that you poll until it completes.

## Conventions

* **Format:** JSON request and response bodies, matching the OpenAI schema.
* **Streaming:** Set `"stream": true` for Server-Sent Events. The final chunk carries a `usage` object with `cost`. See [Streaming](/capabilities/text-and-chat#streaming).
* **Usage & cost:** Synchronous responses (chat and image) include a `usage` object; Deepshi adds `usage.cost.total_cost`, the USD cost of the request, drawn from your balance. Asynchronous video and music jobs do not carry an inline `usage.cost`; check per-model rates and your balance on [deepshi.ai](https://deepshi.ai/).
* **Errors:** Standard HTTP status codes with a JSON `error` object. See [Errors](/resources/errors).
