TESSEN Platform
Documentation
Docs/API reference
API REFERENCE

Chat completions

Create a model response for a conversation. Supports streaming and tool calling.

POST/v1/chat/completions

Create a chat completion.

Auth: Bearer key
Limit

Z1, Z1 Code and H1 are restricted to the private pilot, and project-zero to enrolled developers. Any other account that sends those ids is refused (400 model_not_found or 403 zero_entitlement_required).

Request body

modelstring · required

z1, z1-code, h1 or project-zero. The aliases tessen/z1, tessen/z1-code and tessen/h1 are also accepted. Always send one.

messagesarray · required

At least one message. Each has a role (system, user, assistant, tool) and content. An assistant message may carry tool_calls; a tool message carries tool_call_id.

max_tokensinteger

Maximum output tokens. Reasoning tokens count toward it. Up to 16384 on the commercial families; above that the request is refused with 413 request_too_large.

max_completion_tokensinteger

Accepted as an alternative to max_tokens.

streamboolean

true for server-sent events. Default false. See Streaming.

toolsarray

Functions the model may call, in OpenAI type: "function" format.

tool_choicestring | object

auto, none, or a specific function.

temperature, top_p, stop, n, usernumber, number, string|array, integer, string

Accepted in OpenAI format. n returns that many choices (verified on Z1).

presence_penalty, frequency_penaltynumber

Accepted.

response_format, logprobs, top_logprobs—

Not supported. These fields are accepted without error and ignored: output is not constrained to a format and no log probabilities are returned.

Note

Fields not listed here are not part of the contract, even if the request is accepted. In particular, do not send program, level or zero_alias.

Example

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

Response

200 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 }}
id, object, created, modelstring, string, integer, string

Identifier, chat.completion, Unix seconds, and the model id you requested (the underlying model is not named).

choices[].message.contentstring

The answer. May be empty when finish_reason is length or tool_calls.

choices[].message.tool_callsarray | null

Function calls the model wants made. Each has id, type, and function.name and function.arguments (a JSON string).

choices[].message.reasoning, reasoning_contentstring | null

Present on every message. Populated only when a reasoning model produced reasoning text. Not part of the stable contract.

choices[].finish_reasonstring

stop, length (output limit reached) or tool_calls.

usageobject

prompt_tokens, completion_tokens and total_tokens. Reasoning tokens are included in completion_tokens.

Errors

Status · codeWhen
400 model_not_foundThe model id is not in the registry, or your account cannot call that family.
401 authentication_required / invalid_api_keyMissing or invalid key.
402 insufficient_creditsThe wallet cannot cover the request. Nothing is charged.
403 zero_entitlement_requiredproject-zero without enrollment.
413 request_too_largemax_tokens exceeds the model's limit.
422The body is invalid, for example no messages. Body is { "detail": [...] }.
503 zero_capacity_unavailableA ZERO limit closed. See Errors.

Search documentation

Titles, headings and guides↑ ↓ navigate · Enter open
Chat completions · Tessen Docs