Learning resourcesReviewed · Together AI

Together AI: Run a batch job

Together AI’s “Run a batch job” is a tutorial for developers submitting AI requests in bulk, with one model per job and request failures requiring a separate check. It covers JSONL input, submission, polling and result matching through the CLI, Python, TypeScript and REST.

Researched 26 Nov 2026

In short.

Together AI’s “Run a batch job” is a developer tutorial for bulk chat and audio requests, where a completed job can still contain failed requests. It explains how to upload a JSONL file, create a single-model job, poll its status and match unordered results using custom_id. The examples cover CLI, Python, TypeScript and REST access. Pricing, complete model eligibility and independently measured performance are not established, and no examples were executed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage is the complete selected page at [https://docs.together.ai/docs/inference/batch/tutorial.md], captured as selected-page.txt. It includes the CLI, Python, TypeScript and REST examples, audio instructions, version requirements, input-size warning, partial-failure notice and Mintlify hosting attribution. Linked installation guides, API references, management documentation, the batch overview and documentation index are excluded. All behavior is described from documentation; no examples were executed or live service behavior verified.

The overview

identity

“Run a batch job” is Together AI documentation at [https://docs.together.ai/docs/inference/batch/tutorial.md]. It teaches the use of Together’s hosted batch API, from preparing requests through downloading responses.

The resource is a tutorial with commands, SDK examples and REST equivalents. It covers chat completions, audio transcription and audio translation.

assessment

The tutorial is useful for developers who can wait for results and want to submit many independent requests together. It explains operational details that affect correctness: matching results by identifier, handling terminal job states and inspecting request failures even after completion.

Its coverage supports understanding the submission process. A production decision also needs current pricing, supported models, account limits and data-handling terms, which this page does not establish.

users

Beginners who can work with terminal commands and JSON files can follow the CLI route. JSONL means one JSON request per line; the CLI combines uploading that file and creating its job.

Experienced developers get Python, TypeScript and cURL examples for integrating the individual steps into an application. The documented process suits delayed processing rather than an interaction that requires an immediate reply.

capabilities

The page demonstrates file upload, batch creation, progress retrieval and result download for /v1/chat/completions. Successful output examples include the original custom_id, an HTTP status code, generated content and token usage.

Audio batches use /v1/audio/transcriptions or /v1/audio/translations. Each audio request needs method set to FILE so the worker sends multipart/form-data, plus a publicly reachable audio URL in body.file. Optional transcription fields include response_format, language and prompt. Translation requires a translation-capable model; a full compatibility list is not supplied.

Using it

requirements

The tutorial requires a Together account and API key. SDK and cURL examples use the TOGETHER_API_KEY environment variable. Python examples require together>=2.0.0; no minimum TypeScript SDK version is stated.

CLI examples require Together CLI version 2.32.0 or later. The tg login command requires version 2.41.0 or later; the CLI can also use TOGETHER_API_KEY. Audio files must remain publicly reachable when the worker fetches them.

mechanism

Each JSONL line contains a unique custom_id of up to 64 characters and a body matching the chosen endpoint. Every line executes independently and must name the same model in body.model. Mixed-model input fails validation.

The file is uploaded with purpose set to batch-api. Its file ID and the target endpoint create the job. Status moves through VALIDATING and IN_PROGRESS to COMPLETED, FAILED, EXPIRED or CANCELLED. Successful results are retrieved through output_file_id; request failures are stored separately through error_file_id. Output order is not guaranteed, so custom_id provides the connection back to each input.

setup

After installing a compatible client and configuring authentication, prepare batch_input.jsonl. The CLI command tg batches submit batch_input.jsonl --api chat.completions uploads it and creates the job. Repeat tg batches get <BATCH_ID> every 30 to 60 seconds until a terminal state, then use tg batches download <BATCH_ID> --output batch_output.jsonl after completion.

For SDK integration, batches.create() returns a wrapper containing the job at .job, while batches.retrieve() returns the job directly. Python upload with check=False skips local JSONL parsing but retains server validation; the TypeScript SDK checks only the extension locally. Direct REST uploads must include file_name in the multipart form.

example

The chat example submits two independent requests: request-1 asks “Hello, world!” and request-2 asks “Explain quantum computing.” Both name meta-models/Muse-Glimmer-30B and set max_tokens to 200. The illustrated successful response retains request-1, reports status_code 200 and includes an assistant message and token-usage fields. Current availability of the named model is unverified.

The audio example uses openai/whisper-large-v3, method FILE and an audio URL for each request. It illustrates a response containing duration, language and transcribed text. These inputs and outputs are documentation examples, not execution results.

Assessment & evidence

limitations

Every input line must be under 10 MB, including inline base64 data. The page warns that oversized lines escape validation and later fail with error reading input file. Hosted image URLs or resized and compressed images are suggested remedies.

COMPLETED does not mean every request succeeded. The CLI downloads the error file automatically, while the complete Python script shown saves only the output file; SDK users must add the separately described error-file handling.

The tutorial describes a 24-hour completion window and says most batches below 1,000 requests finish in minutes. These timing claims are untested. Progress can remain at zero during validation, and polling more frequently than every 30 to 60 seconds may encounter rate limits. Overall file-size limits, request-count limits and exact quotas are not given.

reasoning

Independent execution and identifier-based result matching make the approach suitable for requests that can be prepared in advance and processed without relying on earlier responses. The page does not describe dependencies or chaining between requests inside a batch.

A reliable integration needs two levels of failure handling: terminal job status and individual request errors. Separating files by model and joining results by custom_id follow directly from the documented single-model restriction and unordered output.

alternatives

The documented access choices are the Together CLI, Python SDK, TypeScript SDK and REST through cURL. The CLI reduces manual steps by combining upload with creation and automatically saving errors. SDK and REST examples expose the individual API operations for application integration.

The page supplies no comparison with other providers or measurements against synchronous inference. Relative cost, speed and output quality are not assessed.

evidence

The evidence is the complete captured Together AI tutorial at [https://docs.together.ai/docs/inference/batch/tutorial.md]. It includes requirements, request examples, lifecycle descriptions, sample responses and explicit warnings about input size and partial failures.

No commands, scripts or API requests were executed. Live API behavior, example-model availability, output quality and performance remain untested. Sample replies and token counts are illustrative.

Access & freshness

costs

The tutorial provides no numerical prices, discount percentages, minimum spend or billing rules for failed requests. Workload cost is unknown from this evidence.

It links to a batch overview for discounted models, but that linked page is outside the selected source. Neither the amount nor applicability of any discount is established here.

rights

No licence or redistribution grant appears in the captured tutorial. Permission to republish its text or example code is unknown from this source.

Model-specific licences, input and output ownership, service privacy terms and retention rules are also not supplied. The Mintlify footer identifies the documentation platform and supplies no licensing terms.

freshness

The page was captured on 26 November 2026 at 00:37:43.380 UTC. The captured text contains no publication date or last-updated date.

Its stated minimums are Python SDK 2.0.0 and CLI 2.32.0, with CLI 2.41.0 required for tg login. These are documented compatibility requirements, not evidence of the latest available versions. Subsequent API, pricing or model changes are unknown.

actions

Before using the tutorial for a large workload, verify current model eligibility, prices, limits and applicable data terms. Begin with a small single-model file, assign unique custom_id values, keep lines below 10 MB and inspect both output and error files.

For additional documentation, the tutorial points to batch management at [https://docs.together.ai/docs/inference/batch/manage.md], the CLI reference at [https://docs.together.ai/reference/cli/batches.md] and the batch overview at [https://docs.together.ai/docs/inference/batch/overview.md]. Those linked pages are outside this report’s evidence.

Evidence for this report

selected-page.txtselected · checked 2026-11-26