Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.together.ai/llms.txt

Use this file to discover all available pages before exploring further.

Together AI lets you run leading open-source models with a few lines of code. Follow the steps below to get started.

Step 1: Create an API key

Register for an account if you don’t have one. Then go to your project’s API keys page, select Create key, give it a name, and copy the value.
New keys are only shown once, so make sure to save it somewhere safe.
Next, export the key as an environment variable in your terminal:
export TOGETHER_API_KEY="your_api_key"

Step 2: Install the SDK

Together AI publishes official SDKs for Python and TypeScript. Install the SDK with your preferred package manager:
uv init # optional
uv add together
You can also call the REST API directly from any language.

Step 3: Run your first query

The example below streams a chat completion from openai/gpt-oss-20b.
from together import Together

client = Together()

stream = client.chat.completions.create(
    model="openai/gpt-oss-20b",
    messages=[
        {
            "role": "user",
            "content": "What are the top 3 things to do in New York?",
        }
    ],
    stream=True,
)

for chunk in stream:
    if chunk.choices:
        print(chunk.choices[0].delta.content or "", end="", flush=True)
Congrats! You just made your first request to Together AI. The same client works for non-streaming responses, multi-turn conversations, function calling, and structured outputs.

Next steps

Choose a model

Browse recommended models for chat, coding, vision, and reasoning.

Deployment options

Compare serverless, dedicated endpoints, and dedicated containers.

Fine-tune a model

Train a model on your own data with LoRA, DPO, or full fine-tuning.

GPU clusters

Run large-scale training and custom workloads on dedicated GPU clusters.