tofu
SampleLive
Sample app — Corner bakery. Nothing here is a real app.Sample · Corner bakery
Replay

AI

Connect this app

AI in your app

Usage

Available AI balance
Shared by every app and every sandbox
This app, this month

Add credits

Models and prices

Prices in credits per million tokens
How this works

Each card is one key. Features that use the same key share a card.

Make one key for each thing that calls AI, so you can limit or replace one without touching the others.

Prices in credits per million tokens. Each request pays the prices of the model it names.

Call AI from your own code

To connect it yourself, save a key in Keys & settings as a hidden value named TOFU_AI_KEY, then put the app online.

Address

https://ai.tofu.site/v1
curl https://ai.tofu.site/v1/chat/completions \
  -H "Authorization: Bearer $TOFU_AI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tofu-default",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Call it from your server, never from code that runs in the browser: a key in a web page lets any visitor spend your balance.