API Reference

/v1/chat/completions

Main chat endpoint. Compatible with OpenAI v1: messages, streaming, tools, response_format. Two models: Qwen/Qwen3.6-35B-A3B, the fastest, and Qwen/Qwen3.8-27B, the most capable for agents, code and reasoning, which also accepts images.

Overview

Creates a conversational completion from a list of role-typed messages (system, user, assistant, tool). Supports SSE streaming, parallel tool calling, and response_format=json_object or json_schema for structured output.

Endpoint and model

POST https://api.tesseraai.cloud/v1/chat/completions. Valid model literals: Qwen/Qwen3.6-35B-A3B (the fastest, text only) and Qwen/Qwen3.8-27B (the most capable: agents, code, reasoning and images), each with its -thinking variant. Which to pick, with benchmarks, in Available models.

  • Context depends on tier: from 8K default on Lite and Pro up to 256K native on Scale. Details at /docs/concepts/tiers-and-limits.
  • Both direct and thinking modes are picked by alias. Add the -thinking suffix to the literal (e.g. Qwen/Qwen3.6-35B-A3B-thinking) to enable extended reasoning. Details at /docs/concepts/direct-vs-thinking.
  • Streaming: add "stream": true. Returns OpenAI-compatible SSE events.

Request

POST /v1/chat/completions
curl https://api.tesseraai.cloud/v1/chat/completions \
  -H "Authorization: Bearer $TESSERA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3.6-35B-A3B",
    "messages": [
      {"role": "system", "content": "You are a concise assistant."},
      {"role": "user", "content": "Summarise Cervantes in one sentence."}
    ],
    "temperature": 0.3,
    "max_tokens": 200
  }'

Images (vision)

With Qwen/Qwen3.8-27B (and its -thinking variant) the content of a user message can be an array of parts, just like OpenAI: text and image_url. Send the image as an https URL or as a base64 data URI. Qwen/Qwen3.6-35B-A3B accepts text only.

Request with an image
curl https://api.tesseraai.cloud/v1/chat/completions \
  -H "Authorization: Bearer $TESSERA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3.8-27B",
    "messages": [{
      "role": "user",
      "content": [
        {"type": "text", "text": "What is the total amount on this invoice?"},
        {"type": "image_url", "image_url": {"url": "https://example.com/invoice.png"}}
      ]
    }]
  }'

Response

Identical structure to OpenAI: id, object, created, model, choices[].message.content, usage.prompt_tokens / completion_tokens / total_tokens.

Response (non-streaming)
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1730812345,
  "model": "Qwen/Qwen3.6-35B-A3B",
  "choices": [{
    "index": 0,
    "message": {"role": "assistant", "content": "..."},
    "finish_reason": "stop"
  }],
  "usage": {"prompt_tokens": 24, "completion_tokens": 41, "total_tokens": 65}
}

Streaming, tools and structured JSON

  • "stream": true enables SSE; the client receives chat.completion.chunk events until the final [DONE].
  • tools and tool_choice follow OpenAI v1 — see /docs/concepts/tools-function-calling.
  • response_format: {"type": "json_object"} for free-form JSON; {"type": "json_schema", "json_schema": {...}} for validated structured JSON.