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

# SDKs & Integrations

## Python SDK

The official Python SDK for deAPI. Generate images, videos, audio, transcriptions, embeddings, and more — through a type-safe Python interface with sync and async support.

> [card] [GitHub Repository](https://github.com/deapi-ai/deapi-python-sdk)
>
> deapi-ai/deapi-python-sdk

### Installation

```bash theme={null}
pip install git+https://github.com/deapi-ai/deapi-python-sdk.git
```

**Requirements:** Python 3.9+

> [!WARNING]
>
> The SDK is not on PyPI yet, so install it from GitHub as shown above. `pip install deapi` installs an unrelated package with the same import name.

### Quick Start

```python theme={null}
from deapi import DeapiClient

client = DeapiClient(api_key="YOUR_API_KEY")  # your deAPI key, e.g. "sk-dp-1234-AbCdEf..."

# Generate an image
job = client.images.generate(
    prompt="a cat floating in a nebula, photorealistic",
    model="Flux_2_Klein_4B_BF16",
    width=1024,
    height=1024,
    steps=4,
    seed=-1,
)

# Wait for the result (polls with exponential backoff)
result = job.wait()
print(result.result_url)
```

### Features

* **Full API coverage** — images, video, audio (TTS, voice cloning, music), transcription, embeddings, OCR, prompt enhancement
* **Sync + Async** — `DeapiClient` and `AsyncDeapiClient`
* **Job polling** — automatic exponential backoff with `.wait()`
* **Auto-retry** — built-in retry on rate limits (429) and server errors (5xx)
* **Type-safe** — full type hints, Pydantic v2 models, `py.typed` marker
* **Webhook verification** — HMAC-SHA256 signature validation
* **Price calculation** — every method has a `_price` counterpart to check cost before submitting

> [!TIP]
>
> For full documentation, configuration options, usage examples, and API reference, visit the [GitHub repository](https://github.com/deapi-ai/deapi-python-sdk).

***

## OpenAI SDK (drop-in compatible)

deAPI also exposes an OpenAI-compatible endpoint at `https://oai.deapi.ai/v1`. If you're already using the official OpenAI SDK in any language, you can route image generation, text-to-speech, transcription, embeddings, and video generation to deAPI by changing only `base_url` and `api_key` — your existing code stays unchanged. This works with Python, Node.js / TypeScript, Go, Java, .NET, and any framework that accepts a `base_url` parameter (LangChain, LlamaIndex, Vercel AI SDK).

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

client = OpenAI(
    api_key="YOUR_API_KEY",  # the same deAPI key as for the native API, e.g. "sk-dp-1234-AbCdEf..."
    base_url="https://oai.deapi.ai/v1",
)

response = client.images.generate(model="Flux1schnell", prompt="...", size="1024x1024", n=1)
```

> [card] [OpenAI Compatibility — full guide](https://docs.deapi.ai/openai-compatibility.md)
>
> Migration examples, supported endpoints, framework integrations, and known differences

***

## Coming Soon

We're working on official SDKs for:

* Node.js / TypeScript


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.