Skip to main content

Together AI models compatibility

Add Together AI API keys

There are 2 ways to add your Together AI credentials to your requests:

Via UI

Via Code

Add customer_credentials parameter in your request body to use your own Together AI credits.
{
  // Rest of the request body
  "customer_credentials": {
    "togetherai": {
      "api_key": "YOUR_TOGETHERAI_API_KEY",
    }
  }
}

Full request example

from openai import OpenAI

client = OpenAI(
    base_url="https://api.keywordsai.co/api/",
    api_key="YOUR_KEYWORDSAI_API_KEY",
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role":"user", "content":"Tell me a long story"}],
    extra_body={"customer_credentials": {
                  "togetherai": {
                      "api_key": "YOUR_TOGETHER_API_KEY",
                  }
                }
              }
)
I