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

TierPriceRequests/minModels
Individuals$0/mo10All self-hosted models
BusinessCustomUnlimitedDedicated deployment

OpenAI Compatible API

Drop-in replacement for OpenAI SDKs. Just change the base URL.

Base URL

URL
https://thetrillioniar.me/openai

Endpoints

EndpointMethodDescription
/v1/chat/completionsPOSTChat completions
/v1/modelsGETList models

Anthropic Compatible API

Works with Anthropic SDKs.

Base URL

URL
https://thetrillioniar.me/anthropic

Endpoints

EndpointMethodDescription
/v1/messagesPOSTMessages API
/v1/modelsGETList 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
  }
}

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.

Endpoint
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

FieldTypeRequiredDescription
statestring or objectYesThe text to decide about. Objects are JSON-encoded before classification.
questionsobjectYesMap of question IDs to question objects. 1–25 questions per request.
modelstringNoDefaults to verdict-151m.

Each question object has a type and a prompt:

TypePrompt fieldOptions fieldReturns
choiceinstructionscriteriaOne option ID, or abstention
scoreinstructionslevelsExpected numeric score, or abstention
noulinstructions / 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.

Request (all three question types)
{
  "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
curl https://thetrillioniar.me/v1/systemone \
  -H "Authorization: Bearer sk-tr-your-api-key" \
  -H "Content-Type: application/json" \
  --data @request.json

Response

Response (abridged; values from one run)
{
  "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).

Handle abstention explicitly The model is allowed to answer __insufficient_evidence__. In the example above, the text clearly indicates billing but does not establish urgency, so urgency abstains. Route those cases to a human or ask for more context instead of forcing the top non-abstain label. Tune the threshold on your own labeled data; p_abstain is a calibrated probability, not a fixed rule.

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

ModelTypeContextTier
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!"}]
  }'