# Together AI API **Provider:** Together AI **Category:** ai **Base URL:** `https://api.together.xyz/v1` **Auth:** bearer — `Authorization: Bearer YOUR_TOGETHER_API_KEY` **Rate Limit:** 60 requests/min (default) · Scales with plan **Free Tier:** No **Pricing:** from $0.10/mo (pay-as-you-go) **Docs:** https://docs.together.ai ## Description Together AI provides cloud infrastructure for running open-source AI models at scale. The API is fully OpenAI-compatible and supports 200+ models including Llama 3.1 405B, Qwen 2.5, Mistral, DeepSeek, Stable Diffusion, and more. Features include serverless inference (pay per token), dedicated GPU clusters, fine-tuning with LORA, vision models, and function calling. Popular for research, enterprise AI, and teams migrating from proprietary models. ## Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | POST | `https://api.together.xyz/v1/chat/completions` | Chat completions (OpenAI-compatible) | | POST | `https://api.together.xyz/v1/completions` | Text completions | | POST | `https://api.together.xyz/v1/embeddings` | Generate text embeddings | | POST | `https://api.together.xyz/v1/images/generations` | Image generation (Stable Diffusion, FLUX) | | GET | `https://api.together.xyz/v1/models` | List all available models with pricing | | POST | `https://api.together.xyz/v1/fine-tunes` | Start a fine-tuning job with LoRA | ## Authentication Create an API key at api.together.ai. The endpoint is OpenAI-compatible — pass your key as a Bearer token in the Authorization header. ``` Authorization: Bearer YOUR_TOGETHER_API_KEY ``` ## Sample Request ```bash curl "https://api.together.xyz/v1/chat/completions" \ -H "Authorization: Bearer $TOGETHER_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo","messages":[{"role":"user","content":"Write a Python function to parse JSON safely"}],"max_tokens":200}' ``` ## Sample Response ```json { "id": "890ab123", "model": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo", "choices": [{ "message": { "role": "assistant", "content": "Here's a Python function to safely parse JSON: ```python import json def safe_json_parse(data): try: return json.loads(data) except json.JSONDecodeError: return None ```" }, "finish_reason": "stop" }], "usage": { "prompt_tokens": 20, "completion_tokens": 68 } } ``` ## Pricing Details Llama 3.1 8B: $0.18/M · $0.18/M. Llama 3.1 70B: $0.88/M · $0.88/M. Llama 4 Scout: available. DeepSeek R1: $1.25/M · $1.25/M. Image gen: $0.008 per image. No free tier; minimum $5 credit purchase. --- *Source: [API Map](https://apimap.dev/apis/together-ai/) — CC BY 4.0*