Skip to main content

Resource Model

AISIX AI Gateway uses a small set of resources to turn a caller request into an authenticated upstream provider request.

The main resources are caller API keys, models, and provider keys. Multi-target models and policy resources build on that path when you need failover, load distribution, rate limits, guardrails, caching, observability, or managed budget checks.

Resource Relationship

For a single-target model, the core resources relate to one another as follows:

The caller API key authenticates the client and controls model access. The model resource defines the model name the client sends, references the provider key AISIX uses for the upstream call, and stores the upstream model ID. The provider key stores the upstream credential, base URL, provider label, and adapter settings.

In the Self-Hosted Quickstart, the caller API key is sk-demo-caller, the model alias is gpt-4o-mini, the provider key stores the OpenAI credential, and the upstream model is also gpt-4o-mini.

In production, the alias and upstream model do not need to match. For example, an application can keep sending prod-chat while the gateway changes the upstream model, provider key, or routing policy behind that alias.

Core Traffic Resources

Most AISIX traffic starts with three resources: a caller API key, a model, and a provider key. Together, they decide who can call the gateway, which model name the caller can use, and which upstream provider AISIX calls.

Caller API Key

A caller API key is the gateway credential an application uses when it calls AISIX.

The key authenticates the caller and controls which model aliases that caller may use. For key hashing, rotation, and allowlists, see Caller API Keys.

Model

A model is the gateway-facing model name callers send in the request body.

For a single-target model, the caller-facing alias can differ from the upstream provider's model ID. A model also points to the provider key AISIX should use for the upstream call. For single-target and multi-target model configuration, see Models.

Provider Key

A provider key stores the upstream credential and connection settings AISIX uses after it resolves a model.

Provider keys keep upstream secrets out of application code and let multiple models reuse the same upstream account, base URL, and adapter family. For credential fields, base URL behavior, provider labels, and adapters, see Provider Keys.

Multi-Target Models

A multi-target model is a model alias backed by a routing block. It points to target model aliases instead of carrying its own provider key and upstream model.

Callers still send one stable model name. AISIX resolves that alias to one of the target models at request time, so you can change upstream selection without changing application code.

For configuration details, see Routing and Failover.

Policy Resources

Policy resources add gateway behavior around the caller API key, model, and provider key path.

Rate limits control request rate and concurrency. Guardrails check request or response content. Caching can reuse chat-completion responses. Observability exporters send gateway trace data to an OTLP/HTTP-compatible backend.

Budget checks are enforced through AISIX Cloud managed policy. Self-hosted gateways do not expose a local budget resource.

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation