TESSEN Platform
Documentation
Docs/Get started
DEVELOPER GUIDE

First API request

Send one chat completion, read the answer and the usage, and know what each field means.

A first request needs the key in TESSEN_API_KEY and a model your account may call. The example uses z1; use project-zero if you are enrolled in ZERO Alpha instead.

CHAT COMPLETION
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"}]  }'

The request

modelstring · required

The model id: z1, z1-code, h1 or project-zero.

messagesarray · required

The conversation so far, oldest first. Each item has a role (system, user, assistant or tool) and content.

max_tokensinteger

The most output tokens to generate. Always set it; reasoning tokens count toward it.

The response

RESPONSE
{  "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 }}
choices[0].message.contentstring

The answer.

choices[0].finish_reasonstring

stop when the model finished, length when max_tokens ran out, tool_calls when it asked for a function.

usageobject

prompt_tokens, completion_tokens, total_tokens. On Tessen's families the cost of the request is the sum of these at the published price.

What can fail

  • 401 — the key is missing or invalid.
  • 400 model_not_found — the model id is not one your account can call.
  • 402 insufficient_credits — the wallet cannot cover the request; nothing was charged.
  • 413 request_too_large — max_tokens is above the model's limit.
  • 422 — the body is not valid (for example no messages).

Search documentation

Titles, headings and guides↑ ↓ navigate · Enter open