Model Configuration
Copy page
Configure AI models for your Agents and Sub Agents
Configure models at Project (required), Agent, or Sub Agent levels. Settings inherit down the hierarchy.
Configuration Hierarchy
You must configure at least the base model at the project level:
Override at agent or sub agent level:
Model Types
| Type | Purpose | Fallback |
|---|---|---|
base | Text generation and reasoning | Required at project level |
structuredOutput | JSON/structured output only | Falls back to base |
summarizer | Summaries and status updates | Falls back to base |
Each model type inherits independently through the project → agent → sub agent hierarchy. structuredOutput and summarizer resolve to the most specific level that sets them, regardless of where base is configured — overriding only base at the agent or sub agent level does not change which structuredOutput or summarizer is used. They fall back to the resolved base only when no level sets them.
Supported Models
| Provider | Example Models | API Key |
|---|---|---|
| Anthropic | anthropic/claude-opus-5-5anthropic/claude-sonnet-5-5anthropic/claude-haiku-5-5anthropic/claude-sonnet-4-6anthropic/claude-opus-4-8anthropic/claude-opus-4-7anthropic/claude-opus-4-6anthropic/claude-haiku-4-5 | ANTHROPIC_API_KEY |
| OpenAI | openai/gpt-6.2-solopenai/gpt-6.1-terraopenai/gpt-6-lunaopenai/gpt-5.5-proopenai/gpt-5.5openai/gpt-5.4-proopenai/gpt-5.4openai/gpt-5.4-miniopenai/gpt-5.4-nanoopenai/gpt-5.2openai/gpt-5.1openai/gpt-4.1openai/gpt-4.1-miniopenai/gpt-5* | OPENAI_API_KEY |
| Azure OpenAI | azure/my-gpt4-deploymentazure/my-gpt35-deployment | AZURE_API_KEY |
google/gemini-4-hydrogengoogle/gemini-4-neongoogle/gemini-3.5-flash-litegoogle/gemini-3.1-pro-previewgoogle/gemini-3.5-flashgoogle/gemini-3.1-flash-litegoogle/gemini-2.5-progoogle/gemini-2.5-flashgoogle/gemini-2.5-flash-lite | GOOGLE_GENERATIVE_AI_API_KEY | |
| OpenRouter | openrouter/anthropic/claude-sonnet-4-0openrouter/meta-llama/llama-3.1-405b | OPENROUTER_API_KEY |
| Gateway | gateway/openai/gpt-4.1-mini | AI_GATEWAY_API_KEY |
| NVIDIA NIM | nim/nvidia/llama-3.3-nemotron-super-49b-v1.5nim/nvidia/nemotron-4-340b-instruct | NIM_API_KEY |
| Custom OpenAI-compatible | custom/my-custom-modelcustom/llama-3-custom | CUSTOM_LLM_API_KEY |
| Mock | mock/default | None required |
openai/gpt-5, openai/gpt-5-mini, and openai/gpt-5-nano require a verified OpenAI organization. If your organization is not yet verified, these models will not be available.Pinned vs Unpinned Models
A dated model ID such as openai/gpt-5.5-2026-04-23 pins an exact version. A provider alias such as openai/gpt-5.5 can point to a different version over time. Providers publish the available aliases and versions.
The TypeScript SDK also provides constants for common models:
Anthropic scheduled the Claude Sonnet 4.5 retirement on its API for November 30, 2026. If your project uses anthropic/claude-sonnet-4-5 or its dated ID, choose a supported model such as anthropic/claude-sonnet-4-6. See Anthropic's model deprecations.
Provider Options
Inkeep Agents supports all Vercel AI SDK provider options.
How providerOptions works
providerOptions accepts two types of values:
- Scalars (
temperature,topP,maxOutputTokens,seed,maxDuration) — standard generation parameters applied to every call - Objects (
anthropic: {},openai: {},gateway: {}, etc.) — provider-specific options for that provider
This means you can mix them freely:
Constructor-level config (baseURL, headers, resourceName, apiVersion) is always specified at the top level of providerOptions, not nested under a provider key.
Complete Examples
Basic configuration:
OpenAI with reasoning:
Anthropic with thinking:
Google with thinking:
Controlling reasoning:
Each provider exposes reasoning through providerOptions (see the examples above):
- Anthropic —
anthropic.thinking - OpenAI —
openai.reasoningEffort - Google —
google.thinkingConfig.thinkingBudget
Default reasoning behavior varies by model. Claude 5 models and GPT-6.2 Sol reason by default. To reduce reasoning on GPT-6.2 Sol, set providerOptions.openai.reasoningEffort to 'low'. Sol rejects 'none'. See Tuning Agents and the provider guides for Anthropic, OpenAI, and Google.
Vercel AI Gateway:
When AI_GATEWAY_API_KEY is set, Anthropic, OpenAI, and Google models are automatically routed through Vercel AI Gateway for per-request cost tracking. No configuration changes are needed — your existing model strings work as-is. See AI Gateway below for fallback models, allowed providers, and advanced gateway configuration.
Azure OpenAI:
Azure OpenAI requires either resourceName (for standard Azure OpenAI deployments) or baseURL (for custom endpoints) in providerOptions. The AZURE_API_KEY environment variable must be set for authentication. Note that only one Azure OpenAI resource can be used at a time since authentication is handled via a single environment variable.
Custom OpenAI-compatible provider:
Custom OpenAI-compatible providers require a base URL to be specified in providerOptions.baseURL or providerOptions.baseUrl. The CUSTOM_LLM_API_KEY environment variable will be automatically used for authentication if present.
Context Window Override
Inkeep uses a built-in input token limit for supported models. Set providerOptions.contextWindowSize to specify the input token limit for a custom model or override a built-in limit.
Automatic compression uses the smaller of the input token limit, including any override, and a fixed 300,000-token budget. An artifact is oversized when it exceeds 30% of the model's input token limit. See Conversation Memory for compression triggers and fallback settings.
Anthropic charges higher rates for Claude Haiku 5.5 prompts over 100,000 tokens. Set contextWindowSize to 100000 on that model to start compression sooner.
AI Gateway
Vercel AI Gateway provides intelligent model routing, automatic failover, and per-request cost tracking. All AI Gateway features require AI_GATEWAY_API_KEY to be set in your environment.
When the gateway is active, Anthropic, OpenAI, and Google models are automatically routed through it — no configuration changes needed. This enables fallback models and allowed providers for those providers. Per-request cost tracking is available for any model routed through the gateway.
For self-hosted deployments, you can bring your own API keys (BYOK) for any provider by configuring them in your Vercel AI Gateway team settings.
Use the same provider model IDs shown above when Inkeep routes requests through the gateway automatically. For an explicit gateway/ model ID, use the gateway's ID. For example, configure gateway/anthropic/claude-sonnet-5.5 for Claude Sonnet 5.5. See the Vercel AI Gateway model catalog.
Fallback Models
Configure an ordered list of backup models that the gateway tries if the primary model fails or is unavailable:
If the primary model (anthropic/claude-sonnet-5-5) fails, the gateway automatically tries openai/gpt-5.2, then google/gemini-2.5-flash. If all models fail, the request errors.
Fallback models can be configured on any model slot (base, structuredOutput, summarizer). They inherit through the project → agent → sub agent hierarchy — even when a sub agent overrides the model itself, it still inherits fallbackModels from its parent unless it explicitly sets its own. All entries must use the provider/model format (e.g., "openai/gpt-5.2").
If a structured-output request has a Gemini fallback and the schema allows extra object properties, Inkeep delivers answer text and components after validation. Claude and OpenAI still receive the schema through their provider adapters.
Allowed Providers
Restrict and prioritize which providers can serve requests. The order determines preference — the first provider in the list has the highest priority:
The gateway will try to serve the request via AWS Bedrock first. If Bedrock is unavailable, it falls back to Anthropic's direct API.
Available providers include: anthropic, openai, google, bedrock, azure, vertex.
Like fallbackModels, allowedProviders inherits through the project → agent → sub agent hierarchy even when the model is overridden at a lower level.
Combining Both
Both features can be used together. With this configuration, allowedProviders restricts and prioritizes which providers can serve the primary model, while fallbackModels defines alternative models to try if the primary model is unavailable:
Advanced: Manual Gateway Provider Options
You can also configure gateway routing directly via providerOptions for access to the full gateway provider options (order, only, models, byok, providerTimeouts, tags, zeroDataRetention).
providerOptions.gateway.caching and providerOptions.anthropic.cacheControl interact with Inkeep's default-on prompt caching. Inkeep applies its caching default only when you haven't set a value — if you set providerOptions.gateway.caching or providerOptions.anthropic.cacheControl explicitly, your value is preserved.
If you set both fallbackModels and providerOptions.gateway.models, fallbackModels takes precedence.
CLI Defaults
npx @inkeep/create-agents and inkeep add --project set model defaults based on your provider.
| Provider | Base | Structured Output | Summarizer |
|---|---|---|---|
| Anthropic | claude-sonnet-4-6 | claude-sonnet-4-6 | claude-sonnet-4-6 |
| OpenAI | gpt-5.2 | gpt-4.1-mini | gpt-5.4-nano |
gemini-2.5-flash | gemini-2.5-flash-lite | gemini-2.5-flash-lite |