Together’s API endpoints for chat, vision, images, embeddings, speech are fully compatible with OpenAI’s API. If you have an application that uses one of OpenAI’s client libraries, you can easily configure it to point to Together’s API servers, and start running your existing applications using our open-source models.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.
Configuring OpenAI to use Together’s API
To start using Together with OpenAI’s client libraries, pass in your Together API key to theapi_key option, and change the base_url to https://api.together.ai/v1:
Querying a chat model
Now that your OpenAI client is configured to point to Together, you can start using one of our open-source models for your inference queries. For example, you can query one of our chat models, like Llama 3.1 8B:Streaming a response
You can also use OpenAI’s streaming capabilities to stream back your response:Using Vision Models
Text
Image Generation

Text-to-Speech
Generating vector embeddings
Use our embedding models to generate an embedding for some text input:Text
Structured Outputs
Python
Text
Function Calling
Text