Skip to main content

Assisters Python SDK

Official Python SDK for the Assisters AI API.

Install

Not published yet. pip install assisters fails — this package is not on PyPI. Until it ships, use the OpenAI SDK against our base URL, which the API is compatible with:

pip install openai
from openai import OpenAI
client = OpenAI(api_key=os.environ["ASSISTERS_API_KEY"],
                base_url="https://api.assisters.dev/v1")

The rest of this README describes this package's own interface, for when it is released. See the SDK docs.

pip install assisters

Requires Python 3.9+. Depends on httpx.

Quickstart

from assisters import Assisters

client = Assisters(api_key="sk-...")  # base_url defaults to https://api.assisters.dev/v1

resp = client.chat.completions.create(
    model="assisters-chat-v1",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp["choices"][0]["message"]["content"])

Authentication uses Authorization: Bearer <api_key>.

API

# Chat (non-streaming)
client.chat.completions.create(model="assisters-chat-v1", messages=[...])

# Chat (streaming)
for chunk in client.chat.completions.create(
    model="assisters-chat-v1", messages=[...], stream=True
):
    print(chunk["choices"][0]["delta"].get("content", ""), end="")

# Embeddings
client.embeddings.create(model="assisters-embed-v1", input=["hello", "world"])

# Moderation
client.moderations.create(input="some text")

# Rerank
client.rerank(model="assisters-rerank-v1", query="q", documents=["a", "b"])

# Models
client.models.list()

# Image generation
client.images.generations.create(
    model="assisters-image-v1", prompt="a green robot", size="1024x1024"
)

# Audio transcription
with open("audio.webm", "rb") as f:
    client.audio.transcriptions.create(file=f, model="assisters-stt-v1")

# Text-to-speech -> raw audio bytes
audio = client.audio.speech.create(
    model="assisters-tts-v1", input="Hello there", voice="nova", response_format="mp3"
)

# Audio enhancement -> enhanced audio bytes
with open("noisy.wav", "rb") as f:
    enhanced = client.audio.enhance(file=f, model="assisters-voice-enhance")

# Translation
client.translate(text="Hello", target_language="Spanish")

# Agent (Max tier) — synchronous run
client.agent.run(query="Research the latest on X", mode="research")

# Agent — streaming events (SSE)
for event in client.agent.stream(query="Research X", mode="research"):
    print(event)

# Rate limit
client.get_rate_limit()

# One model, with its pricing and limits
client.models.retrieve("assisters-chat-v1")

Removed: client.keys.* and client.webhooks.* were here. Both call /api/keys and /api/webhooks, which authenticate with a signed-in browser session rather than a Bearer key — so every call returned 401 for a client built with an API key, as this one is. Manage keys and webhooks in the dashboard.

Errors

Every failure raises AssistersAPIError (.status, .message, .type), or one of its subclasses so you can branch on the cause:

from assisters import Assisters, AssistersAPIError, AuthError, NotFoundError, RateLimitError

try:
    client.chat.completions.create(model="assisters-chat-v1", messages=[...])
except RateLimitError as e:
    ...          # 429 — rate limited, or the wallet is empty
except AuthError as e:
    ...          # 401/403 — key missing, invalid or revoked
except NotFoundError as e:
    ...          # 404 — no such model
except AssistersAPIError as e:
    print(e.status, e.type, e.message)

Transport failures raise AssistersAPIError with status=0 and type="network_error".

Metadata

Release files for assisters 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for assisters 0.1.0
File Size Uploaded
assisters-0.1.0.tar.gz 11.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for assisters 0.1.0
File Interpreter ABI Platform
assisters-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.7 kB

Release files / assisters-0.1.0.tar.gz

Download URL assisters-0.1.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8d1fb683a286d0ca2616ef18ee34f4179d797826e8e01439151c9d84478ee4a6
BLAKE2b-256 checksum
How to use checksums
be528c860adb1bcc02d80aef26a17877b0b178e37055dabe79f430a77ce986f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / assisters-0.1.0-py3-none-any.whl

Download URL assisters-0.1.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d114a87f9d0c72bdd1a45abc32f427c3bbe8ce713d761e04bcee7bf6c3b8c3a3
BLAKE2b-256 checksum
How to use checksums
2269846b31337965a983276ae2e3b615283c221c9eb8631795e54da3a0bc9588
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page