TokenMoo

SDKs

Use the OpenAI SDKs (or any compatible client) against TokenMoo.

TokenMoo is OpenAI-compatible, so existing SDKs work after changing the base URL and key.

Python

from openai import OpenAI

client = OpenAI(
    api_key="sk-xxx",
    base_url="https://www.tokenmoo.com/v1",
)

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

Streaming:

stream = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Count to five"}],
    stream=True,
)

for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

JavaScript / TypeScript

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'sk-xxx',
  baseURL: 'https://www.tokenmoo.com/v1',
});

const response = await client.chat.completions.create({
  model: 'gpt-4o-mini',
  messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);

Other tools

Any client that lets you set a base URL works, including LangChain, LlamaIndex, the Vercel AI SDK and most chat front-ends. When asked for:

  • API base / base URL: https://www.tokenmoo.com/v1
  • API key: your sk-... key
  • Model name: any model from the Model Square page

If a tool only accepts an OpenAI-style endpoint without a custom base URL, point its proxy setting at https://www.tokenmoo.com and keep the /v1 path.

On this page