tcpapi
Live OpenAI- and Anthropic-compatible API

Open-model inference, priced by a live market.

Every request is matched in microseconds to the cheapest seller that meets your price and speed limits. If a seller stalls mid-answer, a backup continues from the same token. You pay only for the tokens you receive, with a cryptographic receipt for each one.

from openai import OpenAI

client = OpenAI(base_url="https://api.tcpapi.com/v1", api_key="YOUR_KEY")
stream = client.chat.completions.create(
    model="tinylm-a",
    messages=[{"role": "user", "content": "Hello!"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.tcpapi.com/v1", apiKey: "YOUR_KEY" });
const r = await client.chat.completions.create({
  model: "tinylm-a",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(r.choices[0].message.content);
curl https://api.tcpapi.com/v1/chat/completions \
  -H "Authorization: Bearer $TCPAPI_KEY" \
  -H "X-Limit-Price: 1.00" \
  -d '{"model":"tinylm-a","max_tokens":200,"stream":true,
       "messages":[{"role":"user","content":"Hello!"}]}'

Models trading now

Order books →

Best offer on each model's order book, refreshed every few seconds.

How a request is cleared

The same three steps for every call, streamed or not.

1

You set the limits

Send a normal chat request. Optional headers cap the price per million tokens, the wait for the first token and the minimum speed. Without them the model's list price applies.

2

The book matches it

Sellers post standing offers with their price and declared speed. Your request takes the best offer that meets every limit, and its maximum cost is reserved from your balance.

3

A backup keeps it going

The clearinghouse watches every token. If the seller misses its first-token deadline or stalls, a backup picks up from the same token and the defaulting seller pays the difference.

Models and prices

USD per million output tokens. Input tokens count at the weight shown.

ModelList price Best offer nowInput
tinylm-a sandbox$0.85$0.54input tokens count 25%