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
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:
Authorization: Bearer sk-tr-your-api-key
JWT Token (for chat)
Get a JWT token from login and use it for the chat API:
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Rate Limits
| Tier | Price | Requests/min | Models |
|---|---|---|---|
| Individuals | $0/mo | 10 | All self-hosted models |
| Business | Custom | Unlimited | Dedicated deployment |
OpenAI Compatible API
Drop-in replacement for OpenAI SDKs. Just change the base URL.
Base 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
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.
POST /api/chat
{
"model": "auto",
"messages": [
{"role": "user", "content": "Hello!"}
],
"max_tokens": 1024
}
{
"id": "chatcmpl-...",
"model": "smollm:135m",
"choices": [
{
"message": {
"role": "assistant",
"content": "Hello! How can I help?"
}
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 8
}
}
Decision API (System One)
Use this when you need a bounded decision about a piece of text, not a chat reply. verdict-151m is a self-hosted 151M-parameter ModernBERT classifier (Verdict / OpenJev compatible). It can pick a category, score a level, or verify a proposition, and it returns calibrated probabilities — including an explicit __insufficient_evidence__ option when the text does not support an answer.
POST https://thetrillioniar.me/v1/systemone Authorization: Bearer sk-tr-your-api-key
Use /v1/systemone — not the OpenAI-compatible /openai/v1 prefix. The route is also available on chat.thetrillioniar.me. Requests without a key are accepted (this is how guest chat works) and are limited to 1 request/min per IP.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| state | string or object | Yes | The text to decide about. Objects are JSON-encoded before classification. |
| questions | object | Yes | Map of question IDs to question objects. 1–25 questions per request. |
| model | string | No | Defaults to verdict-151m. |
Each question object has a type and a prompt:
| Type | Prompt field | Options field | Returns |
|---|---|---|---|
| choice | instructions | criteria | One option ID, or abstention |
| score | instructions | levels | Expected numeric score, or abstention |
| noul | instructions / proposition | — | true, false, or abstention |
choice takes criteria as a map of option ID to description. score takes levels as an ordered map (or array); the numeric value is the option's zero-based position. Both support up to 24 substantive options plus the built-in abstain option.
{
"state": "Customer says: 'I was charged twice for the October invoice and need a refund.'",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this ticket?",
"criteria": {
"billing": "invoices, charges, and refunds",
"technical": "bugs, outages, and API errors",
"sales": "pricing, plans, and upgrades"
}
},
"urgency": {
"type": "score",
"instructions": "How urgent is this request?",
"levels": {
"low": "can wait a few days",
"normal": "respond within one business day",
"high": "blocking work or money is at risk"
}
},
"refund": {
"type": "noul",
"instructions": "The customer is explicitly asking for a refund."
}
}
}
curl https://thetrillioniar.me/v1/systemone \ -H "Authorization: Bearer sk-tr-your-api-key" \ -H "Content-Type: application/json" \ --data @request.json
Response
{
"model": "verdict-151m",
"answers": {
"department": {
"type": "choice",
"choice": "billing",
"confidence": 0.7709,
"probabilities": {
"billing": 0.7709,
"technical": 0.0346,
"sales": 0.0307,
"__insufficient_evidence__": 0.1638
},
"p_abstain": 0.1638,
"is_abstention": false
},
"urgency": {
"type": "score",
"score": null,
"selected_level": "__insufficient_evidence__",
"confidence": 0.3978,
"is_abstention": true
},
"refund": {
"type": "noul",
"noul": true,
"p_true": 0.7658,
"p_abstain": 0.2327,
"is_abstention": false
}
},
"choices": { "...": "legacy alias of answers" },
"latency_ms": 812.4,
"calibration": "per-k temperature"
}
Every answer includes probabilities, p_abstain, and is_abstention. For score, score is the probability-weighted expected value, or null when the model abstains. For noul, p_true is renormalized over true/false (abstain excluded).
Limits
- Up to 25 questions per request; the model answers them in one batched forward pass.
- Up to 24 substantive options per question, plus the built-in abstain option.
- 512-token context (state + question + option descriptions); longer input is truncated.
- Requests time out after 120 seconds. The first request after a restart can be slow; subsequent calls are much faster.
- This is a zero-shot classifier. Evaluate it on your own labeled examples before using it for high-stakes automation — it can be fine-tuned for a specific decision task.
Try it in the chat UI
Open chat.thetrillioniar.me (or thetrillioniar.me/chat) and switch to the Decide tab. Paste a state, add choice, score, or noul questions, then press Ask Verdict. Presets are included for triage, routing, and moderation. No account is required; sign in for higher rate limits.
Available Models
| Model | Type | Context | Tier |
|---|---|---|---|
| Loading... | |||
Python SDK
pip install openai
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
npm install openai
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
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!"}] }'