Install the OpenAI Python client: pip install openai
Instantiate the client pointed at Together: client = openai.OpenAI(api_key=YOUR_TOKEN, base_url='https://api.together.xyz/v1')
Call client.chat.completions.create(model='<together-model-id>', messages=[...]) — use any model ID from the Together model catalog
Switch models by changing only the model string — no other client code changes are needed
For structured output, pass response_format={'type': 'json_object'} on models that support it
Async batch workloads: use the async OpenAI client (AsyncOpenAI) with asyncio.gather() to run concurrent requests
Known gotchas
Not all Together-hosted models support every feature (vision, tool use, structured output) — check the model card on the Together catalog before relying on a feature
Together's base URL is https://api.together.xyz/v1 — omitting /v1 causes 404 errors on all endpoints
Token costs and rate limits vary per model tier; dedicated endpoint pricing differs from serverless — check the Together pricing page for current rates
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp