aigwdocs

Providers & models

aigw puts every model behind one OpenAI-compatible endpoint. You either let us broker the providers (one contract, one bill) or bring your own provider keys — or mix both.

The model catalog

GET /v1/models returns the models your virtual key may use. Each model maps to a provider and a price. To call a model, just set the model string on a normal OpenAI-style request:

client.chat.completions.create(model="claude-sonnet-4-6", messages=msgs)
client.chat.completions.create(model="gpt", messages=msgs)
client.chat.completions.create(model="mistral-large", messages=msgs)

Adapters: one front door, many providers

Requests dispatch to an adapter keyed by the provider:

Bring your own keys, or let us broker

Failover & retries

ProvidersFor(tenant, kind) returns your enabled providers in priority order (name them 1-primary, 2-backup, …). On a transient upstream error or 429/5xx, aigw retries on the same provider, then fails over to the next — before any bytes are relayed, so streaming is never retried mid-flight. Unsupported operations short-circuit without failover.

Self-hosted & private upstreams

Run the stateless gateway in your own VPC and point it at a private vLLM or Ollama endpoint. Private upstreams are gated behind an explicit opt-in so the gateway’s SSRF guard stays on by default.

See also: virtual keys & budgets · budgets, DLP & audit.