Sari la conținut

Inference gates

Acest conținut nu este încă disponibil în limba selectată.

An inference gate is a model endpoint you can point an application at. It speaks the OpenAI chat-completions protocol, authenticates with a key you create yourself, and bills per token against the same credit balance as your GPU blades. Nothing is deployed or scaled on your side: there is no endpoint to provision and no model to load.

Use a gate when you want to consume a model. Use a GPU blade when you want to train, fine-tune, or run something the gate does not offer.

Inference gate GPU blade
Unit of work One request One machine, for a stretch of time
Billed on Tokens used Wall-clock runtime
Charged As each call completes When the blade stops
Credential A gate key (rb-gate-…) Your CLI session, then SSH
Idle cost None The blade keeps billing

Both draw on one balance and one ledger — see Credits and billing.

A gate key belongs to an account, not to a person, so any application holding it spends that account’s credits. Keys are shown once, at creation, and stored only as a hash: if you lose one, revoke it and make another.

A key can be narrowed in two ways:

  • Allowed models. A key can be restricted to a list of model ids. A request for anything else is refused with HTTP 403. This is set when the key is created through the API; the web app’s create form only asks for a name.
  • Budget cap. A key can carry a maximum lifetime spend in euros, after which its requests fail with HTTP 402. Ask KlusAI to set this — it is not yet self-serve.

Model ids are aliases in the form klusai/<name> — for example klusai/fast, which is what the CLI uses when you do not name a model. The authoritative list for your account comes from the models endpoint (below); it changes as routes are added, so read it rather than hard-coding a catalogue.

From the CLI:

Terminal window
rb gate keys create "Lab notebook"

The full key is printed once. It begins with rb-gate-.

Or in the web app: Inference GatesCreate API Key → give it a name → Create Key. The key is revealed once, in a green banner, with the same warning.

List and revoke keys with:

Terminal window
rb gate keys list
rb gate keys revoke <KEY_ID>

Revoking is immediate and permanent; existing requests using that key start failing with HTTP 401.

The base URL is the gate root; the SDK appends /chat/completions itself.

import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.razorbridge.eu/v1/gate",
api_key=os.environ["RB_GATE_KEY"],
)
response = client.chat.completions.create(
model="klusai/fast",
messages=[{"role": "user", "content": "Explain backpropagation in simple terms"}],
)
print(response.choices[0].message.content)
Terminal window
export RB_GATE_KEY="rb-gate-…"
Terminal window
curl https://api.razorbridge.eu/v1/gate/chat/completions \
-H "Authorization: Bearer $RB_GATE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "klusai/fast",
"messages": [{"role": "user", "content": "Hello!"}]
}'

The response is the provider’s OpenAI-shaped JSON, returned in one piece. Streamed responses ("stream": true) are not available yet.

Terminal window
rb gate test "Say hello in Romanian"
rb gate test --model klusai/fast "Summarise this paragraph…"

rb gate test uses your CLI session rather than a gate key, so it works before you have created one. It prints the model, the token counts and the reply — and it is billed like any other call.

The web app has the same thing under Inference GatesPlayground, plus a Recent Usage table.

Terminal window
curl https://api.razorbridge.eu/v1/gate/models \
-H "Authorization: Bearer $RB_GATE_KEY"
Terminal window
rb gate usage

This lists your most recent calls with the model, prompt and completion token counts, and the cost in euros of each. Every call also appears in the credit ledger with the source inference, so rb credits reconciles against it.

Costs are deducted as calls complete. A call attempted with an empty balance returns HTTP 402 rather than running and leaving a debt.