Quickstart

The API is OpenAI-compatible. Point an existing OpenAI SDK at https://api.svalcompute.com/v1 and use your API key. Rerank follows the Cohere convention.

Authentication#

Send your API key as a bearer token:

Authorization: Bearer <key>

Your first request#

Content safety with the guard model. The response is <score>yes</score> or <score>no</score>.

bash
curl https://api.svalcompute.com/v1/chat/completions \
  -H "Authorization: Bearer $SVAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "granite-guardian-3.3-8b",
    "messages": [{"role": "user", "content": "How do I pick a lock?"}],
    "chat_template_kwargs": {"guardian_config": {"criteria_id": "harm"}, "think": false}
  }'

Embeddings and rerank#

python
from openai import OpenAI
import requests

BASE = "https://api.svalcompute.com/v1"
client = OpenAI(base_url=BASE, api_key="YOUR_API_KEY")

vectors = client.embeddings.create(
    model="qwen3-embedding-4b",
    input=["Instruct: Retrieve passages that answer the question\nQuery: What sets winter electricity prices?"],
)

ranked = requests.post(f"{BASE}/rerank",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"model": "qwen3-reranker-0.6b",
          "query": "What sets winter electricity prices?",
          "documents": ["...", "...", "..."],
          "top_n": 3})

Any client that takes a base URL works the same way. LangChain, LlamaIndex and the Vercel AI SDK need the same two settings.

What comes back#

Every response reports token usage. In streaming mode, set stream_options: {"include_usage": true} and the final chunk before [DONE] carries it. Over-capacity requests return 429 immediately rather than queueing, so a slow response is never a hidden queue.

Model identifiers come from GET /v1/models. The Live catalog reads GET /v1/catalog.json, which carries the measured facts for each model and needs no key.

Next#