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:

Your own provider keys

aigw runs on your provider accounts: you add each provider’s key, and your usage is billed by the provider under your own contract. The key is sealed at rest; a gateway can spend it but cannot decrypt any other tenant’s secret, and the apps and agents calling through aigw never see it.

Failover & retries

When you have more than one enabled provider of the same kind, for example two OpenAI keys or two Azure OpenAI deployments, aigw tries them in order of their names, so prefix them to set the order (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.

Failover stays within one kind of provider: it does not move a request from OpenAI to Azure OpenAI, or from Anthropic to Bedrock.

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.