Docs · quickstart

Start with one base URL.

Tīrtha is OpenAI-compatible. Use your OpenAI client, set the base URL to https://api.tirtha.ai/v1, and pass your Tīrtha key.

Setup

Install once, then call the API.

The setup command starts the device-grant flow and stores your key for local use.

Command

Run the installer.

Use this when you have access and want the CLI to prepare your local environment.

npx tirtha-setup
Examples

Use the same client shape you already know.

These examples show the base URL and the key. Replace the model name with the one your account uses.

curl

Send a chat request.

curl https://api.tirtha.ai/v1/chat/completions \ -H "Authorization: Bearer $TIRTHA_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"tirtha","messages":[{"role":"user","content":"Say hello"}]}'
Python

Use the OpenAI client.

client = OpenAI(api_key=os.environ["TIRTHA_API_KEY"], base_url="https://api.tirtha.ai/v1") response = client.chat.completions.create( model="tirtha", messages=[{"role": "user", "content": "Say hello"}]) print(response.choices[0].message.content)
Mode dial

Choose how much routing you want.

The model name can stay as it is. The mode is its own setting. Set it once for your key, or send it with one request.

curl -X POST https://api.tirtha.ai/v1/key/mode \ -H "Authorization: Bearer $TIRTHA_API_KEY" \ -d '{"mode":"max"}' # or per request, inside the body: "tirtha": {"mode": "max"}
auto

Auto lets Tīrtha route the request to the path that fits the work.

max

Max uses the frontier path every time.

value

Value favors a lower cost tier while keeping the request useful for everyday coding.

low

Low uses the lowest cost tier for simple work and quick checks.

Need an access key?

Tīrtha is in pre-beta. Ask for access and we will help you get started.