Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DEAPI_API_KEY=sk-dp-<id>-<secret>
# Set to 0 to stop the SDK filling unset parameters from the model card defaults
# DEAPI_FILL_MODEL_DEFAULTS=1

# Real-time status over WebSocket (pip install "deapi-sdk[ws] @ git+https://github.com/deapi-ai/deapi-python-sdk.git")
# Real-time status over WebSocket (pip install "deapi-sdk[ws]")
# All optional: anything unset is fetched from the API (GET /websocket) when the connection opens.
# The "Client ID" shown in your dashboard; pass client_id= explicitly when serving many users
# DEAPI_CLIENT_ID=your-client-id
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release

# Publishing a GitHub Release (tag vX.Y.Z) builds the package and uploads it to PyPI.
# Uploads use PyPI trusted publishing (OIDC): no API token is stored in the repository.
on:
release:
types: [published]

permissions:
contents: read

jobs:
build:
name: build distributions
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: "3.11"
- name: Check that the tag matches the package version
env:
TAG: ${{ github.event.release.tag_name }}
run: |
version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
if [ "$TAG" != "v$version" ]; then
echo "Release tag $TAG does not match pyproject version v$version" >&2
exit 1
fi
- name: Build
run: |
python -m pip install build twine
python -m build
python -m twine check --strict dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

publish:
name: publish to PyPI
needs: build
runs-on: ubuntu-24.04
environment:
name: pypi
url: https://pypi.org/project/deapi-sdk/
permissions:
id-token: write # trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project are documented in this file.
Versions follow [Semantic Versioning](https://semver.org/) (pre-1.0: minor versions may contain breaking changes).

## [0.6.1] - 2026-11-19

### Added

- Published on PyPI: `pip install deapi-sdk` (`pip install "deapi-sdk[ws]"` for real-time status).
Releases are uploaded by GitHub Actions when a GitHub Release is published.

### Changed

- README links are absolute, so they also work on the PyPI project page.
- The product name is spelled deAPI throughout the docs and docstrings.

## [0.6.0] - 2026-11-19

### Added
Expand Down
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,19 @@ Generate images, videos, audio, transcriptions, embeddings, and more — all thr

## Installation

The SDK is **not on PyPI yet**. Install it straight from GitHub:

```bash
pip install git+https://github.com/deapi-ai/deapi-python-sdk.git
# or pin a branch, tag or commit:
pip install git+https://github.com/deapi-ai/deapi-python-sdk.git@main
pip install deapi-sdk
```

Real-time job updates over WebSocket need the optional `ws` extra (installs `websockets`):

```bash
pip install "deapi-sdk[ws] @ git+https://github.com/deapi-ai/deapi-python-sdk.git"
pip install "deapi-sdk[ws]"
```

The latest unreleased code can be installed straight from GitHub:
`pip install git+https://github.com/deapi-ai/deapi-python-sdk.git@main`.

> `pip install deapi` installs an **unrelated** package. Do not use it.

For development (`pytest` runs from the repo root):
Expand Down Expand Up @@ -432,7 +431,7 @@ async with AsyncDeapiClient() as client:
discovery call raises the usual API exception (for example `AuthenticationError`); an unusable response
raises `RealtimeError`.

See [`examples/realtime_status.py`](examples/realtime_status.py).
See [`examples/realtime_status.py`](https://github.com/deapi-ai/deapi-python-sdk/blob/main/examples/realtime_status.py).

## Error Handling

Expand Down Expand Up @@ -580,23 +579,23 @@ async def handle_webhook(request: Request):

## API Reference

See [docs/api-reference.md](docs/api-reference.md) for method signatures, parameters and return
See [docs/api-reference.md](https://github.com/deapi-ai/deapi-python-sdk/blob/main/docs/api-reference.md) for method signatures, parameters and return
types, and [docs.deapi.ai](https://docs.deapi.ai) for the HTTP API.

## Examples

The [`examples/`](examples/) directory contains runnable scripts:
The [`examples/`](https://github.com/deapi-ai/deapi-python-sdk/tree/main/examples) directory contains runnable scripts:

| File | Description |
|------|-------------|
| [`basic_image.py`](examples/basic_image.py) | Image generation, transformation, upscale |
| [`async_batch.py`](examples/async_batch.py) | Concurrent async job submission |
| [`transcription.py`](examples/transcription.py) | Transcription with JSON and plain-text transcripts |
| [`tts_and_audio.py`](examples/tts_and_audio.py) | Text-to-speech and music generation |
| [`video_generation.py`](examples/video_generation.py) | Text-to-video and image-to-video |
| [`realtime_status.py`](examples/realtime_status.py) | Live job progress over WebSocket |
| [`webhook_server.py`](examples/webhook_server.py) | Flask webhook receiver with signature verification |
| [`error_handling.py`](examples/error_handling.py) | Error handling patterns and best practices |
| [`basic_image.py`](https://github.com/deapi-ai/deapi-python-sdk/blob/main/examples/basic_image.py) | Image generation, transformation, upscale |
| [`async_batch.py`](https://github.com/deapi-ai/deapi-python-sdk/blob/main/examples/async_batch.py) | Concurrent async job submission |
| [`transcription.py`](https://github.com/deapi-ai/deapi-python-sdk/blob/main/examples/transcription.py) | Transcription with JSON and plain-text transcripts |
| [`tts_and_audio.py`](https://github.com/deapi-ai/deapi-python-sdk/blob/main/examples/tts_and_audio.py) | Text-to-speech and music generation |
| [`video_generation.py`](https://github.com/deapi-ai/deapi-python-sdk/blob/main/examples/video_generation.py) | Text-to-video and image-to-video |
| [`realtime_status.py`](https://github.com/deapi-ai/deapi-python-sdk/blob/main/examples/realtime_status.py) | Live job progress over WebSocket |
| [`webhook_server.py`](https://github.com/deapi-ai/deapi-python-sdk/blob/main/examples/webhook_server.py) | Flask webhook receiver with signature verification |
| [`error_handling.py`](https://github.com/deapi-ai/deapi-python-sdk/blob/main/examples/error_handling.py) | Error handling patterns and best practices |

## Requirements

Expand All @@ -607,4 +606,4 @@ The [`examples/`](examples/) directory contains runnable scripts:

## License

MIT — see [LICENSE](LICENSE) for details.
MIT — see [LICENSE](https://github.com/deapi-ai/deapi-python-sdk/blob/main/LICENSE) for details.
5 changes: 2 additions & 3 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
Reference for the classes, methods and types in the `deapi_sdk` package. It describes deAPI API **v2**, the only version supported since 0.4.0 (see
[Upgrading to 0.5.0](../README.md#upgrading-to-050) and [Upgrading to 0.4.0](../README.md#upgrading-to-040) for the breaking changes). The HTTP API itself is documented at <https://docs.deapi.ai>.

Install: `pip install git+https://github.com/deapi-ai/deapi-python-sdk.git` (not on PyPI yet;
`pip install deapi` is an unrelated package).
Install: `pip install deapi-sdk` (`pip install deapi` is an unrelated package).

## Table of Contents

Expand Down Expand Up @@ -563,7 +562,7 @@ has the same interface with `async` methods.
## Realtime (WebSocket)

Live job status over one WebSocket connection. Needs the optional extra:
`pip install "deapi-sdk[ws] @ git+https://github.com/deapi-ai/deapi-python-sdk.git"` (installs
`pip install "deapi-sdk[ws]"` (installs
`websockets` 17.x). Without it, connecting raises `ImportError`.

### `client.realtime()`
Expand Down
2 changes: 1 addition & 1 deletion examples/realtime_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
With --watch it just prints every status event on your channel (all of your jobs).

Requires the optional extra:
pip install "deapi-sdk[ws] @ git+https://github.com/deapi-ai/deapi-python-sdk.git"
pip install "deapi-sdk[ws]"

Usage:
export DEAPI_API_KEY="sk-dp-<id>-<secret>"
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "deapi-sdk"
version = "0.6.0"
version = "0.6.1"
description = "Official Python SDK for deAPI — distributed AI inference platform"
readme = "README.md"
license = "MIT"
Expand All @@ -14,7 +14,7 @@ authors = [
]
keywords = ["deapi", "ai", "inference", "sdk", "stable-diffusion", "whisper", "tts"]
classifiers = [
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
Expand Down Expand Up @@ -49,6 +49,9 @@ Documentation = "https://docs.deapi.ai/other/sdks-and-integrations"
Repository = "https://github.com/deapi-ai/deapi-python-sdk"
Changelog = "https://github.com/deapi-ai/deapi-python-sdk/blob/main/CHANGELOG.md"

[tool.hatch.build.targets.sdist]
include = ["src", "tests", "docs", "examples", "README.md", "CHANGELOG.md", "LICENSE", "pyproject.toml"]

[tool.hatch.build.targets.wheel]
packages = ["src/deapi_sdk"]

Expand Down
2 changes: 1 addition & 1 deletion src/deapi_sdk/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import annotations

__version__ = "0.6.0"
__version__ = "0.6.1"