Skip to main content
This guide covers what to change when you migrate code written against the Together Python SDK v1 to v2. If you upgrade to 3.0, also apply the changes in SDK 3.0 migration. If you’re starting a new project, install the SDK (uv add together) and follow the quickstart instead. Version 2 is a rebuild of the SDK. It’s generated from the API spec, adds comprehensive typing, and uses httpx instead of requests. Core calls run without edits: chat completions, streaming, embeddings, image generation, video generation, function calling, vision, and basic fine-tuning operations.

Breaking changes

Keyword-only arguments: All API method arguments must be passed as keyword arguments. Positional arguments raise a TypeError.
Constructor parameters: supplied_headers is now default_headers. The client also accepts two new optional parameters, default_query and http_client (an httpx.Client). Omitted parameters: Omit optional parameters you don’t set. Passing None raises TypeError: Expected NotGiven, got None. Extra parameters: The v1 **kwargs pattern is gone. Pass additional data through extra_body, extra_headers, or extra_query:
Response type imports: Response types moved and were renamed. For example, from together.types import ChatCompletionResponse is now from together.types.chat.chat_completion import ChatCompletion. Removed CLI commands: together chat.completions, together completions, and together images generate no longer exist.

Renamed methods

Changed response and input shapes

  • List responses wrap results in .data: client.fine_tuning.list_checkpoints() and similar list calls return a response object, so iterate over response.data instead of the response itself.
  • Downloads return content instead of writing to disk: files.content() and fine_tuning.content() return binary data. Write it to a file yourself, for example with response.iter_bytes() inside a with open(path, "wb") block.
  • Audio uploads take file objects: audio.transcriptions.create() and audio.translations.create() require an open file object (with open("audio.mp3", "rb") as f:), not a path string.
  • Voice listing uses attribute access: Read each listed voice’s fields as attributes, for example voice.name instead of voice["name"].
  • Checkpoint fields are renamed: type is now checkpoint_type, and timestamp is now created_at. The name field is gone, so construct it from the job ID and step.
  • Batch creation returns a wrapper: batches.create() returns a response object with the job at response.job.
  • Evaluations use typed parameter objects: evals.create() takes a parameters object (for example, ParametersEvaluationClassifyParameters from together.types.eval_create_params) instead of top-level keyword arguments. retrieve() and status() take the workflow ID as a positional argument.

Exception changes

The base exception TogetherException is now TogetherError, and HTTP errors map to status-specific exceptions. Attribute names also changed, for example http_status is now status_code. AuthenticationError, RateLimitError, and APIConnectionError keep their names. New status-specific exceptions include PermissionDeniedError (403), NotFoundError (404), ConflictError (409), and UnprocessableEntityError (422).

Getting help