BlogsTogether AIPython SDK

Python SDK

Python SDK

1
posts
2025

Together AI has released Python SDK v2.0, a new, type-safe, OpenAPI-generated client. This version offers improved architecture, better type safety and developer experience, future-proofing for new features, and compatibility with modern tools like `uv`. It utilizes `httpx` for better performance and includes enhanced error handling, a modern parameter system with keyword-only arguments, and new capabilities like raw response access, streaming helpers, and code interpreter session management. Many existing APIs are drop-in compatible, while others have updated signatures. New beta APIs for Instant Clusters are also included.

2025

Announcing Together Python SDK v2.0

12/12/2025

This post announces the release of Python SDK v2.0, a significant overhaul of the SDK. Key technical contributions include: generation from an OpenAPI specification using Stainless for closer API mapping, implementation of TypeScript-like typing in Python for improved developer experience and maintainability, adoption of `httpx` for performance gains (approx. 20ms faster per request), a redesigned error handling hierarchy with specific HTTP status error classes and new transport/timeout errors, a modern parameter system enforcing keyword-only arguments and using a `NOT_GIVEN` sentinel for optional parameters, and the introduction of raw response access and streaming helpers via `with_raw_response` and `with_streaming_response` contexts. It also details updates to specific API integrations like Files, Batches, Endpoints, Evals, Audio Speech, and Code Interpreter, and introduces new beta APIs for Instant Clusters.