Embeddings, forecasts and images
Find each model's endpoint
Each model kind is called differently, so each has its own endpoint. The modality and endpoint fields from GET https://api.tenzro.xyz/v1/models tell you which one a model uses.
POST /v1/chat/completionsPOST /v1/embeddingsPOST /v1/forecastsPOST /v1/images/generationscurl -s https://api.tenzro.xyz/v1/models | jq -r '.data[] | "\(.id) \(.modality) \(.endpoint)"'Calling a model at the wrong endpoint returns 400 wrong_endpoint, and the message names the right one. Every endpoint takes the optional machine field, defaulting to tenzro-partner-cluster.
Embed texts
/v1/embeddings is OpenAI-compatible. Vectors are unit length, so cosine similarity is a dot product.
modelinputdimensionsinput_typemachinecurl https://api.tenzro.xyz/v1/embeddings \
-H "Authorization: Bearer $TENZRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "qwen3-embedding-0.6b", "input": ["Tenzro settles in TNZO", "What does Tenzro settle in?"]}'{
"object": "list",
"model": "qwen3-embedding-0.6b",
"data": [{ "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, ...] }],
"usage": { "prompt_tokens": 12, "total_tokens": 12 }
}Search with Python
Embed the passages as documents and the question as a query, then rank by dot product.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.tenzro.xyz/v1", api_key=os.environ["TENZRO_API_KEY"])
MODEL = "qwen3-embedding-0.6b"
passages = [
"TNZO is the gas, staking and settlement token of the Tenzro Network.",
"Operators serve models from their machines on the network.",
"Cortex is the Tenzro Labs assistant for people.",
]
docs = client.embeddings.create(model=MODEL, input=passages, dimensions=512)
query = client.embeddings.create(
model=MODEL,
input="Which token settles payments?",
dimensions=512,
extra_body={"input_type": "query"},
)
q = query.data[0].embedding
scores = [sum(a * b for a, b in zip(q, d.embedding)) for d in docs.data]
best = max(range(len(passages)), key=lambda i: scores[i])
print(passages[best])Forecast a time series
Send a series, oldest value first, and how many steps to forecast. Quantiles give an uncertainty band around the point forecast.
modelhistoryhorizonquantilesfrequency_secondsmachinecurl https://api.tenzro.xyz/v1/forecasts \
-H "Authorization: Bearer $TENZRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "timesfm-2.5-200m", "history": [112, 118, 132, 129, 121, 135, 148, 148, 136, 119], "horizon": 6, "quantiles": [0.1, 0.5, 0.9]}'{
"object": "forecast",
"model": "timesfm-2.5-200m",
"history_used": 10,
"point": [141.2, 137.9, 139.4, 144.0, 146.1, 143.3],
"quantile_levels": [0.1, 0.5, 0.9],
"quantiles": [[128.4, ...], [141.2, ...], [155.0, ...]],
"generation_time_ms": 84
}quantiles holds one row per level in quantile_levels, each as long as the horizon.
Python
import os, requests
series = [112, 118, 132, 129, 121, 135, 148, 148, 136, 119]
r = requests.post(
"https://api.tenzro.xyz/v1/forecasts",
headers={"Authorization": f"Bearer {os.environ['TENZRO_API_KEY']}"},
json={"model": "timesfm-2.5-200m", "history": series, "horizon": 6, "quantiles": [0.1, 0.9]},
)
r.raise_for_status()
forecast = r.json()
low, high = forecast["quantiles"]
for step, (p, lo, hi) in enumerate(zip(forecast["point"], low, high), start=1):
print(f"t+{step}: {p:.1f} ({lo:.1f} to {hi:.1f})")JavaScript
const res = await fetch("https://api.tenzro.xyz/v1/forecasts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TENZRO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "timesfm-2.5-200m",
history: [112, 118, 132, 129, 121, 135, 148, 148, 136, 119],
horizon: 6,
quantiles: [0.1, 0.5, 0.9],
}),
});
const forecast = await res.json();
console.log(forecast.point);Generate an image
The image endpoint is live and routes like the others. While no image model is serving, it answers 503 no_capacity. The models list shows when one is serving.
curl https://api.tenzro.xyz/v1/images/generations \
-H "Authorization: Bearer $TENZRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "flux2-klein-4b", "prompt": "a lighthouse at dawn, watercolour"}'curl -s https://api.tenzro.xyz/v1/models | jq '.data[] | select(.modality == "image") | .id'Know what each call costs
Charges come from your credits after the call completes, or are covered by the rental or subscription the key belongs to. Credits are Tenzro Labs credits: 1 credit is 0.001 TNZO.
402 insufficient_credit.