Together AI (gateway)

Route Together AI calls through the Respan gateway to use 250+ models from different providers. Only your RESPAN_API_KEY is needed — no separate TOGETHER_API_KEY required.

Setup

1

Install packages

$pip install openai
2

Set environment variables

$export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"

No TOGETHER_API_KEY needed — the Respan gateway handles provider authentication.

3

Point an OpenAI-compatible client to the Respan gateway

1import os
2from openai import OpenAI
3
4client = OpenAI(
5 api_key=os.environ["RESPAN_API_KEY"],
6 base_url="https://api.respan.ai/api",
7)
8
9response = client.chat.completions.create(
10 model="together_ai/meta-llama/Llama-3.3-70B-Instruct-Turbo",
11 messages=[{"role": "user", "content": "Say hello in three languages."}],
12)
13print(response.choices[0].message.content)

Switch models

Change the model parameter to use 250+ models from different providers through the same gateway.

1response = client.chat.completions.create(model="together_ai/meta-llama/Llama-3.3-70B-Instruct-Turbo", messages=messages)
2response = client.chat.completions.create(model="gpt-5.5", messages=messages)
3response = client.chat.completions.create(model="claude-sonnet-4-5-20250929", messages=messages)

See the full model list.