Skip to main content

Agent Providers

Agent providers are the AI coding assistants that execute session tasks. Polygent is provider-agnostic — you can switch providers per workspace, per session, or per workflow without re-tooling.

Supported Providers

Polygent supports seven providers out of the box. You only need to install and configure the ones your team plans to use.

ProviderCLI Reference
Claude Codehttps://docs.claude.com/en/docs/claude-code/overview
Gemini CLIhttps://github.com/google-gemini/gemini-cli
OpenCodehttps://opencode.ai
Kilo CLIhttps://kilocode.ai
Codexhttps://github.com/openai/codex
Qwen Codehttps://github.com/QwenLM/qwen-code
Polygent CodeBuilt-in agent — no external CLI. Connects directly to your chosen model backend using your own API key.

Most providers shell out to a CLI installed on the API (or Agent) host. Polygent Code is different — it runs in-process, so no third-party CLI install is needed. Credentials for any provider are supplied via environment variables — Polygent never stores raw API keys.

Feature Comparison

The matrix below reflects what each provider's CLI surfaces to Polygent today. Empty cells mean the upstream CLI does not expose the capability — Polygent works around the gap where possible but cannot create signal that the CLI never emits.

FeatureClaude CodeGemini CLIOpenCodeKilo CLICodexQwen CodePolygent Code
Thinking / reasoning traceYesYesYesYesYesYesYes
Token usage (input / output / cache)YesYesYesYesYesYesYes
MCP server injection (Polygent built-in MCP)YesYesYesYesYesYesYes
File attachments (images, docs)YesYesYesYesYesYesYes
Built-in tools — Read / Edit / WriteYesYesYesYesYesYesYes
Built-in tools — Bash / shellYesYesYesYesYesYesYes
Built-in tools — Glob / GrepYesYesYesYesYesYesYes
Built-in tools — WebFetchYesYesYesYesYesYesYes
Built-in tools — WebSearchYesYesYesYesYesYes
Built-in tools — Sub-agent / TaskYesYesYesYesYes
Built-in tools — TodoWrite (progress tracking)YesYesYesYesYesYes
Cost auditYesYesYesYesYes
Change system promptYesYesYesYesYesYesYes
Budget per task (USD)YesYes
Per-mode tool allowlist (Chat / Bot / Develop)YesYesYes

Notes on the cost row

When a CLI does not emit total_cost_usd (Gemini CLI, Codex), Polygent still records token counts on every audit row, but cannot calculate the final cost of the session. In this case, the cost is $0.

Notes on the budget-per-task row

Only Claude Code and Polygent Code accept a USD cap that stops the agent mid-run before it overspends. For all other providers the CLI exposes no native cost limit, so Polygent enforces budgets after each run by inspecting audit rows — it cannot interrupt an in-flight turn.

Where to Configure

All provider configuration lives in Settings → Providers (persisted in the database, takes effect immediately — no API restart required). Per provider, the UI exposes:

SettingPurpose
Provider StatusEnable or disable the provider. Disabled providers are hidden from selection
Model Visibility ToggleHide unwanted models from selection dropdowns workspace-wide
Custom ModelsAdd or remove model identifiers beyond the built-in list

Changes apply to every workspace that uses the provider.

Defaults: Only Claude Code and Polygent Code are enabled out of the box. All other providers (Gemini CLI, OpenCode, Kilo CLI, Codex, Qwen Code) are disabled by default and must be explicitly enabled before users can select them.

Provider Status (Enable / Disable)

Toggle a provider off to remove it from every selection dropdown across the application — session creation, bot configuration, workflow steps, ticket configuration, and global settings (Insights, Merge Conflicts, Code Review, Verification).

Disabling a provider does not affect existing sessions, bots, automations, or workflows already configured with that provider — they continue to function normally. Only new selections are filtered. To re-enable a provider, toggle it back on; selection dropdowns refresh automatically after saving settings.

Permissions: access to provider configuration requires settings.view and settings.manage (admins always have access).

Model Visibility

Each provider ships with a default list of supported models. Toggle individual models off to hide them from the model dropdowns shown to users when starting sessions, configuring tickets, or running workflows. Hidden models stay configured for any existing references; only new selections are filtered.

Custom Models

If a provider exposes a model that isn't in Polygent's built-in list (e.g., a new release, a regional alias, or an internal proxy), add it under Custom Models:

  1. Open Settings → Providers → {Provider}
  2. Add the model identifier exactly as the CLI accepts it
  3. The model appears in selection dropdowns immediately

Remove custom models the same way. Removing a model in active use leaves running sessions untouched but prevents new selections.

Where Providers Are Selected

Once a provider and model are configured, users select them at:

PlacePurpose
Workspace defaultsDefault provider/model for the whole workspace
Session startOverride per session at creation time
Ticket configurationPer-ticket provider/model for the implementation step
Workflow stepsOverride per Message / Ralph Loop step
Bot configurationBots are pinned to one provider/model
AutomationPer-automation override
Insights (global setting)Provider/model used to extract insights
Merge Conflicts (global setting)Provider/model used for AI-assisted conflict resolution

Credentials

Each provider CLI reads its own environment variables for authentication (e.g., ANTHROPIC_API_KEY, GEMINI_API_KEY, OPENAI_API_KEY). Set these in the service account's environment on each host that runs sessions, or per-workspace under Environment Variables.

Polygent never logs credential values.

Polygent Code: model selection and credentials

Polygent Code connects directly to the model backend implied by the model you pick in the dropdown, using your own API key. Set the matching credential as an environment variable (per-host or per-workspace) for each backend your team selects:

BackendRequired env var
AnthropicANTHROPIC_API_KEY
OpenAIOPENAI_API_KEY
Google GeminiGEMINI_API_KEY
OpenRouterOPENROUTER_API_KEY
OpenCode ZenZEN_API_KEY (optional)
Kilo GatewayKILO_API_KEY (optional)

You can switch backends between turns in a single session by changing the selected model.

Free models (no account needed)

The dropdown includes free models routed through curated gateways that require no signup. Models prefixed "Kilo …" (e.g. Kilo Auto Free) use the Kilo Gateway, and the "(free)" entries such as DeepSeek V4 Flash (free) use OpenCode Zen. These work without setting KILO_API_KEY / ZEN_API_KEY — leave the env var unset and the request goes out unauthenticated. Setting the key is optional (e.g. to lift free-tier rate limits). Free models are subject to upstream rate limits; a transient "model at capacity" error just means you should retry or pick another free model.

Distributed Hosts

When sessions are dispatched to a Session Agent on a separate machine, the same provider CLI must be installed on that host with the same credentials and model availability.

Troubleshooting

SymptomLikely Cause
CLI works in your shell but fails as a serviceService runs under a different user — set credentials in the service's environment
Model not in dropdownHidden via Model Visibility, or not in Custom Models — add it
Sessions hang at startProvider needs interactive login — log in once as the service account, or use API-key auth
Different version on different hostsUpgrade each host independently; Polygent does not push CLI binaries