Authentication

Authenticate every request with your API key.

All API requests require a valid API key sent in the Authorization header:

Bash
Authorization: Bearer YOUR_API_KEY

API keys can be created and managed from your dashboard. Each key is tied to your account's credit balance. You can create multiple keys for different projects.

Keep your API keys secret. Do not share them in client-side code, public repositories, or URLs.

Store your key in an environment variable and read it at runtime — never hardcode it in source code.

Bash
# .env
TCHAVI_API_KEY="sk-tch_..."

# Node.js
const client = new Tchavi({ apiKey: process.env.TCHAVI_API_KEY });

# Python
import os
client = OpenAI(api_key=os.environ["TCHAVI_API_KEY"], base_url="...")