Typescript sdk

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:

// inkeep.config.ts
export default defineConfig({
  models: {
    base: {
      model: "anthropic/claude-sonnet-4-5",
      providerOptions: { temperature: 0.7, maxOutputTokens: 2048 }
    }
  }
});

Override at agent or sub agent level:

const myAgent = agent({
  models: {
    base: { model: "openai/gpt-4.1" }  // Override project default
  }
});

const mySubAgent = subAgent({
  models: {
    structuredOutput: { model: "openai/gpt-4.1-mini" }  // Override for JSON output
  }
});

Model Types

TypePurposeFallback
baseText generation and reasoningRequired at project level
structuredOutputJSON/structured output onlyFalls back to base
summarizerSummaries and status updatesFalls back to base

Supported Models

ProviderExample ModelsAPI Key
Anthropicanthropic/claude-sonnet-4-5
anthropic/claude-haiku-4-5
ANTHROPIC_API_KEY
OpenAIopenai/gpt-4.1
openai/gpt-4.1-mini
openai/gpt-4.1-nano
openai/gpt-5*
OPENAI_API_KEY
Googlegoogle/gemini-2.5-flash
google/gemini-2.5-flash-lite
GOOGLE_GENERATIVE_AI_API_KEY
OpenRouteropenrouter/anthropic/claude-sonnet-4-0
openrouter/meta-llama/llama-3.1-405b
OPENROUTER_API_KEY
Gatewaygateway/openai/gpt-4.1-miniAI_GATEWAY_API_KEY
Note
Note
*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

Pinned models include a specific date or version (e.g., anthropic/claude-sonnet-4-20250514) and always use that exact version.

Unpinned models use generic identifiers (e.g., anthropic/claude-sonnet-4-5) and let the provider choose the latest version, which may change over time as providers update their models.

models: {
  base: {
    model: "anthropic/claude-sonnet-4-5",  // Unpinned - provider chooses version
    // vs
    model: "anthropic/claude-sonnet-4-20250514"  // Pinned - exact version
  }
}

The TypeScript SDK also provides constants for common models:

import { Models } from "@inkeep/agents-sdk";

models: {
  base: {
    model: Models.ANTHROPIC_CLAUDE_SONNET_4_5,  // Type-safe constants
  }
}

Provider Options

Inkeep Agents supports all Vercel AI SDK provider options.

Complete Examples

Basic configuration:

OpenAI with reasoning:

Anthropic with thinking:

Google with thinking:

CLI Defaults

When using inkeep init, defaults are set based on your chosen provider:

ProviderBaseStructured OutputSummarizer
Anthropicclaude-sonnet-4-5claude-sonnet-4-5claude-sonnet-4-5
OpenAIgpt-4.1gpt-4.1-minigpt-4.1-nano
Googlegemini-2.5-flashgemini-2.5-flash-litegemini-2.5-flash-lite