<!-- source: https://deepwiki.com/qhkm/zeptoclaw/10.2-supported-providers -->

# Supported Providers

- src/channels/discord.rs
- src/channels/lark.rs
- src/channels/slack.rs
- src/channels/webhook.rs
- src/channels/whatsapp_cloud.rs
- src/kernel/provider.rs
- src/providers/claude.rs
- src/providers/gemini.rs
- src/providers/mod.rs
- src/providers/openai.rs
- src/providers/registry.rs

ZeptoClaw provides a unified interface for interacting with a wide array of Large Language Model (LLM) providers. The system currently supports 18+ runtime-ready providers, ranging from major cloud vendors (Anthropic, OpenAI, Google) to local inference engines (Ollama, vLLM) and specialized aggregators (OpenRouter) [src/providers/mod.rs41-60](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/mod.rs#L41-L60)

## Provider Architecture

ZeptoClaw uses a trait-based architecture where every supported backend implements the `LLMProvider` trait [src/providers/types.rs83-149](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/types.rs#L83-L149) This abstraction allows the `AgentLoop` and `AgentMiddlewarePipeline` to interact with different models using a consistent set of types for messages, tool definitions, and usage metrics.

### Backend Mapping

The system routes requests through four primary implementation backends based on the provider's `backend` specification in the registry [src/providers/registry.rs21](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/registry.rs#L21-L21)

Title: Provider Backend Mapping to Code Entities

```

```

**Sources:** [src/providers/mod.rs64-88](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/mod.rs#L64-L88) [src/providers/registry.rs55-195](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/registry.rs#L55-L195) [src/kernel/provider.rs39-130](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/kernel/provider.rs#L39-L130)

## Provider Registry

Metadata for all supported providers is centralized in the `PROVIDER_REGISTRY` [src/providers/registry.rs55](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/registry.rs#L55-L55) Each `ProviderSpec` defines the default behavior, endpoint, and authentication requirements for a specific provider key.

### Registry Specification

**Note: While the registry lists Gemini as anopenaibackend, theprovider_from_runtime_selectionlogic specifically intercepts "gemini" to route it through the nativeGeminiProvidersrc/kernel/provider.rs59-75*

**Sources:** [src/providers/registry.rs55-195](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/registry.rs#L55-L195) [src/kernel/provider.rs59-75](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/kernel/provider.rs#L59-L75)

## Detailed Provider Coverage

### Anthropic (Claude)

The `ClaudeProvider` implements the Anthropic Messages API.

- Authentication: Supports standard API keys ( x-api-key ) and OAuth Bearer tokens ( Authorization: Bearer ). OAuth tokens require specific anthropic-beta headers (e.g., claude-code-20250219 ) to be accepted by the API src/providers/claude.rs 122-156
- System Prompts: Automatically extracts system messages from the conversation and passes them as the top-level system field in the request src/providers/claude.rs 171-172

### OpenAI & Compatible

The `OpenAIProvider` is the most versatile, powering dozens of compatible services.

- Model Detection: It intelligently switches between max_tokens and max_completion_tokens based on the model name (targeting newer reasoning models like o1/o3) src/providers/openai.rs 67-72
- Azure Integration: When configured as azure , it uses the api-key header instead of Bearer and appends the api-version query parameter src/providers/registry.rs 177-185

### Google Gemini

The `GeminiProvider` provides native support for Google's Generative Language API.

- Thinking Models: Supports Gemini 2.0+ "thinking" models. It includes logic to filter out response parts tagged with thought: true , ensuring only the final answer reaches the agent src/providers/gemini.rs 5-6
- CLI Auth: Can automatically resolve credentials from the Gemini CLI login file located at ~/.gemini/oauth_credentials.json , including token expiry validation src/providers/gemini.rs 78-115

### Google Vertex AI

The `VertexProvider` (enabled via the `provider-vertex` feature flag) integrates with GCP's enterprise AI platform.

- Auth: Uses Application Default Credentials (ADC) via the google-cloud-auth crate for seamless execution in GCP environments (GCE, GKE, Cloud Run) src/providers/vertex.rs 94-106

## Provider Assembly and Data Flow

The `build_provider_chain` function in the kernel orchestrates the creation of the runtime provider. It resolves the configuration, refreshes credentials, and wraps the base provider in decorators for reliability [src/kernel/provider.rs23-30](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/kernel/provider.rs#L23-L30)

Title: Authentication and Provider Assembly Data Flow

```

```

### Error Handling

Providers use `parse_provider_error` to map HTTP status codes and response body patterns to a unified `ProviderError` enum [src/providers/mod.rs93-125](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/mod.rs#L93-L125) This allows the `RetryProvider` decorator to distinguish between retryable errors (429 Rate Limit, 5xx Server Error) and non-retryable errors (401 Auth, 400 Invalid Request) [src/providers/mod.rs131-198](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/mod.rs#L131-L198)

**Sources:** [src/kernel/provider.rs23-130](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/kernel/provider.rs#L23-L130) [src/providers/mod.rs93-125](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/mod.rs#L93-L125) [src/providers/registry.rs262-332](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/registry.rs#L262-L332)
