Aller au contenu

Developers / API

API quickstart

An OpenAI-compatible gateway. Point any OpenAI SDK or HTTP client at one base URL with one key — chat, consensus, images, embeddings and audio all live behind it.

Base URL
https://tokonomix.ai/api/v1
Authentication
Authorization: Bearer tok_live_YOUR_KEY

One key for every endpoint. Create one in your dashboard.

Your first request — curl
curl https://tokonomix.ai/api/v1/chat/completions \
  -H "Authorization: Bearer tok_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "messages": [{"role": "user", "content": "Say hello in one sentence."}]
  }'

Use the OpenAI SDK — no custom client

Change the base URL and the key; everything else stays. Don't hardcode model slugs — discover them via GET /api/v1/models.

Python
from openai import OpenAI
client = OpenAI(base_url='https://tokonomix.ai/api/v1', api_key='tok_live_...')
resp = client.chat.completions.create(
    model='claude-sonnet-4-6',
    messages=[{'role': 'user', 'content': 'Say hello'}],
)
TypeScript
import OpenAI from 'openai';
const client = new OpenAI({ baseURL: 'https://tokonomix.ai/api/v1', apiKey: 'tok_live_...' });
const resp = await client.chat.completions.create({
  model: 'claude-sonnet-4-6',
  messages: [{ role: 'user', content: 'Say hello' }],
});

One line further: a multi-model council

Set the model to tokonomix-consensus and several frontier models answer blind; an independent judge reconciles one verdict. How consensus works →

cURL — consensus
curl https://tokonomix.ai/api/v1/chat/completions \
  -H "Authorization: Bearer tok_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tokonomix-consensus",
    "messages": [{"role": "user", "content": "..."}],
    "x_council": { "mode": "best_of" }
  }'

Go deeper

  • GET /api/v1/capabilities — machine-readable integration guide (endpoints, SDK snippets, current gotchas).
  • GET /api/v1/models — the live model catalogue as JSON.
  • Agent + framework setup guides (Claude Code, Cursor, Cline, AutoGen, …)
  • MCP connector — the council as a tool for coding agents.
  • llms.txt — the whole platform, written for agents.