Skip to main content
The Chamber SDK supports multiple authentication methods. Choose the one that best fits your workflow.

Authentication Methods

Set the CHAMBER_TOKEN environment variable:
export CHAMBER_TOKEN="ch.your-api-token"
Then initialize the client without arguments:
from chamber_sdk import ChamberClient

client = ChamberClient()

Getting an API Token

  1. Log in to the Chamber Dashboard
  2. Navigate to Settings > API Tokens
  3. Click Create Token and copy the generated token
API tokens start with the prefix ch. followed by a unique identifier.

Multi-Organization Users

If you belong to multiple organizations, specify which one to use:
client = ChamberClient(
    token="ch.your-api-token",
    organization_id="org-123456"
)

Configuration Options

ParameterDescriptionDefault
tokenAPI tokenFrom env or config
organization_idOrganization ID for multi-org usersNone
api_urlOverride API endpointhttps://api.usechamber.io/v1
timeoutRequest timeout in seconds30

Custom API Endpoint

For testing or custom deployments, you can override the default API URL:
client = ChamberClient(
    token="ch.your-api-token",
    api_url="https://custom.api.example.com/v1"
)
The default API endpoint is https://api.usechamber.io/v1.

Verifying Authentication

Test your credentials by checking the API health:
client = ChamberClient()
health = client.health()
print(f"API Status: {health.status}")
print(f"API Version: {health.version}")

Token Precedence

The SDK looks for authentication tokens in this order:
  1. Direct token parameter - ChamberClient(token="...")
  2. Environment variable - CHAMBER_TOKEN
  3. Config file - ~/.chamber/token.json
If no token is found, an AuthenticationError is raised.

Next Steps

With authentication configured, follow the Quickstart guide to submit your first workload.