TESSEN Platform
Documentation
Docs/Model capabilities
MODEL CAPABILITIES

Structured responses

The API does not enforce a JSON schema. Ask for JSON and validate what comes back.

Not available`response_format` (JSON mode and JSON schema) is not supported: it is accepted and ignored.

OpenAI's response_format parameter is not implemented. A request that includes it is accepted without error, but output is not constrained, so the answer can contain prose, code fences, or a field in the wrong type.

You can still get structured data reliably enough for many tasks: state the exact shape in the prompt, extract the JSON from the reply, validate it in code, and retry if it fails. The example does exactly that.

PROMPT, EXTRACT, VALIDATE
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": "Return only a JSON object with the keys \"name\" (string) and \"age\" (integer) for this person: Ada Lovelace, 36 years old."}]  }'

Practices that help

  • Name every key and its type in the prompt, and say "Return only a JSON object".
  • Keep max_tokens large enough for the whole object, or the JSON is cut off with finish_reason: "length".
  • Validate with a schema library in your own code, and retry a small fixed number of times.
  • For actions, prefer tool calling: function arguments are JSON the model is asked to produce for a declared schema (still validate them).

Search documentation

Titles, headings and guides↑ ↓ navigate · Enter open
Structured responses · Tessen Docs