OpenAI-style API
Base address: https://dev.typno.ai/v1. Authenticate with Authorization: Bearer tpk-....
Chat completions
POST /v1/chat/completions takes the same body as OpenAI: model, messages, and optionally stream, max_tokens, temperature, top_p, stop, tools, tool_choice and response_format.
curl https://dev.typno.ai/v1/chat/completions \
-H "Authorization: Bearer $TYPNO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral4-119b",
"messages": [
{"role": "system", "content": "You answer briefly."},
{"role": "user", "content": "What is the capital of the Netherlands?"}
]
}'
Streaming
Set "stream": true to get server-sent events with the answer as it is written. Add "stream_options": {"include_usage": true} for a final chunk with the token usage.
stream = client.chat.completions.create(
model="mistral4-119b",
messages=[{"role": "user", "content": "Write a haiku about rain."}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")
Tools
Pass functions in tools; the model answers with tool_calls, you run them and send the results back as role: "tool" messages.
{
"model": "glm5.3-754b",
"messages": [{"role": "user", "content": "What is the weather in Utrecht?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Current weather for a city",
"parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}
}
}]
}
Images in a message
Models with vision take images as image_url parts, as a public address or a data: URL.
{"role": "user", "content": [
{"type": "text", "text": "What is in this picture?"},
{"type": "image_url", "image_url": {"url": "data:image/png;base64,..."}}
]}
Not included
There is no web search or file upload in the API; those exist in the chat only. Embeddings, audio and fine-tuning are not offered.