View this page: as Markdown | on the official doc

Models Configuration

This reference lists the fields of models.json. See Configure a compatible endpoint for examples and Configuration for the file location.

Add "$schema": "https://pi.dev/schemas/models.schema.json" to models.json for editor validation and completion.

Providers

Each key under providers is a provider ID. A built-in provider ID changes that provider. Any other ID adds a provider, which needs baseUrl and an api at provider or model level.

FieldTypeDefaultDescription
namestringDisplay name.
baseUrlstringAPI base URL. Also applies to the provider's built-in models.
apiKeystringLiteral key, "$NAME" environment interpolation, or "!command" output.
apistringAPI for the provider's models, such as "openai-completions", "openai-responses", "anthropic-messages", or "google-generative-ai".
oauth"radius"OAuth login flow. Requires baseUrl.
headersobjectRequest headers. Values resolve like apiKey.
compatobjectProvider and model compatibility overrides.
authHeaderbooleanfalseWhether to send the resolved API key as Authorization: Bearer.
modelsobject[]
modelOverridesobject

Models

Each models entry adds a model to the provider. An entry whose id matches an existing model replaces it.

FieldTypeDefaultDescription
idstringRequired. Model ID sent to the API.
namestringDisplay name, also matched by --model patterns.
apistringOverrides the provider api.
baseUrlstringOverrides the provider baseUrl.
reasoningbooleanfalseWhether the model supports thinking.
thinkingLevelMapobjectProvider value sent for each thinking level. null marks a level unsupported. Levels the model does not map use the provider's default value through high; xhigh and max are unsupported.
input("text" | "image")[]["text"]
inputLimitsobject
costobject
cost.inputnumberRequired. Input cost in USD per million tokens.
cost.outputnumberRequired. Output cost in USD per million tokens.
cost.cacheReadnumberRequired. Cache-read cost in USD per million tokens.
cost.cacheWritenumberRequired. Cache-write cost in USD per million tokens.
cost.tiersobject[]Request-wide pricing tiers. The highest matching input threshold applies to the full request.
cost.tiers[].inputTokensAbovenumberRequired. Use this tier when total request input exceeds this token count.
cost.tiers[].inputnumberRequired. Input cost in USD per million tokens.
cost.tiers[].outputnumberRequired. Output cost in USD per million tokens.
cost.tiers[].cacheReadnumberRequired. Cache-read cost in USD per million tokens.
cost.tiers[].cacheWritenumberRequired. Cache-write cost in USD per million tokens.
promptCacheobjectBest-effort prompt cache lifetime in seconds for the short and long retention tiers. Pi warms only tiers with a known lifetime.
contextWindownumber128000Context window in tokens.
maxTokensnumber16384Maximum output tokens.
samplingParamsobjectFields merged into every request body. Applies only to OpenAI-compatible APIs.
samplingParamsByThinkingLevelobjectsamplingParams per thinking level, merged over samplingParams.
headersobjectRequest headers. Values resolve like apiKey.
compatobjectProvider and model compatibility overrides.

Model overrides

Each modelOverrides key is the ID of a built-in or extension model. Unknown IDs are ignored. Object fields, such as cost, merge with the model's value field by field; other fields replace it.

FieldTypeDefaultDescription
namestringDisplay name, also matched by --model patterns.
reasoningbooleanWhether the model supports thinking.
thinkingLevelMapobjectProvider value sent for each thinking level. null marks a level unsupported. Levels the model does not map use the provider's default value through high; xhigh and max are unsupported.
input("text" | "image")[]
inputLimitsobject
costobject
cost.inputnumberInput cost in USD per million tokens.
cost.outputnumberOutput cost in USD per million tokens.
cost.cacheReadnumberCache-read cost in USD per million tokens.
cost.cacheWritenumberCache-write cost in USD per million tokens.
cost.tiersobject[]Request-wide pricing tiers. The highest matching input threshold applies to the full request.
cost.tiers[].inputTokensAbovenumberRequired. Use this tier when total request input exceeds this token count.
cost.tiers[].inputnumberRequired. Input cost in USD per million tokens.
cost.tiers[].outputnumberRequired. Output cost in USD per million tokens.
cost.tiers[].cacheReadnumberRequired. Cache-read cost in USD per million tokens.
cost.tiers[].cacheWritenumberRequired. Cache-write cost in USD per million tokens.
promptCacheobjectBest-effort prompt cache lifetime in seconds for the short and long retention tiers. Pi warms only tiers with a known lifetime.
contextWindownumberContext window in tokens.
maxTokensnumberMaximum output tokens.
samplingParamsobjectFields merged into every request body. Applies only to OpenAI-compatible APIs.
samplingParamsByThinkingLevelobjectsamplingParams per thinking level, merged over samplingParams.
headersobjectRequest headers. Values resolve like apiKey.
compatobjectProvider and model compatibility overrides.

Input limits

See Describe model input and caching.

FieldTypeDefaultDescription
maxRequestBytesintegerMaximum serialized provider request size in bytes.
imagesobject
images.resizeobjectCache-safe resize profile applied before a new image enters conversation history.
images.resize.maxWidthinteger
images.resize.maxHeightinteger
images.resize.maxBytesintegerMaximum base64-encoded payload size in bytes.
images.resize.jpegQualityinteger
images.maxPerMessageintegerMaximum images accepted in one provider message.
images.maxPerRequestintegerMaximum images accepted across one provider request.

Compatibility

compat describes verified differences from an API's standard request and response behavior. Model values override provider values per field. The fields that apply depend on the model's api.

openai-completions

FieldTypeDefaultDescription
supportsStorebooleanWhether the provider supports the store field. Default: auto-detected from URL.
supportsDeveloperRolebooleanWhether the provider supports the developer role instead of system. Default: auto-detected from URL.
supportsReasoningEffortbooleanWhether the provider supports reasoning_effort. Default: auto-detected from URL.
supportsUsageInStreamingbooleantrueWhether the provider supports stream_options.include_usage for token usage in streaming responses.
supportsFinishReasonbooleantrueWhether streamed responses include finish_reason. When false, pi infers stop or toolUse when the stream ends.
maxTokensField"max_completion_tokens" | "max_tokens"Which field to use for max tokens. Default: auto-detected from URL.
requiresToolResultNamebooleanWhether tool results require the name field. Default: auto-detected from URL.
requiresAssistantAfterToolResultbooleanWhether a user message after tool results requires an assistant message in between. Default: auto-detected from URL.
requiresThinkingAsTextbooleanWhether thinking blocks must be converted to text blocks with <thinking> delimiters. Default: auto-detected from URL.
requiresReasoningContentOnAssistantMessagesbooleanWhether all replayed assistant messages must include an empty reasoning_content field when reasoning is enabled. Default: auto-detected from URL.
thinkingFormat"openai" | "openrouter" | "deepseek" | "together" | "baseten" | "zai" | "qwen" | "chat-template" | "qwen-chat-template" | "string-thinking" | "ant-ling"Format for reasoning or thinking parameters. When omitted, Pi auto-detects the format from the provider URL. "openai" uses reasoning_effort, "openrouter" uses reasoning.effort, "deepseek" uses thinking.type plus reasoning_effort when supported, "together" uses reasoning.enabled plus reasoning_effort when supported, "baseten" uses configurable chat_template_args plus reasoning_effort when supported, "zai" uses thinking.type, "qwen" uses top-level enable_thinking, "qwen-chat-template" uses chat_template_kwargs.enable_thinking and preserve_thinking, "chat-template" uses configurable chat_template_kwargs, "string-thinking" uses top-level thinking, and "ant-ling" uses reasoning.effort only when the mapped effort is non-null.
chatTemplateKwargsobjectKwargs sent as chat_template_kwargs when thinkingFormat is "chat-template". Use $var with "thinking.enabled", "thinking.effort", or "thinking.budget" for pi-controlled values.
chatTemplateArgsobjectArguments sent as chat_template_args when thinkingFormat is "baseten". Use $var with "thinking.enabled", "thinking.effort", or "thinking.budget" for pi-controlled values.
openRouterRoutingobjectOpenRouter provider routing preferences. Controls which upstream providers OpenRouter routes requests to. Sent as the provider field in the OpenRouter API request body. See https://openrouter.ai/docs/guides/routing/provider-selection.
vercelGatewayRoutingobjectVercel AI Gateway routing preferences. Controls which upstream providers the gateway routes requests to. See https://vercel.com/docs/ai-gateway/models-and-providers/provider-options.
zaiToolStreambooleanfalseWhether z.ai supports top-level tool_stream for streaming tool call deltas.
thinkingTokenBudgetField"thinking_token_budget" | "thinking_budget" | "thinking_budget_tokens"Top-level request field used to cap reasoning tokens from thinkingBudgets. Reasoning and the answer share max_tokens on these endpoints. "thinking_token_budget" is vLLM, "thinking_budget" is Qwen, DashScope, or SGLang, and "thinking_budget_tokens" is llama.cpp. Off by default and not set on the generated catalog.
supportsThinkingTokenBudgetbooleanfalseAlias for thinkingTokenBudgetField: "thinking_token_budget" (vLLM). Prefer thinkingTokenBudgetField.
supportsOpenAIGrammarToolsbooleanfalseWhether the provider supports OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools. The generated catalog enables this for capable models.
supportsMidConvoSystemMessagesbooleanfalseWhether the exact model accepts system or developer messages after the conversation has started. When false, later system messages are folded into the leading system message. The generated catalog enables this for verified models.
supportsMidConvoToolAdditionsbooleanfalseWhether system messages can introduce additional tools mid-conversation. Requires supportsMidConvoSystemMessages. The generated catalog enables this for capable models.
supportsStrictModebooleanfalseWhether the provider supports the strict field in tool definitions. Generated capable models enable it explicitly.
cacheControlFormat"anthropic"Cache control convention for prompt caching. Anthropic applies cache_control markers to the system prompt, last tool definition, and last user, assistant, or tool-result text content.
sendSessionAffinityHeadersbooleanWhether to send session-affinity data from options.sessionId. Default: true for OpenRouter endpoints, false otherwise.
sessionAffinityFormat"openai" | "openai-nosession" | "openrouter"Session-affinity header format. openai sends session_id, x-client-request-id, and x-session-affinity; openai-nosession sends x-client-request-id and x-session-affinity; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected.
supportsLongCacheRetentionbooleanWhether the provider supports long prompt cache retention (prompt_cache_retention: "24h" or Anthropic-style cache_control.ttl: "1h", depending on format). Default: auto-detected from provider and URL.
vllmPrioritynumbervLLM scheduler priority sent as the top-level priority request field. Lower values are handled earlier and the server default is 0. Only meaningful with --scheduling-policy priority. Off by default and not set on the generated catalog.

openai-responses

Also applies to azure-openai-responses and openai-codex-responses.

FieldTypeDefaultDescription
supportsDeveloperRolebooleantrueWhether the provider supports the developer role instead of system.
supportsMidConvoSystemMessagesbooleanfalseWhether the exact model accepts developer or system messages after the conversation has started. When false, later system messages are folded into the leading system message. The generated catalog enables this for verified models.
sessionAffinityFormat"openai" | "openai-nosession" | "openrouter"Session-affinity header format. openai sends session_id and x-client-request-id; openai-nosession sends x-client-request-id; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected.
supportsLongCacheRetentionbooleantrueWhether the provider supports long prompt cache retention. This uses prompt_cache_options.ttl: "30m" on GPT-5.6+ and prompt_cache_retention: "24h" on earlier models.
supportsStrictModebooleanWhether the provider supports strict JSON-schema function tools. Defaults are API-specific; generated OpenAI models enable it explicitly.
supportsOpenAIGrammarToolsbooleanfalseWhether to emit OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools. The generated catalog enables this for capable models.
supportsAdditionalToolsbooleanfalseWhether the model supports message-anchored additional_tools input items.
supportsToolSearchbooleanfalseWhether the model supports client-executed tool search for transcript-anchored additions.
supportsExplicitPromptCacheModebooleanfalseWhether the model accepts prompt_cache_options. Older OpenAI models reject the parameter.
supportsMidConvoEffortbooleanfalseWhether thinking level changes are sent as configuration_update input items instead of changing reasoning.effort, so a change keeps the prompt cache. Only used by the openai-responses API, and ignored with Sign in with ChatGPT on the openai provider.
supportsMaxOutputTokensbooleantrueWhether the provider accepts max_output_tokens. Some Codex-protocol gateways reject it.

anthropic-messages

FieldTypeDefaultDescription
supportsEagerToolInputStreamingbooleantrueWhether the provider accepts per-tool eager_input_streaming. When false, the Anthropic provider omits tools[].eager_input_streaming and sends the legacy fine-grained-tool-streaming-2025-05-14 beta header for tool-enabled requests.
supportsLongCacheRetentionbooleantrueWhether the provider supports Anthropic long cache retention through cache_control.ttl.
sendSessionAffinityHeadersbooleanWhether to send x-session-affinity from options.sessionId when caching is enabled. Required for providers like Fireworks that use session affinity for prompt cache routing; requests to the same replica maximize cache hits. Default: true for OpenRouter endpoints, false otherwise.
sessionAffinityFormat"openrouter"Session-affinity format. openrouter sends x-session-id; when unset, sends x-session-affinity.
supportsCacheControlOnToolsbooleantrueWhether the provider supports Anthropic-style cache_control markers on tool definitions. When false, cache_control is omitted from tool parameters. Some Anthropic-compatible providers, such as Fireworks, do not support this field on tools and may reject or ignore it.
supportsTemperaturebooleantrueWhether the model accepts the Anthropic temperature request field. Claude Opus 4.7+ rejects non-default values.
forceAdaptiveThinkingbooleanfalseWhether to force adaptive thinking (thinking.type: adaptive plus output_config.effort) regardless of model ID. Built-in models that require adaptive thinking set this in generated metadata. Custom Anthropic-compatible providers can set this to true for any model whose upstream requires the adaptive format. Set false to opt out on overridden built-in models.
allowEmptySignaturebooleanfalseWhether to replay empty thinking signatures instead of converting thinking to text.
supportsStrictToolsbooleanfalseWhether the provider supports Anthropic strict tool schemas. Generated Anthropic models enable it explicitly.
supportsMidConvoEffortbooleanfalseWhether the exact model transport supports effort-only system messages and thinking binding controls.
supportsMidConvoSystemMessagesbooleanfalseWhether the exact model accepts system-role messages inside the conversation. When false, later system messages are folded into the top-level system prompt.
supportsMidConvoToolChangesbooleanfalseWhether the exact model accepts mid-conversation tool_addition and tool_removal blocks. Requires supportsMidConvoSystemMessages.
allowedFallbackModelsobject[]Models Anthropic accepts for server-side refusal fallback, with local pricing metadata for returned fallback responses. When absent or empty, callers must omit fallbacks; Anthropic rejects the field for models with no permitted fallback targets.

bedrock-converse-stream

FieldTypeDefaultDescription
supportsStrictModebooleanfalseWhether the model supports Bedrock strict tool schemas.

mistral-conversations

FieldTypeDefaultDescription
supportsMidConvoSystemMessagesbooleanfalseWhether the exact model accepts system messages after the conversation has started. When false, later system messages are folded into the leading system message.
Last updated at: 2026-10-17 03:20:53 UTC