Documentation
Quickstart
Get started in 2 minutes. Trillionir AI provides an OpenAI-compatible API that works with any SDK or tool.
Step 1: Get your API key
Register at thetrillioniar.me and copy your API key from the dashboard.
Step 2: Make your first request
Python
from openai import OpenAI client = OpenAI( api_key="sk-tr-your-key", base_url="https://thetrillioniar.me/openai" ) response = client.chat.completions.create( model="auto", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content)
Step 3: Done!
Use auto to let our router pick the best model, or specify a model like smollm:135m.
Authentication
Two authentication methods are available:
API Key (for SDKs)
Use your API key in the Authorization header:
Header
Authorization: Bearer sk-tr-your-api-key
JWT Token (for chat)
Get a JWT token from login and use it for the chat API:
Header
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Rate Limits
| Tier | Price | Requests/min | Models |
|---|---|---|---|
| Free | $0/mo | 10 | smollm:135m |
| Starter | $5/mo | 30 | Top 5 |
| Pro | $20/mo | 100 | All |
| Team | $60/mo | 300 | All + Priority |
OpenAI Compatible API
Drop-in replacement for OpenAI SDKs. Just change the base URL.
Base URL
URL
https://thetrillioniar.me/openai
Endpoints
| Endpoint | Method | Description |
|---|---|---|
| /v1/chat/completions | POST | Chat completions |
| /v1/models | GET | List models |
Anthropic Compatible API
Works with Anthropic SDKs.
Base URL
URL
https://thetrillioniar.me/anthropic
Endpoints
| Endpoint | Method | Description |
|---|---|---|
| /v1/messages | POST | Messages API |
| /v1/models | GET | List models |
Chat API (JWT)
Simple chat endpoint using JWT authentication. No API key needed.
Endpoint
POST /api/chat
Request Body
{
"model": "auto",
"messages": [
{"role": "user", "content": "Hello!"}
],
"max_tokens": 1024
}
Response
{
"id": "chatcmpl-...",
"model": "smollm:135m",
"choices": [
{
"message": {
"role": "assistant",
"content": "Hello! How can I help?"
}
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 8
}
}
Available Models
| Model | Type | Context | Tier |
|---|---|---|---|
| Loading... | |||
Python SDK
Install
pip install openai
Example
from openai import OpenAI client = OpenAI( api_key="sk-tr-your-key", base_url="https://thetrillioniar.me/openai" ) def chat(message): response = client.chat.completions.create( model="auto", messages=[{"role": "user", "content": message}] ) return response.choices[0].message.content print(chat("What is Python?"))
Node.js SDK
Install
npm install openai
Example
import OpenAI from 'openai'; const client = new OpenAI({ apiKey: 'sk-tr-your-key', baseURL: 'https://thetrillioniar.me/openai', }); async function chat(message) { const response = await client.chat.completions.create({ model: 'auto', messages: [{ role: 'user', content: message }], }); return response.choices[0].message.content; } console.log(await chat('What is Node.js?'));
cURL
Example
curl https://thetrillioniar.me/openai/v1/chat/completions \ -H "Authorization: Bearer sk-tr-your-key" \ -H "Content-Type: application/json" \ -d '{ "model": "auto", "messages": [{"role": "user", "content": "Hello!"}] }'