Requests
A chat completion on Project Zero, from curl, Python or Node.js.
POST https://api.tessen.ai/v1/chat/completions with model project-zero. The examples use the OpenAI client libraries, pointed at Tessen.
curl https://api.tessen.ai/v1/chat/completions \
-H "Authorization: Bearer $TESSEN_ZERO_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "project-zero",
"messages": [
{ "role": "user", "content": "Write a Python function that checks whether a string is a palindrome." }
]
}'import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.tessen.ai/v1",
api_key=os.environ["TESSEN_ZERO_KEY"],
)
response = client.chat.completions.create(
model="project-zero",
messages=[
{"role": "user", "content": "Write a Python function that checks whether a string is a palindrome."},
],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.tessen.ai/v1",
apiKey: process.env.TESSEN_ZERO_KEY,
});
const response = await client.chat.completions.create({
model: "project-zero",
messages: [
{ role: "user", content: "Write a Python function that checks whether a string is a palindrome." },
],
});
console.log(response.choices[0].message.content);tessen/project-zero is OpenCode's provider/model reference: provider tessen, model project-zero. A direct request sends the model alone, "project-zero". Sending "tessen/project-zero" to the API is refused with 400 model_not_found and is never served on paid capacity.
Request fields
| Field | Notes |
|---|---|
| model | project-zero selects Project Zero. It is a routing alias, not a model name. |
| messages | Required. OpenAI chat format. |
| stream | true for server-sent events. See Streaming. |
| tools, tool_choice | Accepted in OpenAI format. |
| program | Optional. project_zero is implied by the model. Sending a different program with the project-zero model is refused with 422. |
The response
An OpenAI-format chat completion. It does not name the provider or model that served it.