AIVAX

Inference with AI Gateways

An AI Gateway pre-configures an inference. When model is a gateway ID or slug, the request you send is only part of the request the model receives: AIVAX merges it with the gateway configuration first.

JSON
{
    "model": "support:50c3",
    "messages": [
        {
            "role": "user",
            "content": "Where is my order 123?"
        }
    ]
}

With a gateway configured with instructions, a collection, and a protocol function, the model receives the gateway’s system instructions, the documents retrieved for the question, and the function definition, in addition to the user message. The same request sent with "model": "@openai/gpt-5-mini" would reach the model with only the user message.

What the gateway sets #

AreaSet by the gatewayCan the request change it
Model and providerModel, BYOK endpoint, model routing, provider routingProvider routing, with routing_options
InstructionsSystem instructions, remote sources, prompt template, prefillNo. The request can add its own system messages.
ParametersTemperature, top-p, penalties, stop, output limit, reasoning effort, verbosity, seedYes, except frequency_penalty
KnowledgeCollections, query strategy, result limits, rerankerNo
ToolsBuilt-in tools, MCP sources, protocol functions, skills, shell, raw toolsThe request can add tools and builtin_tools, but cannot remove gateway tools.
MediaMultimodal pre-processing engines, DisableMultiModalInputEngines, with multimodal_resolver
ContextContext window, overflow action, tool message truncationNo
PolicyModeration, workersNo
PresentationTool explanations, time zoneYes

The full list of request overrides is in Override gateway values. Values in the request apply to that request only and never change the gateway.

Precedence #

When the same setting comes from several places, the most specific one wins:

  1. The request field, such as temperature or routing_options.
  2. A suffix in the gateway’s model name, for routing; see Inline routing.
  3. The gateway configuration.
  4. The model’s defaults.

Account settings, such as ZDR or special providers, restrict the result regardless of these values.

Public keys #

Public API keys can call only gateways, by full ID, and accept a reduced set of request fields. With a public key, the gateway’s MCP sources, protocol functions, built-in tools, shell, and skills are not used, so the gateway configuration is the only place where its behavior is defined. See Limits.

When to move settings into a gateway #

Move a setting from the request into a gateway when every client sends the same value, when non-developers need to change it, or when it must not be controlled by the client, such as instructions, tools, or moderation. Keep it in the request when it varies per call, such as metadata, conversation_token, or a per-task response_schema.

Type to search the documentation.