Appendix B

Provider key reference

Pi Agent uses a Bring Your Own Key (BYOK) model; it does not sell AI access. This appendix brings together the sign-up pages, key locations, Pi Agent settings, pricing pages, and common pitfalls for seven providers: GLM, OpenAI, Anthropic, DeepSeek, Groq, MiniMax, and OpenRouter. Begin with OpenRouter in Chapters 5–6. When you later need another provider, you can consult its section independently rather than reading this appendix from beginning to end.

Why use this reference

Pi Agent supports a growing number of providers, but adding any of them raises the same three questions:

  • Where is the official sign-up page? A search for “GLM API,” for example, returns many similar-looking pages. Zhipu Open Platform and Zhipu Qingyan, its chat service, look alike but use entirely different URLs.
  • Where is the API keys menu? Each dashboard organizes it differently. OpenAI uses Settings → API keys, and Anthropic uses Settings → API keys behind the gear in the lower-left corner. GLM calls the page “API Key Management,” while DeepSeek puts API keys in the left sidebar.
  • What should I enter in Pi Agent? A key alone is not enough. In the Models panel, you must also choose the correct API modeopenai-completions, openai-responses, anthropic-messages, or google-generative-ai—and provide the correct baseUrl and model ID. A mistake in any field can make Test fail.

Chapter 5 creates your first OpenRouter key, and Chapter 6 adds it to Pi Agent. Chapter 10 explains when an additional provider is worthwhile, while Chapter 11 compares the available routes.

Key idea: Pi Agent is a BYOK interface that stores the credentials you obtain from providers. Your keys remain on your Home Assistant storage at /data/pi-agent/models.json. You choose the providers and settle all usage charges directly with them; Pi Agent does not process those payments.

Four steps for configuring a provider

Although the seven providers have different dashboards, the setup process is broadly the same:

  1. Create an account

    Registration requirements vary by provider and region. Some providers support email, Google, Apple, or GitHub sign-in; others require phone or identity verification. Check the provider’s current eligibility requirements instead of assuming that a particular country code or sign-in method is supported.

  2. Set up billing or use an available free allowance

    Trial credit, free requests, rate limits, payment methods, currencies, and regional eligibility change over time. Review the provider’s current pricing and account pages. A payment method accepted by one provider may not be accepted by another.

  3. Create a key under “API keys” or “Developer Center”

    The exact location differs by dashboard and is listed in each provider section below. The shared rule is important: the complete key is normally shown only when it is created. After you leave the page, the dashboard usually displays only a few identifying characters. Copy the key immediately and save it in a password manager such as Bitwarden, 1Password, or Keychain.

  4. Add the key in the Pi Agent Models panel, then run Test

    Open Models in the upper-right corner of Pi Agent, select Add Provider, enter the name, API mode, base URL, and API key, add a model entry, and select Test. A green check within 3–5 seconds means the connection succeeded; a failure indicator means that at least one field needs attention. Chapter 6 walks through the process in detail.

Tip: Configure OpenRouter first, as described in Chapters 5–6. Add a direct provider only when you need native features, an independent route, or separate account controls. You do not need to create seven provider accounts at once.

GLM (Zhipu Qingyan)

GLM is Zhipu AI’s flagship model family, positioned as a cost-effective option with reasoning support and a 200k context window. OpenRouter is the recommended first route in this guide; see Chapter 5. Configure GLM directly only when its native service meets a specific need, and confirm current models, limits, pricing, and account eligibility in the official documentation.

ItemDetails
Sign-up pagehttps://open.bigmodel.cn/ (Zhipu Open Platform, not the Zhipu Qingyan chat site). The platform may require SMS verification.
API key locationAfter signing in, open the avatar in the upper-right corner → Personal Center → API Key Management → Add. Copy the key immediately; its complete value is shown only once.
Pricing pagehttps://open.bigmodel.cn/pricing
Pi Agent API modeopenai-completions (OpenAI-compatible format)
Pi Agent base URLhttps://open.bigmodel.cn/api/paas/v4 (do not add a trailing slash)
Example modelsglm-4.6 (flagship reasoning model with a 200k context window); glm-4.7 (introduced in 2026 for agentic coding); glm-4-air (lighter and less expensive); and glm-4-flash (fast chat model with free access where offered)
thinkingFormatzai, Pi Agent’s Zhipu thinking-block parser for <think>…</think> tags

Typical Add Provider settings:

Name:           GLM
API mode:       openai-completions
Base URL:       https://open.bigmodel.cn/api/paas/v4
API key:        (paste the value you just copied)
Model name:     glm-4.6
thinkingFormat: zai
Warning: Identity verification, supported phone numbers, payment methods, and regional eligibility vary. Confirm the direct platform’s current requirements and do not attempt to circumvent them. If you instead select meta-llama/llama-3.3-70b-instruct from OpenRouter, remember that it is a separate Meta model, not a GLM route.

OpenAI

OpenAI operates the API behind ChatGPT. The main 2026 examples listed here are the gpt-5.6 family—gpt-5.6-sol, gpt-5.6-terra, and gpt-5.6-luna—while the earlier gpt-4o family remains available but is no longer the first choice for new projects. Model IDs, pricing, availability, and regional billing support can change, so verify each one in OpenAI’s current documentation.

ItemDetails
Sign-up pagehttps://platform.openai.com/ (the developer platform is separate from chatgpt.com, although the services can share a sign-in)
API key locationAfter signing in, open Settings → API keys → Create new secret key in the left sidebar. The direct page is platform.openai.com/settings/organization/api-keys. The former “avatar → View API keys” route has been retired.
Pricing pagehttps://openai.com/api/pricing/
Pi Agent API modeopenai-completions, or openai-responses when you intend to use the newer Responses endpoint
Pi Agent base URLhttps://api.openai.com/v1
Example modelsgpt-5.6-terra (balanced default); gpt-5.6-luna (faster, lower-cost option); and gpt-5.6-sol (reasoning and complex tasks)
thinkingFormatLeave blank for this configuration; Pi Agent does not need a separate parser for OpenAI reasoning output
Warning: OpenAI determines supported regions, identity checks, and accepted payment methods. A card’s acceptance by another subscription service does not mean OpenAI will accept it. Use only an account and payment method that comply with the current regional policy.
Tip: Do not rely on old sign-up credit or pricing claims. Verify whether a $5 minimum purchase applies and whether the historical gpt-4o-mini price of $0.15 per million tokens is still current before adding funds.

Anthropic

Anthropic develops the Claude family, which is particularly strong at programming and long-form reasoning. Its API supports native thinking blocks, which return reasoning in structured form, and prompt caching, which can reduce the cost of repeated prefixes. In this appendix, it is the only provider that does not use openai-completions for a direct connection.

ItemDetails
Sign-up pagehttps://console.anthropic.com/. Sign in with Google or email.
API key locationOpen the gear in the lower-left corner → Settings → API keys → Create Key. The direct page is console.anthropic.com/settings/keys. Keys begin with sk-ant-.
Pricing pagehttps://www.anthropic.com/pricing
Pi Agent API modeanthropic-messages, not openai-completions. The Add Provider menu uses the exact name anthropic-messages.
Pi Agent base URLUse the official default by leaving the field blank, or enter https://api.anthropic.com.
Example modelsclaude-sonnet-4-6 (balanced); claude-opus-4-7, claude-opus-4-8, and claude-opus-5 (higher-capability, higher-cost examples); and claude-haiku-4-5 (faster, lower-cost example). Confirm current availability and pricing.
thinkingFormatWith the anthropic-messages API mode, Pi Agent automatically uses the native format because thinking blocks are native Messages API fields; no manual change is needed

Typical Add Provider settings:

Name:           Anthropic
API mode:       anthropic-messages <- Important: not openai-completions
Base URL:       (leave blank to use the official default)
API key:        sk-ant-...
Model name:     claude-sonnet-4-6
Warning: Sending an openai-completions request to Anthropic’s endpoint can produce a 401 because the Anthropic Messages protocol differs. This is one of the most common configuration mistakes. Payment methods and regional availability remain subject to Anthropic’s current policies.

DeepSeek

DeepSeek is an AI laboratory founded by the Chinese company High-Flyer. Its API is OpenAI-compatible and is known for competitive pricing. Warning: Model catalogs change. This configuration uses the official direct IDs deepseek-chat and deepseek-reasoner; verify their status in the current documentation, especially when consulting lifecycle notices dated 2026-07-24 or later.

ItemDetails
Sign-up pagehttps://platform.deepseek.com/. Register by phone or email where supported.
API key locationIn the left sidebar, select API keys → Create API Key. Keys begin with sk-.
Pricing pagehttps://api-docs.deepseek.com/quick_start/pricing
Pi Agent API modeopenai-completions
Pi Agent base URLhttps://api.deepseek.com/v1
Example modelsdeepseek-chat (lower-cost chat model, listed here with a 1M context window) and deepseek-reasoner (complex reasoning). The documented direct IDs are deepseek-chat and deepseek-reasoner; copy current IDs from the official documentation before saving the provider.
thinkingFormatLeave blank for deepseek-chat. For deepseek-reasoner, use deepseek so Pi Agent can process the reasoning_content field.
Warning: During peak hours in East Asia, DeepSeek may respond slowly or return a 429 rate-limit error. Check your account tier and balance, wait and retry, or route the task to another configured provider. If other material lists deepseek-chat or deepseek-reasoner with a different lifecycle status, compare the documented direct IDs deepseek-chat and deepseek-reasoner with the current catalog before replacing a working ID; the base URL and request format may remain unchanged even when a model ID changes.

Groq

Groq—not xAI’s Grok—is a US company known for LPU inference hardware and speed. Some large open models are described as achieving throughput above 500 tokens per second, or 5–10 times that of some alternatives, but actual performance and free-tier availability vary. Warning: Groq’s catalog changes frequently; several Llama 3.x and older Kimi models were retired during the first half of 2026.

ItemDetails
Sign-up pagehttps://console.groq.com/. Sign in with GitHub or Google.
API key locationIn the left sidebar, select API keys → Create API Key. Keys begin with gsk_.
Pricing pagehttps://groq.com/pricing/ (the free tier has rate limits; check current paid-tier pricing)
Pi Agent API modeopenai-completions
Pi Agent base URLhttps://api.groq.com/openai/v1
Example modelsopenai/gpt-oss-120b (large open model); openai/gpt-oss-20b (lighter, lower-cost option); google/gemini-2.5-flash (listed here with a 256K context window for agentic coding; the older kimi-k2-instruct has been retired); and qwen/qwen3.6-27b (Qwen open model)
thinkingFormatLeave blank for most models. For reasoning models such as deepseek-r1-distill-llama-70b or qwen-qwq-32b, use deepseek.
Warning: Groq periodically retires models. llama-3.3-70b-versatile, moonshotai/kimi-k2-instruct, and mixtral-8x7b have all been removed. If a previously working model stops connecting, check console.groq.com/docs/models and /deprecations, then replace the ID with the officially designated successor.

MiniMax

MiniMax develops models with long-context and reasoning capabilities. This edition uses MiniMax-M3, a 2025–2026 flagship example with a 1M context window and OpenAI- and Anthropic-compatible routes. The international and mainland-China services use separate endpoints.

ItemDetails
Sign-up pageInternational service: https://platform.minimax.io/ (recommended for users outside mainland China where supported); mainland-China service: https://platform.minimaxi.com/. The accounts are entirely separate, so continue using the service where you registered.
API key locationAfter signing in, select Account Settings → API Key → New.
Pricing pageUse the official pricing page for the service where you registered; the international and mainland-China services have separate price lists.
Pi Agent API modeopenai-completions for the /v1 endpoint
Pi Agent base URLInternational: https://api.minimax.io/v1; mainland China: https://api.minimaxi.com/v1. The additional i in the mainland-China domain is intentional, not a typo.
Example modelsMiniMax-M3 (2026 flagship example with a 1M context window, thinking blocks, and strong agentic performance) and abab7-chat-preview (previous-generation general model)
thinkingFormatFor MiniMax-M3, Pi Agent uses deepseek. M2 returned <think>…</think> content; keep deepseek selected for this M3 route so Pi Agent can handle the documented reasoning_content response. Do not assume that the M2 parser applies to M3. For abab7, follow the current model-specific documentation.
Warning: Do not mix the international and mainland-China endpoints: each key works only with the service where it was created, and using the other endpoint returns a 401. Context limits such as 1M for MiniMax-M3 and approximately 32k for abab7 are model-specific. M2, <think>, and deepseek are also version-specific references; use the documented format for your current model and endpoint.

OpenRouter

OpenRouter is an API gateway rather than a model developer. One key and one base URL provide access to models from many providers, including OpenAI, Anthropic, Google, Meta, Mistral, xAI, Perplexity, DeepSeek, GLM, and Cohere. It is the recommended first provider for this guide because it reduces initial account setup. Model availability, routing, and billing terms depend on the current OpenRouter catalog.

ItemDetails
Sign-up pagehttps://openrouter.ai/. Sign in with Google or GitHub.
API key locationAfter signing in, open the avatar in the upper-right corner → Keys → Create Key. Keys begin with sk-or-v1-.
Pricing pageAt the time of writing, model token rates are described as matching the original providers, while adding credit incurs a 5.5% platform fee, or 5.0% for cryptocurrency, plus a $0.80 minimum card fee. For small purchases, the effective fee can reach 10–20%. Confirm every figure on OpenRouter’s current billing page before paying.
Pi Agent API modeopenai-completions. OpenRouter uses an OpenAI-compatible format even when routing to an Anthropic model.
Pi Agent base URLhttps://openrouter.ai/api/v1
Example modelsUse the provider/model format: anthropic/claude-sonnet-4, openai/gpt-4o, deepseek/deepseek-chat, google/gemini-2.5-pro, and meta-llama/llama-3.3-70b-instruct
thinkingFormatIt depends on the selected model. OpenRouter generally standardizes thinking output, so leave this field blank unless the model documentation says otherwise.
Warning: An Anthropic model accessed through OpenRouter may lose native thinking-block and cache_control behavior because the gateway uses a compatibility format. Features available through the direct anthropic-messages API may differ. Use a direct Anthropic key when those provider-specific features are required.
Tip: OpenRouter is useful for comparing models before opening direct-provider accounts. You can send the same prompt to 6 providers through one account instead of creating 6 separate accounts. Chapter 13 demonstrates this model-switching workflow.

Provider comparison

Start with OpenRouter, then use this table for a quick scan when you need a direct connection. Confirm every model ID and account requirement in the provider’s current documentation:

Provider API mode Base URL Example model thinkingFormat Billing note
GLM openai-completions https://open.bigmodel.cn/api/paas/v4 glm-4.6 zai Check regional eligibility and supported payment methods
OpenAI openai-completions https://api.openai.com/v1 gpt-5.6-luna Leave blank Check supported regions and payment methods
Anthropic anthropic-messages (official default) claude-sonnet-4-6 Automatic (native) Check supported regions and payment methods
DeepSeek openai-completions https://api.deepseek.com/v1 deepseek-chat Use deepseek for the reasoning model; leave blank for the chat model Check regional eligibility and supported payment methods
Groq openai-completions https://api.groq.com/openai/v1 openai/gpt-oss-120b Leave blank Check supported regions and payment methods
MiniMax openai-completions https://api.minimax.io/v1 MiniMax-M3 Use zai for M2 International and mainland-China accounts are separate
OpenRouter openai-completions https://openrouter.ai/api/v1 anthropic/claude-sonnet-4 Leave blank Check current OpenRouter billing terms
Key idea: Anthropic is the only direct provider here that uses anthropic-messages, because it has its own protocol for features such as native thinking blocks and cache_control. The other 6 routes use the OpenAI-compatible openai-completions mode and differ primarily in their base URLs. Chapter 11 explains this API-mode distinction in more detail.

Common setup problems

Most registration and connection problems fall into the following categories:

  1. Test fails after you add the provider

    Check these fields in order: (1) Does the base URL have an extra trailing /? For example, .../v4/ instead of .../v4 may produce a 404. (2) Does the key contain leading or trailing spaces? Paste it into a plain-text editor to inspect it before saving. (3) Is the API mode correct? Use anthropic-messages for Anthropic and openai-completions for the other 6 routes in this appendix; the wrong protocol may return 401 or 400. (4) Is the model ID exact and current? Entering a model such as glm-4.6 incorrectly—by omitting .6 and using glm-4—or encountering a catalog change involving deepseek-chat after 2026-07 or llama-3.3-70b-versatile, can produce a 404 model-not-found error. See the troubleshooting table in Chapter 6 for more detail.

  2. Your payment method is not accepted

    Handle billing by provider: (1) OpenAI and Anthropic—review the provider’s supported regions and accepted payment methods, then use an eligible method issued in your own name. (2) GLM, DeepSeek, and MiniMax—do not ask another person to fund the account or misrepresent your region; use the direct service only when its terms support you, or check whether OpenRouter legitimately offers an alternative such as meta-llama/llama-3.3-70b-instruct or deepseek/deepseek-chat. (3) MiniMax—choose the international service at platform.minimax.io only if it supports your region and payment method; the mainland-China service has separate eligibility. (4) Do not use payment workarounds of any kind, including borrowed accounts, cards, or identities. (5) OpenRouter can consolidate several providers under one eligible account, but verify its 5.5% platform fee, 5.0% cryptocurrency fee, and regional terms before paying.

  3. Phone verification stalls because no message arrives

    Verification methods vary by provider and region. (1) Confirm the country code and phone number. (2) Check blocked or spam messages. (3) Wait 5 minutes before requesting another code. (4) Review whether email or federated sign-in is officially supported. Do not bypass the provider’s regional or identity requirements.

  4. You cannot open the GLM, DeepSeek, or MiniMax site from your home network

    Some networks block or cannot route *.cn domains. Try three diagnostic checks: (1) Open the official site from another network to determine whether local DNS or firewall policy is responsible. (2) Review your DNS policy before trying public resolvers such as 8.8.8.8 or 1.1.1.1. (3) Use OpenRouter only when its current catalog and terms support the model and your region. Changing networks or DNS does not make an unsupported account eligible.

  5. You closed the page before copying the new key

    All 7 providers follow the same security pattern: the complete key is shown only when it is created. Later, the dashboard displays only the first and last few characters. A key that was not copied cannot be recovered. Disable it, create a replacement, and save the new value in a password manager before continuing. This is a security feature, not a bug.

  6. A provider passed Test but fails a few days later

    There are three common causes: (1) Your free allowance or account balance is exhausted. Check the provider dashboard and add funds only through an accepted method if needed. (2) The model has been retired. This is particularly common on Groq; consult the provider’s model catalog and use the documented successor. (3) The key was disabled after unusual activity. Review security notices in the dashboard and create a replacement key if the provider instructs you to do so.

Frequently asked questions

Do I need an account with all 7 providers?
No. Begin with OpenRouter, as shown in Chapters 5–6, and add a direct provider only when you encounter a specific need that your current route cannot meet. Anthropic may be useful for native Claude features, Groq for a separate low-latency route, and MiniMax for long-context work. Chapter 10 explains when an additional provider is worthwhile.
Can I use the same key on several devices, such as my phone, tablet, and Home Assistant host?
Yes. An API key is a credential, and usage from every Pi Agent installation that uses it is billed to the same provider account. Not recommended: do not share one key among several people; you cannot attribute costs, and a lost device forces everyone to replace the key. Recommended: create a separate key for each Home Assistant installation or family member where the provider permits it. Many provider dashboards allow 5–10 keys per account. Separate keys and the home/work provider names described in Chapter 6 also make usage easier to audit.
Which provider is best for a complete beginner?
Two recommendations: (1) Start with OpenRouter. Follow Chapters 5–6 using the verified model ID shown in this guide, and review availability and account terms in the live catalog. (2) Add direct providers deliberately. Create another account only when you need a provider-specific capability, an independent route, or separate controls. Never assume that free credit, a payment method, or regional eligibility will be available.
Can I access several providers without creating a separate account for each one?
Yes. OpenRouter aggregates hundreds of models behind one account and key, including openai/gpt-4o, anthropic/claude-sonnet-4, deepseek/deepseek-chat, meta-llama/llama-3.3-70b-instruct, and google/gemini-2.5-flash. The trade-off is a platform fee when adding credit: 5.5%, or 5.0% for cryptocurrency, plus a $0.80 minimum fee for small card payments at the time of writing. Confirm current terms. Anthropic models routed through OpenRouter may lose native thinking blocks and cache_control, so frequent Claude users may still benefit from a direct Anthropic account.
Does Pi Agent upload my key to Woow?
No. The Pi Agent add-on is open source under the MIT license, so you can inspect its code on GitHub. It does not upload models.json, the file containing your keys, to Woow. The data path is your browser → pi-web on your Home Assistant host → the provider’s official endpoint, such as open.bigmodel.cn. No Woow server sits between them. This local key storage is central to BYOK. See “Where the key is stored” in Chapter 6 for more detail.
The base URL and API mode look correct, but Test still fails. Which field is wrong?
Open Edit on the provider card in the Models panel and compare every field with this appendix: (1) API mode—use anthropic-messages for Anthropic and openai-completions for the other routes listed here. (2) Base URL—copy it exactly, including https and /v1 or /api/paas/v4, with no extra trailing /. (3) API key—use the eye icon to check for missing characters or leading and trailing spaces. (4) Model ID—match the provider’s current documentation exactly, including capitalization and hyphens; verify catalog entries such as deepseek-chat and llama-3.3-70b-versatile before using them. If all 4 fields are correct, consult the error-code table in Chapter 6: 401 usually indicates a key or authentication problem, 404 an address or model problem, 400 a request or API-mode problem, and 402 insufficient balance.
Why does Anthropic require its own anthropic API mode while the others use openai-completions?
Anthropic has its own protocol, the Messages API, which is not the same as OpenAI Chat Completions. It supports two features that the compatibility format cannot fully express: (1) native thinking blocks—reasoning models such as claude-opus-4-7 and claude-opus-5 return structured content blocks with type: "thinking" rather than embedding all reasoning in ordinary text; and (2) cache_control—you can mark a prompt segment for caching so a repeated prefix may cost 10% as much. These features require the anthropic-messages API mode. OpenRouter’s openai-completions route can flatten them, so heavy Claude users may prefer a direct Anthropic account using anthropic-messages. Chapter 12 explains the value of thinking blocks.
Should I use MiniMax’s international service or its mainland-China service?
Use the international service at platform.minimax.io, with API endpoint api.minimax.io, only if it supports your region and payment method. The mainland-China service uses platform.minimaxi.com and API endpoint api.minimaxi.com; the extra i is part of the official domain. Do not mix the services: (1) payment methods and eligibility differ; (2) interface languages, pricing, and network performance may differ; and (3) a key works only with the service where it was created, so using the other endpoint returns a 401. The international service also documents an /anthropic endpoint; the standard example on this page uses /v1. Confirm current API-mode guidance before configuring either route.