Skip to main content
Docs

One endpoint,
every model.

Tare is an OpenAI-compatible gateway in front of every model you use — ours and the ones you bring yourself. One base URL, one key, and every token accounted for.

Getting startedQuickstart

Quickstart

What this solves: How to send your first successful model request with Tare.

If you don't have an account or key yet, read Before you start first. If you already have an Inference key, just follow the steps below.

What you need to prepare

  • A working Tare account.
  • An Inference key. Be careful not to use a Provisioning key or a Reconciliation key; the three key types have different permissions, and the wrong type gets rejected outright.
  • A working model name, such as one visible in the console or in GET /v1/models.
  • Your server can reach https://tare.jamerly.ai.

The full key plaintext is shown only once, at creation time; the platform stores only a hash, and the list then shows only a mask like ak-…3f2a. Save it in your server-side secret management system, not in browser frontend code.

1. Create an Inference key

Console path:

Code / Terminal
Console → Tare → API Keys → Create

Choose Inference as the type. Write the name so its purpose is clear, for example support-bot-production. After creating it you'll see the full key; copy and save it.

2. Change two configs, send a request

Any OpenAI-compatible client works by changing these two configs:

ConfigValue
base_urlhttps://tare.jamerly.ai/v1
api_keyYour Inference key

curl

Code / Terminal
curl https://tare.jamerly.ai/v1/chat/completions \
  -H "Authorization: Bearer $TARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "GLM 5.1",
    "messages": [{"role": "user", "content": "hello"}]
  }'

Python (OpenAI SDK)

Code / Terminal
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://tare.jamerly.ai/v1",
    api_key=os.environ["TARE_API_KEY"],
)

resp = client.chat.completions.create(
    model="GLM 5.1",
    messages=[{"role": "user", "content": "hello"}],
)
print(resp.choices[0].message.content)

Which name to put in model

Put the platform-side model name, not the name on the upstream provider's side. Tare is responsible for mapping between the two.

The response always carries the name you requested. Even if a failover switches the upstream mid-flight, you never receive a model name you didn't request.

3. How to tell you're connected

  • HTTP returns 200.
  • The model produced content.
  • The response headers include X-Generation-Id, or the response contains a gen-... ID.
  • Later you can use GET /v1/generation?id=gen-... to check this call's cost and latency.

Querying immediately after getting the ID may return 404, because the usage record is written after the response. Treat any 404 within 60 seconds of receiving the ID as "not written yet, check again later".

4. Streaming calls

Pass stream: true in the request; it returns an SSE stream ending with data: [DONE].

Two kinds of upstream API don't natively send this terminator: Anthropic and OpenAI's own Responses API. Tare adds it for you in both cases. Without it, a client that hand-parses SSE (rather than a standard SDK that recognizes each vendor's own end-of-stream signal) will keep waiting after the last frame of real content.

Usage is in the last frame. Tare forces stream_options.include_usage on and overrides your setting, because without usage there's no billing or attribution.

Before the first byte, you may receive several SSE comments (lines starting with :).

For calls with large inputs, the upstream has to finish reading the prompt before it starts generating, so the first byte can take tens of seconds (in measurements, a good number beyond the median exceed 10 seconds, with the slowest approaching 80 seconds). During this time there are no bytes on the connection, and the client and proxies along the way will treat it as a dead connection and kill it. After about 5 seconds of silence, Tare starts sending an SSE comment every few seconds, so every hop knows the connection is still alive.

The SSE spec requires parsers to ignore lines starting with :, so standard SDKs need to do nothing. Only hand-written parsing clients need to pay attention: don't treat comment lines as data frames to JSON-parse. The last frame may also contain only usage, with no renderable text.

Streaming: Tare comments before the first byte After stream:true, Tare forwards the request and, once the upstream has been silent for about 5 seconds, sends an SSE comment every few seconds until the first content frame. The final frame carries usage only, then data: [DONE]. Streaming: Tare comments before the first byte Your client Tare Upstream stream: true Forward (include_usage on) A ':' comment every few seconds First content frame Data frames Final frame: usage only data: [DONE] Upstream can stay silent for tens of seconds, up to ~80s. After ~5s, Tare comments every few seconds. Comments start with ':'. SSE parsers ignore them. Do not JSON-parse them in a hand-written client. Anthropic and OpenAI Responses do not send data: [DONE]. Tare adds it for both.
Streaming calls: the silence before the first byte, and why Tare sends comments for the upstream

Common issues

SymptomCommon causeWhat to do
401Key doesn't exist, is disabled, or has expiredReconfirm the key plaintext and its state
403Wrong key type, or a quota / budget / source IP / DLP blockFirst confirm it's an Inference key, then check metadata.refusal_reason
404No route configured for the model name, or the record isn't written yetCheck GET /v1/models; generation queries can be retried within 60 seconds
429Rate limit triggeredRetry per Retry-After
Streaming stallsHand-written parser doesn't ignore comment lines, or a proxy timeoutIgnore lines starting with :; check the proxy's SSE config

Next steps

  • To use Tare from coding tools such as Claude Code, Codex or Cursor: read Coding tools.
  • To connect your own provider: read Channels.
  • To make a given model go through a chosen channel: read Routing.
  • To break down cost by customer or business line: read Cost attribution.
Docs last updated Nov 27, 2026, 12:56 (UTC+8)