aiodeepseek
A high-performance async Python client for the private DeepSeek API. Supports streaming, image uploads, multi-turn conversations, and new account registration.
➡️ Russian documentation: docs/ru/README.md
Installation
pip install aiodeepseek
A C++ extension build requires a compiler with AVX2 support and pybind11. More details are in docs/en/pow.md. You can also download a prebuilt release.
Quick start
Email/password authentication
import asyncio
from aiodeepseek import DeepSeekClient
async def main():
async with DeepSeekClient(email="myname@example.com", password="password123") as client:
result = await client.ask("Hello!")
print(result.text)
asyncio.run(main())
Token authentication
import asyncio
from aiodeepseek import DeepSeekClient
async def main():
async with DeepSeekClient(token="YOUR_TOKEN") as client:
result = await client.ask("Hello!")
print(result.text)
asyncio.run(main())
Streaming a response
import asyncio
from aiodeepseek import DeepSeekClient
async def main():
async with DeepSeekClient(token="YOUR_TOKEN") as client:
async for chunk in client.ask_stream("Tell me about Python"):
print(chunk, end="", flush=True)
asyncio.run(main())
Multi-turn conversation
import asyncio
from aiodeepseek import DeepSeekClient
async def main():
async with DeepSeekClient(token="YOUR_TOKEN") as client:
chat = client.new_conversation()
print((await chat.ask("What is your name?")).text)
print((await chat.ask("What can you do?")).text)
asyncio.run(main())
Image upload
import asyncio
from pathlib import Path
from aiodeepseek import DeepSeekClient
async def main():
async with DeepSeekClient(token="YOUR_TOKEN") as client:
img = await client.upload_image(Path("photo.jpg"))
result = await client.ask("What is in the photo?", image=img)
print(result.text)
asyncio.run(main())
or by passing Path | bytes directly to ask:
import asyncio
from pathlib import Path
from aiodeepseek import DeepSeekClient
async def main():
async with DeepSeekClient(token="YOUR_TOKEN") as client:
result = await client.ask(
prompt="What is in the photo?",
image=Path("photo.jpg")
)
print(result.text)
asyncio.run(main())
New account registration
import asyncio
from aiodeepseek import DeepSeekClient
async def main():
await DeepSeekClient.send_reg_code("myname@example.com")
code = input("Code from the email: ")
token = await DeepSeekClient.confirm_reg_code("myname@example.com", "password123", code)
print("Token:", token)
asyncio.run(main())
Model types
from aiodeepseek import DeepSeekClient
from aiodeepseek.types.enums import ModelType
async with DeepSeekClient(token="...", model=ModelType.VISION) as client:
...
| Value | Description |
|---|---|
ModelType.DEFAULT |
Standard language model |
ModelType.EXPERT |
Deep reasoning model |
ModelType.VISION |
Model with machine vision support |
Error handling
import asyncio
from aiodeepseek import DeepSeekClient
from aiodeepseek.types.exceptions import AuthorizationError, DeepSeekError
async def main():
try:
async with DeepSeekClient(token="invalid") as client:
await client.ask("Hello")
except AuthorizationError:
print("Token is invalid")
except DeepSeekError as e:
print(f"API error: {e}")
asyncio.run(main())
Proof-of-Work
Before every request, the client automatically solves the PoW challenge issued by the DeepSeek server. Typical difficulty is 144,000 iterations. The calculation is implemented in C++ using AVX2, which keeps it barely noticeable in practice. More details are in docs/en/pow.md.
Documentation
- DeepSeekClient - client methods
- Conversation - multi-turn dialog
- Types and data models
- Exceptions
- Proof-of-Work
Requirements
- Python 3.9+
aiohttp >= 3.9- A C++17 compiler with AVX2 (to build the extension) or manually downloaded wheels.
Metadata
Release files for aiodeepseek 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiodeepseek-0.1.1.tar.gz | 59.6 kB | Without provenance | Details for aiodeepseek-0.1.1.tar.gz |
Built distributions (wheels)
Total release size: 17.9 MB
Release files / aiodeepseek-0.1.1.tar.gz
| Download URL | aiodeepseek-0.1.1.tar.gz |
|---|---|
| Size | 59.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f83fea318dc3925b671e32b93b3dfdfc705916de661d140074d028761b85c47
|
|
BLAKE2b-256 checksum How to use checksums |
3dc750d8f6c356aed1156b5715d7bdf7a250f6fe06501466d7a633a8bb855df6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp313-cp313-win_amd64.whl
| Download URL | aiodeepseek-0.1.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 138.7 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ffcfc7a07bd9450ac33942a908ced747eb314a56e97e5df2a37fbf6f011feb6c
|
|
BLAKE2b-256 checksum How to use checksums |
55c562409d9e6a0c2bbe75f19b92ef6ed0e1b54ad656d8a6159bfbd76030e059
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | aiodeepseek-0.1.1-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
524a0b9abfb3674b34f0edcd11c0d45e0e77fbb0fc5bfc36f2b82dd41814b2f7
|
|
BLAKE2b-256 checksum How to use checksums |
2818c947652281fb50675da7d9c640d7121483ca509e00c745f10e4162415a12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aiodeepseek-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
47de68718f16c1aae18f5f172197d77929ad1a228171439e382f2c4d3bd0168f
|
|
BLAKE2b-256 checksum How to use checksums |
282faed1c9fc79763a22fa72a4112bd82728b9d9fd316a8ac7cceaf5bcd56b0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp312-cp312-win_amd64.whl
| Download URL | aiodeepseek-0.1.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 138.6 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
361f13f0162532fca3417b1c4b8e774f00599bb8cb9a11fff30c9a8c202f7a89
|
|
BLAKE2b-256 checksum How to use checksums |
ce7e3b8487f73fd2113bfbdc4cf9d3de9b0c0e2c1eb484282d53c72354a46b99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | aiodeepseek-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
bde22f9929d7efaf3c9c20c97ffb01a960a5cc464ba31b5e9c6151fa68a9ba28
|
|
BLAKE2b-256 checksum How to use checksums |
a19f208e36c61380472c967669538266f8f759cc9b224737150a759c74fbfe9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aiodeepseek-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
9f4d43c41e354ab46fa97f8b9bee28d1f6fe011019598c878cc682ef6f1a96ee
|
|
BLAKE2b-256 checksum How to use checksums |
73cc4e499738d0982245916b34062de8c224b47cd733cc32a0e41a98e46a2426
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp311-cp311-win_amd64.whl
| Download URL | aiodeepseek-0.1.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 138.1 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fde31fbc344fe31366706e58317b2fd1236d1b9a66dd5222129e72ddc82d35e2
|
|
BLAKE2b-256 checksum How to use checksums |
729fa41266e83a813e834b91122a826041317d4b3e9e61d32dbe32ee8025e29f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | aiodeepseek-0.1.1-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
b8bbe94a54900e7d3ce94fb66337e73566de59c54ad2742f5c6a4a8f30d69e4c
|
|
BLAKE2b-256 checksum How to use checksums |
29669222a953965fd1a3d14954fb149e6bd7e111d1ce88cbce625b043d3b6087
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aiodeepseek-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
fe2916400b919670c355c2030d8b29114b0a93f51f32f62416ef2a06ce208327
|
|
BLAKE2b-256 checksum How to use checksums |
dcb16efa3f3c899c327c2bb47bdf6096eac5446f1ea8a3fea301b4110b337a53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp310-cp310-win_amd64.whl
| Download URL | aiodeepseek-0.1.1-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 137.0 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1412bfd0da1f7486790100bcee5601e6e12977d43814a304b9afd5db04a09ced
|
|
BLAKE2b-256 checksum How to use checksums |
968da4895eab5cf78597e994ba1997223804491cf764d99421b3b4ca3c68da73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | aiodeepseek-0.1.1-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
0e995bca8698938804aabe6fec0f5b64b32251b25b3e483db97af5065adf4f8b
|
|
BLAKE2b-256 checksum How to use checksums |
da92817f7e67cd92aa6e9f8f1a299536e59daf9a2993feab9393888efe909e9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aiodeepseek-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
c552c80ef85a14098e3d4507be3712b57f799b6c118065add3d6ee391ddb9695
|
|
BLAKE2b-256 checksum How to use checksums |
2ea9ff11529f42914dc0f1651bbe76259836729f53873c5fcc653d91c0ea4f45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp39-cp39-win_amd64.whl
| Download URL | aiodeepseek-0.1.1-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 136.7 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
412afdc3dcc2342d6e2bb0087f929a7ed3f966cfdda464675349dcbb500217d0
|
|
BLAKE2b-256 checksum How to use checksums |
1c555ff283c5a2d994132172ea01019d8a775a43801e59d96d286f841ed09d77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp39-cp39-musllinux_1_2_x86_64.whl
| Download URL | aiodeepseek-0.1.1-cp39-cp39-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
70160e5e9688c1d2fb0a952eb73be7e94ce035a3856d557ea9747edd72a624e5
|
|
BLAKE2b-256 checksum How to use checksums |
c83dac36dbd7d4b161b80744046c3a8a58cd52abea9cc91279f92e5325fa397c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / aiodeepseek-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | aiodeepseek-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
2e122dfd130276640a61607491e3566f3eb010fc2016b6c1eb3d91ad280ceb60
|
|
BLAKE2b-256 checksum How to use checksums |
3b6bee938bd2188164653939baa73e93ac43a48fa509850766d38e1780cde316
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for aiodeepseek 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.