Chapter 11

Compare the supported AI providers

You already configured OpenRouter as the first provider. Use this comparison to decide whether a direct provider adds a capability, native API feature, or independent route that you actually need. Model catalogs and commercial terms change, so verify every model ID before saving it.

Why compare providers and routes?

Chapter 10 explained that one configured route can be enough, especially when that route is OpenRouter. The practical question is now what requirement is your current route missing? Compare native features, account controls, and independent routes rather than asking which company wins.

This chapter gives you two practical outcomes:

  • Understand the trade-offs—compare native features, model availability, account controls, and route independence rather than relying on a universal ranking.
  • Configure the protocol correctly—the API mode, baseUrl, model ID, and thinkingFormat must match the exact provider route.

If you have not configured a key, follow Chapter 5 and Chapter 6 to start with OpenRouter. Return here only when you can name a reason to add a direct provider. GLM is one optional later provider, not the starting requirement for this English guide.

Tip: The best choice is the route that meets your documented requirement. Confirm current model IDs, capabilities, availability, and terms in the provider’s live documentation.

Six fields for comparing providers

Each section uses the same six fields.

FieldWhat it describesHow to use it
PositionThe provider's role in this guideGateway, direct model provider, or inference host
Model IDsIdentifiers sent in API requestsCopy an exact current ID into Pi Agent’s Models field, such as glm-4.6, gpt-5, or claude-sonnet-4-6; never infer one from a marketing name.
StrengthsDocumented route advantagesNative features, catalog breadth, or latency characteristics
LimitsConstraints you must checkAvailability, data policy, rate limits, and model retirement
Good fitTasks that benefit from the routeAdd it only when the fit matches your work
Pi Agent configurationAPI mode, baseUrl, and reasoning formatUse the repository-verified values and live model catalog

The three Pi Agent fields that cause most mistakes are:

  • api mode: A supported protocol identifier. Most routes use openai-completions. Anthropic direct uses anthropic-messages. Other supported modes include openai-responses, google-generative-ai, mistral-conversations, and bedrock-converse-stream.
  • baseUrl: The endpoint for that route. An OpenAI-compatible protocol does not imply the OpenAI endpoint.
  • thinkingFormat: The parser for route-specific reasoning data. Legal values include openai, openrouter, deepseek, together, baseten, zai, qwen, chat-template, qwen-chat-template, string-thinking, and ant-ling. Anthropic direct uses native blocks through anthropic-messages and leaves this field blank.
Decision rule: Keep OpenRouter for catalog breadth. Add a direct provider for a native API feature, different terms, separate account controls, or an independent operational path.

GLM: An optional direct provider

FieldDetails
PositionA direct Z.ai/GLM route that you may add after the OpenRouter setup.
Model IDsThe add-on baseline documents glm-4.6, glm-4-flash, and glm-4-air. Confirm each ID in the current provider catalog.
StrengthsDirect access to the provider's OpenAI-compatible endpoint and GLM-specific reasoning parsing.
LimitsAccount eligibility, payment, availability, capability, context, and data handling are provider-specific and may change.
Good fitUse when a current GLM model or direct GLM route meets a defined need.
Portalhttps://open.bigmodel.cn/. Confirm the current international availability and documentation before registering with +886; see Chapter 5 for the first-key workflow used by this guide.

Illustrative Pi Agent configuration:

Provider name: GLM
API mode:       openai-completions
Base URL:       https://open.bigmodel.cn/api/paas/v4
API key:        (paste your GLM API key)
Thinking format: zai
Models:         glm-4.6
Tip: zai is the documented Pi reasoning parser for this route. It is not a general setting for other providers.

OpenAI: Direct API access

FieldDetails
PositionA direct route to OpenAI APIs, separate from OpenRouter.
Model IDsCopy exact current API model IDs from OpenAI documentation. Versioned examples in the source include gpt-5, gpt-5-mini, and gpt-5-nano; older IDs such as gpt-4o, gpt-4o-mini, and o1-mini may have different lifecycle status, so verify before use.
StrengthsDirect access to OpenAI-specific API features and account controls.
LimitsModel lifecycle, regional availability, payment terms, rate limits, and data policies can change.
Good fitUse when you require a documented OpenAI-native capability or direct route.
Portalhttps://platform.openai.com/. Check current eligibility and billing requirements there.

Illustrative configuration:

Provider name: OpenAI
API mode:       openai-responses
Base URL:       https://api.openai.com/v1
API key:        (paste your OpenAI API key)
Thinking format: (copy the documented value for the exact model and route)
Models:         (copy exact current model IDs from the official API documentation)
Warning: API billing and availability are governed by current OpenAI terms, not a fixed monthly plan. Model catalogs change quickly—treat gpt-4o and every other ID here as versioned examples, and check the live API documentation before saving.

Anthropic: Native Messages API

FieldDetails
PositionA direct Claude route using Anthropic's Messages API.
Model IDsUse the alias format when currently documented (officially recommended, with hyphens rather than decimal points): claude-sonnet-4-6, claude-opus-4-7, and claude-haiku-4-5. A dated ID such as claude-haiku-4-5-20251001 pins a version. Direct IDs and marketing labels differ: use 4-6, not claude-sonnet-4.6, when the direct API documentation requires it.
StrengthsNative Anthropic content blocks and provider-specific API features when supported by the selected model.
LimitsFeatures, context, retention, eligibility, pricing, and rate limits vary by model and account.
Good fitUse when you need a documented Anthropic-native feature rather than an OpenAI-compatible gateway route.
Portalhttps://console.anthropic.com/. Check current account requirements.

Illustrative configuration:

Provider name: Anthropic
API mode:       anthropic-messages
Base URL:       https://api.anthropic.com/v1
API key:        (paste your Anthropic API key)
Thinking format: (leave blank for native Messages API blocks)
Models:         (copy exact current model IDs from the official API documentation)
Warning: Anthropic is the only provider in this comparison whose direct setup uses openai-completions only through a compatible gateway; direct access uses anthropic-messages. Older documentation may call this mode anthropic. Select the current documented mode or the request can fail or render incorrectly.
Tip: Prompt caching uses the cache_control request field. Its behavior and rates depend on Anthropic and the exact request; do not assume Pi Agent automatically caches every repeated prompt through anthropic-messages.

DeepSeek: Direct OpenAI-compatible route

FieldDetails
PositionA direct provider with an OpenAI-compatible chat endpoint.
Model IDsThe current repository baseline and DeepSeek documentation use deepseek-chat and deepseek-reasoner.
StrengthsA separate direct route with a documented reasoning field for deepseek-reasoner.
LimitsAvailability, latency, rate limits, context, prices, and account requirements may change.
Good fitUse when you want the documented direct models or an independent route from OpenRouter.
Portalhttps://platform.deepseek.com/.

Repository-verified configuration:

Provider name: DeepSeek
API mode:       openai-completions
Base URL:       https://api.deepseek.com/v1
API key:        (paste your DeepSeek API key)
Thinking format: deepseek           <- use for deepseek-reasoner; chat can be left blank
Models:         deepseek-chat
                deepseek-reasoner
Tip: Use the deepseek reasoning parser only for a model and endpoint that return the documented reasoning_content format. Verify performance, latency, and current pricing for your workload.

Groq: Hosted open-weight models

FieldDetails
PositionAn inference provider that hosts a changing catalog of models.
Model IDsThe source lists llama-3.3-70b-versatile, llama-3.1-8b-instant, openai/gpt-oss-120b, and openai/gpt-oss-20b. Older IDs such as mixtral-8x7b-32768 and moonshotai/kimi-k2 may be retired; a Kimi route once used the -instruct-0905 suffix and may now be preview-only. Copy exact IDs from Groq’s current production list.
StrengthsLow-latency inference for supported models, subject to current service conditions.
LimitsThe catalog, rate limits, context, availability, and commercial terms change.
Good fitUse when a currently hosted model and its documented latency or cost fit your workload.
Portalhttps://console.groq.com/.

Illustrative configuration:

Provider name: Groq
API mode:       openai-completions
Base URL:       https://api.groq.com/openai/v1
API key:        (paste your Groq API key)
Thinking format: (leave blank unless the selected model requires a documented format)
Models:         (copy exact current production IDs from the Groq model documentation)
Tip: Check the live Groq model documentation immediately before saving. Hosted models can be retired or replaced, so this page is not an authoritative catalog.

OpenRouter: The first route in this guide

FieldDetails
PositionAn API gateway or aggregator that exposes models from multiple developers through one OpenAI-compatible endpoint.
Model IDsNamespaced IDs use provider/model. OpenRouter commonly follows provider-facing catalog names, with examples such as anthropic/claude-sonnet-4.5, anthropic/claude-opus-5, anthropic/claude-haiku-4.5, openai/gpt-5, meta-llama/llama-3.3-70b-instruct, google/gemini-2.5-flash, and deepseek/deepseek-chat. Direct Anthropic naming can instead use 4-6, while an OpenRouter catalog entry may use 4.5; always copy the exact route ID.
StrengthsOne initial key, one baseUrl, and access to a broad changing catalog.
LimitsFeatures and data flow can differ from a direct API. Pricing, routing, provider selection, and retention are governed by current OpenRouter terms.
Good fitStart here, compare model families, and add a direct provider later only for a defined need.
Portalhttps://openrouter.ai/. Review current account, privacy, and payment terms.

Illustrative configuration:

Provider name: OpenRouter
API mode:       openai-completions
Base URL:       https://openrouter.ai/api/v1
API key:        (paste your OpenRouter API key)
Thinking format: openrouter          (use only for a documented reasoning route; otherwise leave blank)
Models:         anthropic/claude-sonnet-4
Warning: If you depend on Anthropic reasoning blocks or cache_control, do not assume OpenRouter’s anthropic/* route behaves like the direct API. Gateway and direct APIs can expose features differently; verify both providers’ current documentation and usage records.

MiniMax: An optional later provider

FieldDetails
PositionA Shanghai-based provider offering consumer and developer products. Its documented differentiator includes large context windows, but exact limits depend on the current model and route.
Model IDsCopy current model IDs from MiniMax documentation. The repository’s verified editorial baseline maps MiniMax-M3 for English; source examples also include abab7-chat-preview and abab6.5s-chat.
StrengthsDirect access to documented MiniMax models and route-specific reasoning handling.
LimitsModel names, context limits, region-specific endpoints, terms, and costs require live verification.
Good fitUse only when a current MiniMax model provides a capability you need.
PortalInternational portal: https://www.minimax.io/ with api.minimax.io; mainland China portal: https://platform.minimaxi.com/ with api.minimaxi.com (note the extra i). Use the portal and matching endpoint documented for your account; credentials are not interchangeable.

Illustrative configuration (select the Base URL matching your account):

Provider name: MiniMax
API mode:       openai-completions
Base URL:       https://api.minimax.io/v1      <- international account
                https://api.minimaxi.com/v1    <- mainland China account
API key:        (paste your MiniMax API key)
Thinking format: deepseek           <- repository-tested M-series reasoning format
Models:         MiniMax-M3
Tip: Large-context requests can become expensive. The Woow add-on baseline uses thinkingFormat: deepseek for M-series reasoning; verify the selected model, input size, price, and route before making it a default.

Six steps to add an optional direct provider

This example adds DeepSeek after the OpenRouter setup from Chapters 5–6. Other providers require their own documented API mode and endpoint.

  1. Create a provider key

    Open https://platform.deepseek.com/, follow the current account process, create a key named pi-agent-home, and store it in a password manager. Account requirements vary.

  2. Open the Pi Agent Models panel

    Keep the existing OpenRouter card. In the Models panel, select + Add Provider or the equivalent control in your version.

  3. Enter the provider fields

    Name it DeepSeek, choose openai-completions, enter https://api.deepseek.com/v1, and paste the key. Use deepseek for the reasoning route.

  4. Add exact model IDs

    In Models, select + Add Model, add deepseek-chat, and then add deepseek-reasoner. Recheck these exact IDs in the official model page before saving.

  5. Run Test, then save

    Select Test and wait for the displayed result. If it fails, inspect the actual error before changing fields; do not infer a fixed response-time guarantee. After a successful test, select Save.

  6. Verify with a low-risk prompt

    Select the direct model in Composer and send a short test. Confirm the selected route and check its provider usage record.

Concept: Each route follows the same broad workflow, but the API mode, endpoint, model ID, and reasoning format are provider-specific.

Choose by task, not brand ranking

Use this table after checking live catalogs.

TaskFirst route to tryOptional alternativeWhy
Routine household questions A current lower-cost OpenRouter model A direct lower-cost model Low-risk work rarely needs premium reasoning.
Complex Home Assistant YAML A current capable OpenRouter model Anthropic, DeepSeek, or GLM direct Review and test matter more than brand.
Image analysis A current OpenRouter model with image input A direct multimodal provider The exact model must accept images.
Long log analysis A model whose documented context fits MiniMax or another direct large-context route Measure input size and verify limits first.
Complex code A current coding-capable model A direct provider with required native features Use tests and review, not reputation alone.
Low-latency chat A current fast OpenRouter route Groq direct Measure latency in your environment.
A provider refuses or cannot handle a request Choose an appropriate alternative model An independently configured direct route Do not try to bypass safety controls.
Experiment without a direct account OpenRouter None required This is the guide's first-provider workflow.
Many model families through one key OpenRouter That is the gateway's core role.
Video-workflow drafting (Chapter 17) A current model suited to the output language An optional direct provider Test the generated script and narration.
Tip: A typical setup can remain OpenRouter-only. Add one direct route when a native feature or independent path justifies the extra credential.

Common provider problems

  1. I do not know which provider to choose first

    There is no universal winner. For this English guide, start with OpenRouter. Add a direct provider only when you can name the missing feature, account control, or independent route.

  2. Anthropic reasoning looks different through OpenRouter

    Gateway and direct APIs can expose different fields and controls. When you require a documented native feature, use Anthropic direct with API mode anthropic-messages. That route difference is why the Anthropic section above documents a separate configuration.

  3. My account or payment method is rejected

    Do not use informal resellers, borrowed identities, or fabricated addresses. Check current regional eligibility and payment methods. Use OpenRouter only if its terms permit your account and verify the exact model route, such as openai/gpt-5.

  4. A Groq request is rate-limited

    Inspect the 429 response and your account limits before assuming the quota resets that day. Reset periods and upgrade options vary by account and service.

  5. Test passes, but chat times out

    Test may not reproduce a long generation. Check status, request size, selected model, network path, and logs. Do not raise timeouts blindly without understanding the failed request.

  6. I get 404 or model not found

    Copy exact IDs from the provider’s current docs → Models page. For OpenRouter use https://openrouter.ai/models; for Groq use https://console.groq.com/docs/models. Check capitalization, punctuation, namespaces, and retirement notices.

Provider FAQ

Can Pi Agent use Perplexity, xAI, or Google models?
Pi Agent supports several API modes. When a provider offers a compatible OpenAI-compatible API, use openai-completions with the documented baseUrl, credential, and model ID. Examples include https://api.x.ai/v1 and Google’s compatibility endpoint https://generativelanguage.googleapis.com/v1beta/openai/. OpenRouter may also list these models.
Can several models share one provider entry?
Yes. Models that share one provider, credential, mode, and endpoint can use one entry. For example, a GLM entry can list glm-4.6, glm-4-flash, and glm-4-air.
Which route is most private?
Every cloud route receives the data you send. Official policies—not this page—determine whether a provider uses API conversations for training, how long it retains them, where they are processed, and whether zero retention is available. An aggregator does not automatically add privacy; a local model changes the data path but adds local security responsibilities.
Does switching providers break an existing Session?
Not necessarily. The selected provider and model may remain associated with the Session, while later model-switch behavior depends on your Pi Agent version. See Chapter 4 and verify with a low-risk Session.
Does Anthropic prompt caching work through OpenRouter?
Anthropic caching uses cache_control. Support through a gateway depends on the current route, model, and request fields. Chapter 12 explains the concept. Do not assume it always fails through anthropic-messages or always receives a fixed discount through openai-completions.
What does zai mean in thinkingFormat?
zai is the abbreviation used for the Zhipu AI parser ID. Compatible GLM reasoning may include <think>...</think>; use thinkingFormat: zai only when the documented route requires it. The next chapter covers reasoning formats.
Where can I find more provider setup details?
See Appendix B: Provider key setup. Treat examples as versioned, and verify every endpoint and model ID against current provider documentation.
What should I read next?
Continue to Chapter 12: Reasoning blocks, cache_control, and token efficiency, then use Chapter 13 to compare models from the same Session. You can also revisit Chapter 10 for the multi-provider strategy.