Quickstart
From a new Tessen account to a first API response.
You need a Tessen account and a terminal. The requests below use cURL, Python with the requests package, or Node.js 18 or newer — nothing else to install. Calling Z1, Z1 Code or H1 additionally needs a pilot account (see Pilot and production access); every other step works for any account.
Create a key and make a first request
- Create an account and sign in
Open https://console.tessen.ai and sign in with email, Google or GitHub.
- Create an API key
In the Console open Keys, choose Create key, name it, and keep both permissions ticked ("Send model requests" and "Read models and usage"). Copy the secret now: it is shown once and Tessen stores only a hash.
- Put the key in your environment
Keep the key out of your code and out of version control.
BASHexport TESSEN_API_KEY="tes_..." - Read the price list (no key needed)
A public endpoint that proves you can reach the API.
BASHcurl https://api.tessen.ai/v1/pricing/families - Make a chat request
Run the example below. It sends one short message to Z1 and prints the answer and the token usage.
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"}] }'import osimport requests response = requests.post( "https://api.tessen.ai/v1/chat/completions", headers={"Authorization": f"Bearer {os.environ['TESSEN_API_KEY']}"}, json={ "model": "z1", "max_tokens": 256, "messages": [{"role": "user", "content": "Reply with the single word: ok"}], }, timeout=120,)response.raise_for_status()body = response.json()print(body["choices"][0]["message"]["content"])print(body["usage"])const response = await fetch("https://api.tessen.ai/v1/chat/completions", { method: "POST", headers: { Authorization: `Bearer ${process.env.TESSEN_API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ model: "z1", max_tokens: 256, messages: [{ role: "user", content: "Reply with the single word: ok" }], }),});if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);const body = await response.json();console.log(body.choices[0].message.content);console.log(body.usage);What a response looks like
A non-streaming chat completion is an OpenAI-format object. choices[0].message.content is the answer and usage holds the token counts the request is billed on.
{ "id": "b9f325286dab4acc903ac13dd4836fe2", "object": "chat.completion", "created": 1793282245, "model": "z1", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "ok", "name": null, "tool_calls": null, "tool_call_id": null, "reasoning": null, "reasoning_content": null }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 11, "completion_tokens": 2, "total_tokens": 13 }}The reasoning and reasoning_content fields are present on every message and are null unless the model produced reasoning text. They are not part of the stable contract; do not build on them. See Reasoning controls.
If a step fails
| You see | Meaning | Fix |
|---|---|---|
401 authentication_required | No Authorization header. | Send Authorization: Bearer $TESSEN_API_KEY. |
401 invalid_api_key | The key is wrong, revoked or truncated. | Create a new key in the Console and export it again. |
400 model_not_found — "This commercial family is not available for inference" | Your account is not in the Z1 / Z1 Code / H1 pilot. | Use Project ZERO Alpha if you are enrolled, or call embeddings. See Pilot and production access. |
402 insufficient_credits | The wallet cannot cover the request. Nothing was charged. | See Billing errors. |
413 request_too_large | max_tokens is above the model's limit. | Lower max_tokens. |