Terza Inference
START

API quickstart

Terza Inference speaks the familiar OpenAI- and Anthropic-style protocols. Point an existing SDK at the base URL and use your Terza key.

1. Fund your balance and create a key

  1. Sign in to the console.
  2. Under Billing, top up (minimum $5) with USDC or USDT on AllScale's checkout page, or send TAO from any Bittensor wallet or exchange. Your balance is credited in US dollars once the payment confirms.
  3. Under API keys, create a key. Give it a monthly budget and, optionally, restrict its models or IP addresses. The full key is shown once.

2. Make a request

Base URL: https://terza.si/v1

curl https://terza.si/v1/chat/completions \
  -H "Authorization: Bearer $TERZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "MODEL_ID", "messages": [{"role": "user", "content": "Hello"}]}'

With the OpenAI Python SDK:

from openai import OpenAI

client = OpenAI(base_url="https://terza.si/v1", api_key=TERZA_API_KEY)
reply = client.chat.completions.create(
    model="MODEL_ID",
    messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)

List the models available to your key with GET /v1/models, or browse them in the console.

Supported endpoints

EndpointNotes
POST /v1/chat/completionsJSON or streaming (SSE). Function tools supported.
POST /v1/responsesStored for 7 days by default (store: false to opt out); continue with previous_response_id using the same key.
POST /v1/messagesAnthropic-style; x-api-key is accepted.
POST /v1/embeddings, /v1/rerankRetrieval.
POST /v1/systemoneStructured decisions (Jev): send a state and named questions of type noul, choice or score, each with instructions. Answers come back with probabilities. Billed on input tokens; output is free. Image questions are not supported yet.
POST /v1/images/generations, /editsImages; optional streaming of partial images.
POST /v1/audio/speech, /transcriptions, /translationsAudio.
GET /v1/realtimeWebSocket voice; priced per session of up to 60 seconds.
POST /v1/media/tasksAsynchronous video, image, music and sound. See Media tasks.

Billing

  • Prices are set by each model’s miners, per million input and output tokens (or per unit for media). The console shows the current price of every model.
  • Before a request is sent, its maximum possible cost is reserved from your balance. You are charged the actual cost; the rest is released.
  • Failed requests and rejected miner receipts are never charged.
  • Add X-Terza-Offer: OFFER_ID to route to one specific offer instead of the cheapest.
  • Add X-Terza-Tier: economy, standard or priority to use the cheapest healthy offer in that tier. Each model lists its tiers and prices on the Models page.
  • Each API key has a routing mode (balanced, lowest price, highest success rate or fastest) and an allowed tier order, set when you create it. Add X-Terza-Routing: price, success_rate, speed or auto to override the mode for one request. If a quote fails before answering, the next one is tried automatically, and failed attempts are free.

Errors

StatusMeaning
401Missing or invalid API key.
402Insufficient balance or key budget. Nothing was sent.
429Rate limited; retry with backoff.
502The miner could not complete the request. No charge.
503No eligible offer right now (no_eligible_supply or offer_unavailable). No charge.