Learning resourcesReviewed · Perplexity

Perplexity Agent API Model Fallback

Perplexity’s Model Fallback guide helps developers configure backup AI models, but it leaves important failure details unspecified and contains an inconsistent pricing example. It documents an ordered chain of up to five models, automatic failover and a required output-token limit when Anthropic models are included.

Researched 24 Nov 2026

In short.

Perplexity’s Model Fallback guide helps developers configure backup AI models, but it leaves important failure details unspecified and contains an inconsistent pricing example. The API is documented to try up to five models in order until one succeeds, with examples spanning OpenAI, Anthropic and Google models. The page explains request configuration and serving-model billing, but does not establish measured reliability, failover latency, current model availability or actual workload costs. No examples were executed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete Model Fallback page at [https://docs.perplexity.ai/docs/agent-api/model-fallback.md]: its overview, mechanism, request and response examples, Anthropic parameter note, billing warning, pricing example and next-step links. Linked documentation, the documentation index and external sources embedded in sample answers are excluded. No examples were executed. Live availability, actual failover, output quality, latency and charges remain unassessed.

The overview

Resource identity

This is Perplexity’s documentation page for model fallback in its Agent API: [https://docs.perplexity.ai/docs/agent-api/model-fallback.md]. The resource is a feature guide, rather than a standalone application, model or code library.

It covers ordered fallback requests, examples in three programming interfaces, a provider-specific token requirement and billing guidance.

Practical assessment

The guide provides enough detail to understand how to request automatic model fallback. Its strongest practical details are the five-model limit, precedence of models over model, and the requirement to include max_output_tokens when any fallback entry uses Anthropic.

Treat higher availability as the feature’s stated purpose, rather than a measured guarantee. The page supplies no availability benchmark, and its pricing example contains conflicting model names.

Who it suits

The guide suits developers integrating Perplexity’s Agent API who can accept responses from more than one model. It is especially relevant when a preferred model’s failure should trigger an attempt with another model or provider.

Beginners receive concrete request examples, but the page assumes familiarity with API credentials and Python, TypeScript or HTTP requests. It does not provide complete account or SDK onboarding.

Documented capabilities

A request can contain a models array with up to five entries in preference order. The documented chain can span providers, and the API handles progression through the chain.

The response’s model field identifies the serving model, while usage reports token counts. These fields let an application inspect which model answered rather than assuming the first choice succeeded.

Using it

Requirements

The HTTP example requires bearer authentication using PERPLEXITY_API_KEY. The Python example imports Perplexity from perplexity; the TypeScript example imports Perplexity from @perplexity-ai/perplexity_ai. SDK versions and installation requirements are not specified.

Include max_output_tokens whenever the chain contains an anthropic/* model. The page says Anthropic requests require this parameter even though other providers accept requests without it. Current access to the illustrated models is not established.

How fallback works

The API tries the first model, moves to the next if it fails or is unavailable, and continues until a model succeeds or the chain is exhausted. When both models and the single model field are present, models takes precedence.

This is sequential fallback rather than a request to combine several models’ answers. The page does not define which specific errors trigger progression or what response is returned when every entry fails.

Configuration

Using authenticated API access, call client.responses.create in either illustrated SDK or send an HTTP POST to [https://api.perplexity.ai/v1/agent]. Supply input and an ordered models array, placing the preferred model first.

Add max_output_tokens if Anthropic appears anywhere in the chain. Inspect response.model and response.usage when handling the result. Credential provisioning, SDK installation and account eligibility are not explained on this page.

Example request

The basic example asks for an explanation of the original Transformer architecture. It lists openai/gpt-5.6-sol first, anthropic/claude-sonnet-5-5 second and google/gemini-4-hydrogen third, with max_output_tokens set to 8192.

The Python and TypeScript examples print response.model. Their accompanying sample response identifies the first model, so it illustrates response inspection without demonstrating an actual switch to a backup. The model identifiers are source examples; their current availability is unknown.

Assessment & evidence

Limits and unknowns

The documented chain is limited to five models. The page does not specify timeout budgets, retry counts, eligible HTTP errors, streaming behavior, or how partial responses and tool activity are handled during a failure.

It provides no guarantee that fallback models produce equivalent answers or support identical request options. Failover latency, reliability improvement and behavior when all models fail remain unassessed.

Decision considerations

The intended benefit is straightforward: the API can attempt another model when the preferred one cannot serve a request. Cross-provider chains are presented as a way to add provider redundancy, although the page does not quantify the resulting reliability.

A practical implication is that each backup should be acceptable for the application’s task, output requirements and budget. Availability alone does not establish answer quality, and sequential attempts may add waiting time; the size of either effect is unknown.

Alternatives to consider

The page also acknowledges selection through a single model field. That approach may suit applications where only one model is acceptable, while the models array enables the documented fallback chain.

Handling retries and backup selection in application code is another design to consider when explicit control over error handling and timing matters. This page does not document or compare that approach, and supplies no evidence for competing services.

Evidence and confidence

The evidence consists of Perplexity’s documentation at [https://docs.perplexity.ai/docs/agent-api/model-fallback.md], including explanatory text, request examples and sample responses. It supports the documented configuration rules, without independently establishing runtime behavior.

Both full response examples identify the first listed model. Neither demonstrates a later model taking over after failure. No code or API request was executed, and the generated answers embedded in those examples do not validate fallback reliability.

Access & freshness

Costs and billing

The page states that billing follows the model that serves the request, rather than every model listed in the chain. It advises considering price differences when ordering models. Current rates and the cost of a particular workload are unknown from this page.

The pricing example is internally inconsistent: it says the first model failed, still returns that first model, openai/gpt-5.6-sol, and then describes gpt-5.1 pricing although gpt-5.1 is absent from the request. It therefore cannot reliably establish the illustrated fallback outcome or applicable rate.

The expanded responses contain sample USD costs, token counts, cache fields and search-tool charges. These are documentation examples, not observed charges or dependable budget estimates.

Rights and data terms

The page supplies no explicit licence or redistribution permission for its prose or code examples. Reuse rights are unknown from this source.

API terms, generated-output ownership, data retention and provider-specific data handling conditions are also not established here.

Freshness

The documentation snapshot was captured on 24 November 2026. The page does not state its publication date, last revision date or compatible SDK versions.

Dates inside sample search results describe those results, rather than the fallback feature’s maintenance history. Current model identifiers, prices and API behavior are not established by those dates.

Before adopting

Confirm current model availability and prices through the linked model documentation [https://docs.perplexity.ai/docs/agent-api/models.md], and check endpoint requirements in [https://docs.perplexity.ai/api-reference/agent-post.md]. Those linked pages are not assessed here. Resolve the conflicting pricing example before using it for budgeting.

Choose backups that meet the application’s output needs, include max_output_tokens for Anthropic entries, and record the serving model and usage. Before relying on fallback, validate eligible failure conditions, elapsed time, charges and the outcome when all models fail in a controlled development environment.

Evidence for this report

selected-page.txtselected · checked 2026-11-24