OpenAI-compatible gateway

One endpoint. Every model.

Knot puts one OpenAI-compatible endpoint in front of a pool of capacity. Ask for a model by name; the request lands on whichever slot is healthy, retries past a 429 before the first byte, and every token it spends is priced and written down.

By invitation · Works with any OpenAI SDK · eu-west-1

POST /v1/chat/completions
curl https://tryknot.xyz/v1/chat/completions \
  -H "Authorization: Bearer $KNOT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.6-sol",
    "messages": [{"role": "user", "content": "Ping"}],
    "stream": true
  }'
200 · text/event-stream2 deployments tried · billed after delivery
Request path

What happens between your SDK and the model

Four steps, in this order. Everything that can run after the response, does.

  1. 01

    Authenticate

    Hash the key, read one cached auth-and-routing row, check the balance is above zero. Three things happen before a model is touched at all.

  2. 02

    Route

    A public model ID resolves to an ordered list of capacity, spread across providers and regions and handled for you.

  3. 03

    Dispatch

    A 429 or a 5xx moves to the next deployment. Failover happens before the first byte reaches the caller, so the client sees one clean response.

  4. 04

    Meter

    The usage row and the ledger debit are written after the response has already been delivered. Billing runs entirely off the hot path.

Pooled capacity

Your plumbing stays yours

One public model ID is backed by an ordered pool of capacity. Retire a slot, add a region, move a quota — every client keeps working, because the model ID is the whole contract.

  • Priority decides order. The first deployment that answers wins.
  • A rate-limited deployment is benched and the next one is tried in the same request.
  • Credentials and endpoints are encrypted at rest and stay inside the admin panel.

openai/gpt-5.6-sol

chat
PriorityRegionState
1eu-westhealthy
2eu-northhealthy
3eu-north-2benched · 429

The routing table for one model, as the admin panel shows it.

Metering

Priced per token, logged per request

Input, output and discounted cached input are priced separately, then written to a ledger row you can read. Balances are integer micro-dollars — a million to the dollar — so every figure stays exact.

  • Rows appear the moment a request is metered, including the ones that failed over.
  • Reasoning tokens are counted inside the output figure and shown separately.
  • GET /v1/credits returns the remaining balance, free of charge.

Recent requests

live
ModelCost
openai/gpt-5.6-sol$0.0225
openai/gpt-5.6-luna$0.0150
openai/gpt-5.6-terra$0.0139
openai/gpt-5.6-sol×2$0.0611
4 requests$0.1125

Example rows. The ×2 badge marks a request that failed over once.

Drop-in

One line changes: the base URL

It speaks the OpenAI API, so Cursor, Cline, LangChain and the official SDKs work unmodified. Streaming, tools and vision pass straight through.

python · openai
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://tryknot.xyz/v1",
    api_key=os.environ["KNOT_KEY"],
)

stream = client.chat.completions.create(
    model="openai/gpt-5.6-sol",
    messages=[{"role": "user", "content": "Ping"}],
    stream=True,
)

Endpoints

POST /v1/chat/completions
input + output tokens, cached input discounted
POST /v1/images/generations
tokens the model reports, so cost tracks size
GET /v1/models
free
GET /v1/credits
free

Authenticate with Authorization: Bearer or x-api-key.

Questions

What people ask first

The short answers. The API reference has the long ones.

What is Knot?
Knot is an OpenAI-compatible API gateway. It puts one API key in front of a pool of model capacity, routes each request to a healthy slot, retries past rate limits, and meters the tokens every request spends.
Does my existing code work with it?
Yes. Knot implements the OpenAI API, so any OpenAI SDK works by pointing its base URL at the gateway and using a Knot key. Streaming, tool calling and vision all pass through unchanged.
How does it handle rate limits?
Each public model is backed by an ordered pool of capacity. When one slot returns 429 or 5xx, the gateway transparently retries the next one. Because failover happens before the first byte reaches the client, streamed requests get it too.
How is usage billed?
Per token, priced separately for input, output and cached input. Every request writes its own usage row and an immutable ledger entry, so spend can be traced request by request. Balances are stored as integer micro-dollars, so every figure stays exact to the millionth of a dollar.
Which endpoints does it support?
POST /v1/chat/completions with streaming, plus GET /v1/models and GET /v1/credits.
How do I get access?
Access is by invitation. An invite code creates your account and carries the credit it starts with — the same for email, Google and GitHub sign-up.

More detail in the documentation, or read /llms.txt if you are an agent.

Point your SDK somewhere better

Accounts are created with an invite code, which carries the credit you start with. Your code is all you need.