Skip to content
DOCUMENTATION / TESSEN API (PREVIEW)

API keys

Created by a person, shown once, and unable to create another.

Keys belong to an account and are created in the Console. The plaintext secret is returned exactly once, in the response to the request that created it.

A key cannot mint a key

Key management is session-only, enforced at the door. A leaked key therefore cannot bootstrap a stronger one — which is also why there is no programmatic way to complete a first integration without a human sign-in.

Make a request

Send a request to https://api.tessen.ai/v1/chat/completions with your key as a Bearer token.

BASH
curl https://api.tessen.ai/v1/chat/completions \
  -H "Authorization: Bearer $TESSEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "z1", "max_tokens": 256,
       "messages": [{"role": "user", "content": "Reply with the single word: ok"}]}'

Which models

ModelWho can use itBilling
z1, z1-code, h1Accounts enrolled in the commercial pilotPrepaid wallet, at the published USD rate per 1M tokens (Models & Intelligence in the Console).
project-zeroDevelopers enrolled in ZEROFree daily allowance. Never debits the wallet and never falls back to paid inference.

A model your account is not entitled to is refused; it is never served by a different model. Availability is shown per account in the Console.

Streaming, usage and cost

BASH
curl -N https://api.tessen.ai/v1/chat/completions \
  -H "Authorization: Bearer $TESSEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "z1", "stream": true, "stream_options": {"include_usage": true}, "max_tokens": 256,
       "messages": [{"role": "user", "content": "Say hello in five words."}]}'

With include_usage the last data frame before [DONE] carries the token counts. For the commercial families it also carries cost_usd, the amount settled against your wallet.

Errors

Status · codeMeaning
401The key is missing, invalid or revoked.
402 · insufficient_creditsThe wallet cannot cover the request. Nothing was charged.
403 · zero_entitlement_requiredThe account is not enrolled for that program.
400 · model_not_foundThat model is not available to this account.
400 · reasoning_budget_exhaustedA reasoning model spent its whole max_tokens thinking before it wrote an answer. Raise max_tokens and retry.
429A limit was reached. The response names which and carries Retry-After; per-minute limits clear in the next minute, daily limits at 00:00 UTC.
Reasoning content is never returned. Models may use some of max_tokens thinking; set it generously for harder prompts.

Clients

The TypeScript and Python clients live in the repository at packages/sdk and packages/sdk-python. Neither is published to a registry, so there is no install command to copy. Call the HTTP API directly.
API keys — Tessen Docs