Skip to main content

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.

Together AI uses API keys to authenticate requests. Keys are scoped to projects, meaning a key only has access to the resources within its project.
Multi-project key scoping is in early access. Not all resources and APIs fully support project-scoped keys yet. See Early access limitations for details.

Create an API key

Create independent API keys for separate use cases, systems, or workloads. For example, one for production, one for development, one for CI/CD, and one for inference.
1

Open the project

Navigate to the project you want to create a key for.
2

Open API key settings

Go to the project’s API keys settings.
3

Create the key

Click Create API Key, give it a name and an optional expiration date, then click Create.
4

Copy the key

Copy the key immediately. It won’t be shown again.
New API keys are displayed only once at creation. Save them in a secure location, such as a secrets manager, immediately. If you lose a key, you’ll need to create a new one.

Best practices

  • Name your keys descriptively (for example, prod-inference, ci-pipeline, dev-local) so you can identify and rotate them easily.
  • Set expiration dates for keys used in temporary or testing contexts. To set the expiration date, click the three-dot menu next to the key and select Set expiration.
  • Rotate keys regularly and revoke any that are no longer in use.
  • Never commit keys to source control. Use environment variables or a secrets manager.

Authenticate a request

Include your API key in the Authorization header of every API request:
curl https://api.together.ai/v1/chat/completions \
  -H "Authorization: Bearer $TOGETHER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meta-llama/Llama-3.3-70B-Instruct-Turbo",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
Or set it as an environment variable for SDK usage:
export TOGETHER_API_KEY="your_api_key"

Project key scoping

API keys are scoped to projects:
  • A key created in project A can only access resources in project A.
  • Keys persist even if the collaborator who created them is removed from the project.
  • Both project admins and member-role collaborators can create and revoke keys.
This means you can safely share a project API key with a CI/CD pipeline or external collaborator without giving them access to resources in other projects.
Project key scoping is in early access. Not all resources and APIs fully support this feature yet. Keys created before multi-project support was enabled are scoped to your organization’s default project.

Playground

The Together AI playground recognizes all API keys associated with your account. When you use the playground, it shows available models across all your keys and projects.

Cost analytics and usage

Use API key IDs to segment usage and cost by key and workload. The api_key_id field is supported for inference and code interpreter requests, so you can track which keys are driving spend in your project’s cost analytics.

Limitations

No per-key usage limits: You can’t cap spend or rate-limit individual API keys. Usage limits apply at the organization level.

Legacy API keys

Your organization may have a legacy API key scoped to its default project. Only the organization owner can access and manage it, in organization settings under Manage Account. Legacy keys are deprecated, and you should avoid using them in production. These keys can’t be scoped to a specific project or workload, and can’t be revoked (only regenerated if compromised). Use project-scoped API keys instead.

Projects

Understand how API keys are scoped to projects.

Roles and permissions

See who can create and manage API keys.