Docs

An OpenAI-compatible endpoint. If your tool takes a base URL and a key, it already works: this is the exact configuration, not a simplified version of it.

Endpoint

Base URL & auth

One base URL, bearer auth with your API key. The endpoint speaks the OpenAI chat-completions and completions APIs.

base url
https://api.tium.ai/v1

Authorization: Bearer sk-tium-...

Get a key from your dashboard. Keys are shown once at creation; store them in an environment variable, never in source.

Connect

Point your agent at it

OpenCode, the OpenAI SDKs, or plain curl: the same base URL and key.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "tium": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Tium",
      "options": {
        "baseURL": "https://api.tium.ai/v1"
      },
      "models": {
        "glm-5.2": {
          "name": "GLM-5.2",
          "limit": {
            "context": 128000,
            "output": 32768
          }
        }
      }
    }
  }
}
Add this to opencode.json, then run /connect, choose tium, and paste your key. The key is stored separately in ~/.local/share/opencode/auth.json; it never goes in this file.
Headers

What every response tells you

Each response carries what it cost, what remains, and your limits. You never have to take a number on trust.

X-Tium-Request-IdCorrelation id for support. Present on every response, including errors.
X-Tium-Tokens-In / -Cached / -OutThe token counts this request was billed on (non-streamed responses).
X-Tium-Weighted-TokensWeighted tokens charged: the token counts times the published weights and model multiplier.
X-Tium-Model-MultiplierThe multiplier applied, captured at request time. What you see is what you were charged.
X-Tium-Balance-RemainingWeighted tokens left (allotment + credits) at the start of the request.
X-Tium-Concurrency-Limit / -RemainingYour tier's concurrency limit and how many slots were free.

On streamed responses the per-request token headers arrive in the trailing usage chunk instead, since the counts don't exist when the headers are sent. Identity and concurrency headers are sent up front.

Errors

Error codes, and which to retry

The distinction that matters for agents: 402 is a wall (out of balance) and must not be retried; 429 is backpressure (too many at once) and should be retried after a short wait.

HTTPCodeMeaning
400invalid_request_bodyThe JSON body was malformed. Fix the request; do not retry as-is.
401invalid_api_key / revoked_api_keyKey is wrong, missing, or revoked. Re-check the Authorization header.
402insufficient_balanceAllotment and credits are exhausted. Top up. Agents must NOT retry a 402.
402key_spend_limit_reachedThis key hit its per-key spend limit. Raise the limit or use another key.
429concurrency_limit_reachedToo many requests at once for your tier. Retry after a short wait; carries Retry-After.
429daily_burst_cap_reachedDaily burst cap reached (abuse guard). Resets 00:00 UTC.
502backend_unavailableThe inference backend is unreachable. Transient; safe to retry.

Errors return an OpenAI-shaped body: error.type, error.code, and error.request_id for support.

Model

What's being served

The catalog is data, not a hardcoded page: it carries the next model without a redesign.

glm-5.2

GLM-5.2 · Z.ai

×1.0
serving
Multiplier
×1.0 (reference)
Context served
128K tokens
Max output
8.19K tokens
Parameters
not published
Throughput
not yet measured
License
MIT
in ×1.0 · cached ×0.185714 · out ×3.142857added Jul 23, 2026

The full catalog, with every model’s multiplier and published weights, is on /models.