API reference

Base URL https://api.infersia.com/v1. Shapes match the OpenAI specification; anything additive is marked.

Chat completions

POST/v1/chat/completions
ParameterTypeDescription
modelrequiredstringA catalogue id, optionally with a routing suffix — see model routing.
messagesrequiredMessage[]The conversation. Roles: system, user, assistant, tool.
streambooleanStream the response as server-sent events. Defaults to false.
stream_optionsobjectSet include_usage: true for a final chunk carrying exact token counts.
max_tokensintegerOutput ceiling. max_completion_tokens is also accepted. Defaults to the variant’s own limit.
temperaturenumberSampling temperature, 0–2.
top_pnumberNucleus sampling.
stopstring | string[]Stop sequences.
seedintegerBest-effort determinism.
toolsTool[]Function definitions, where supported.
response_formatobject{ "type": "json_object" } for JSON mode, where supported.
userstringYour own end-user identifier. Recorded on the usage row for attribution.
providerobjectInfersia extension — per-request routing controls.
Parameters not listed here are forwarded to the inference engine unchanged. That includes vLLM extensions like top_k, repetition_penalty, min_p and guided_json. We validate only the fields we make decisions from — the engine is the authority on its own parameters.

Response

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1785116409,
  "model": "qwen/qwen3-8b",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "..." },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 13,
    "completion_tokens": 3,
    "total_tokens": 16,
    "prompt_tokens_details": { "cached_tokens": 0 },
    "cost": 0.0000011
  }
}

usage.cost is an addition: the exact USD charged for this request. The model field always reports the catalogue id you asked for, not the upstream repo path.

Legacy completions

POST/v1/completions

Prompt-in, text-out. Supported for older clients; prefer chat completions for anything new.

Embeddings

POST/v1/embeddings
ParameterTypeDescription
modelrequiredstringAn embedding model id.
inputrequiredstring | string[]Text to embed. Arrays are batched.
dimensionsintegerOutput dimensionality, where the model supports truncation.

Models

GET/v1/models

Unauthenticated. Includes our extensions — quantization, context_length, pricing, supported_parameters — alongside the standard fields.

Key introspection

GET/v1/key
{
  "data": {
    "label": "Production backend",
    "limit": 25.0,
    "usage": 3.417,
    "limit_remaining": 21.583,
    "is_free_tier": false,
    "rate_limit": { "requests": 200, "tokens": 400000, "interval": "60s" },
    "balance": 21.58,
    "balance_formatted": "$21.5834"
  }
}

Credits

GET/v1/credits

Lifetime credited, lifetime spent, and the current balance.

Health

GET/health

Liveness only — no dependencies checked. /ready additionally verifies the database, and /metrics exposes Prometheus metrics.

API reference · Infersia