SDK examples
No Tessen SDK package is published. OpenAI-compatible clients and plain HTTP both work.
Tessen publishes no SDK package for Python or JavaScript. TypeScript and Python clients exist in Tessen's repository but are published to no registry, so there is no install command to copy. Tessen has published no registry package, so do not install one called tessen expecting it to be Tessen's.
The chat completions endpoint follows the OpenAI chat format, so OpenAI's own client libraries work when pointed at https://api.tessen.ai/v1. These are third-party packages that Tessen does not maintain; the examples below use only the documented parameters.
# pip install openaiimport osfrom openai import OpenAI client = OpenAI(base_url="https://api.tessen.ai/v1", api_key=os.environ["TESSEN_API_KEY"]) completion = client.chat.completions.create( model="z1", max_tokens=256, messages=[{"role": "user", "content": "Reply with the single word: ok"}],)print(completion.choices[0].message.content) stream = client.chat.completions.create( model="z1", max_tokens=256, stream=True, messages=[{"role": "user", "content": "Say hello in five words."}],)for chunk in stream: if chunk.choices and chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="")print()// npm install openaiimport OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.tessen.ai/v1", apiKey: process.env.TESSEN_API_KEY }); const completion = await client.chat.completions.create({ model: "z1", max_tokens: 256, messages: [{ role: "user", content: "Reply with the single word: ok" }],});console.log(completion.choices[0].message.content); const stream = await client.chat.completions.create({ model: "z1", max_tokens: 256, stream: true, messages: [{ role: "user", content: "Say hello in five words." }],});for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? "");}console.log();Or use plain HTTP
Every example in these docs uses cURL, Python's requests, or Node.js's built-in fetch, and works in any language that can send an HTTPS request.