together
The official Python library for the together API
What it is and what it does
Together is the official Python SDK for accessing the Together API, a service that provides inference endpoints for language models and other AI services. It wraps the REST API with type-safe Python clients (both sync and async) generated by Stainless, handling authentication, request serialization, and response parsing automatically. The library supports chat completions, streaming responses via Server-Sent Events, and realtime audio transcription with automatic reconnection and speech buffering.
The package is designed for developers integrating language model inference into Python applications. It provides both a synchronous `Together` client for simple scripts and an `AsyncTogether` client for high-concurrency workloads. Optional extras like `aiohttp` backend and `realtime` transcription support allow customization for specific use cases. All request and response types are defined as TypedDicts with full type hints, enabling IDE autocomplete and static type checking.
Use it for:
- Build a chatbot or conversational AI application using the chat completions API with streaming support for real-time token delivery.
- Transcribe live audio from microphones or phone calls using the realtime transcription endpoint with automatic reconnection on network failures.
- Integrate language model inference into an async web service or background job queue for high-throughput inference requests.
- Prototype or deploy multi-turn dialogue systems that leverage typed request/response structures for validation and IDE support.
- Stream model outputs directly to end users with Server-Sent Events while maintaining connection resilience.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python client library for the Together REST API, providing synchronous and asynchronous access to language models, chat completions, streaming responses, and realtime transcription services.
Yes. The package is actively maintained (release 2 days old), has no known vulnerabilities, low install friction, and provides a well-typed, production-ready interface to the Together API. The permissive Apache-2.0 license and support for modern Python versions (3.10+) make it suitable for most projects. Install it if you need to call the Together API from Python; the synchronous and asynchronous clients cover both simple and high-concurrency scenarios.
Install
together on PyPI
pip
pip install togetheruv
uv add togetherpoetry
poetry add togetherInstalling together
Before you install
Low friction installation with a pure Python wheel. Active maintenance with a release 2 days old. Requires Python 3.10 or later and depends on 14 runtime packages including httpx for HTTP and pydantic for type validation.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions—suitable for most production applications.
Quickstart
pip install together
import os
from together import Together
client = Together(api_key=os.environ.get("TOGETHER_API_KEY"))
chat_completion = client.chat.completions.create(
messages=[{"role": "user", "content": "Say this is a test!"}],
model="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
)
print(chat_completion.choices)
Requires a valid TOGETHER_API_KEY environment variable or explicit api_key parameter to authenticate with the Together service.
Verify before relying
- Whether the 14 runtime dependencies are all required for basic usage or if some are optional for specific features.
- Performance characteristics and rate-limit handling of the synchronous vs. asynchronous clients under load.
- Stability guarantees for the realtime transcription feature and automatic reconnection behavior in production.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 14 — anyio, cyclopts, detect-agent, distro, filelock, httpx, pydantic, rich, sniffio, tomli, tqdm, types-pyyaml, types-tqdm, typing-extensions |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,725,341/month — #2,920 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: together-2.31.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
groqProvides a Python client library for accessing…
permissive · top 1,000 on PyPI
writer-sdkPython client library for the Writer REST API,…
permissive · top 15,000 on PyPI
llama-api-clientProvides a typed Python client for the Llama…
permissive · top 15,000 on PyPI
sambanovaProvides a Python client library for accessing…
permissive · top 15,000 on PyPI
openaiProvides a Python client library for the OpenAI…
permissive · top 1,000 on PyPI
cerebras-cloud-sdkProvides a Python client library for accessing…
permissive · top 5,000 on PyPI
llama-stack-clientPython client library for interacting with…
permissive · top 15,000 on PyPI
perplexityaiProvides a Python client library for the…
permissive · top 5,000 on PyPI
rev-aiPython SDK for Rev AI's speech-to-text API,…
permissive · top 15,000 on PyPI
composio-clientA Python client library for the Composio REST…
permissive · top 5,000 on PyPI