---
title: registry | CodeWeaver Docs
description: API reference for codeweaver.providers.env_registry.registry
url: "https://docs.knitli.com/api/providers/env_registry/registry"
type: static
generatedAt: "2026-04-17T17:21:09.244Z"
---

# registry
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/providers/env_registry/registry.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F&text=registry)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F&text=registry)[Share on Bluesky](https://bsky.app/intent/compose?text=registry%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F&title=registry)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F&t=registry)[Share on Email](mailto:?subject=registry&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F)[Share on WhatsApp](https://wa.me/?text=registry%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fregistry%2F&text=registry)
# `codeweaver.providers.env_registry.registry`
[Section titled “codeweaver.providers.env_registry.registry”](#codeweaverprovidersenv_registryregistry)
Central registry for provider environment configurations.

Provides lazy loading, caching, and query API for provider configs. Thread-safe, supports external registration.

## Class: `ProviderEnvRegistry`
[Section titled “Class: ProviderEnvRegistry”](#class-providerenvregistry)
Central registry for provider environment configurations.

Features:

 - Lazy initialization (only loads when first accessed)
 - Thread-safe initialization
 - External registration support
 - Efficient lookup and querying
 - Inheritance resolution

Example: >>> # Get all configs for a provider >>> configs = ProviderEnvRegistry.get(“deepseek”) >>> >>> # Get just API key env vars >>> api_keys = ProviderEnvRegistry.get_api_key_envs(“openai”) >>> >>> # Get configs for specific client >>> azure_openai = ProviderEnvRegistry.get_for_client(“azure”, “openai”)

### Method: `all_configs`
[Section titled “Method: all_configs”](#method-all_configs)

**

```
all_configs()
```

Get all registered provider configurations.

Returns: Dictionary mapping provider names to their configs

Example: >>> all_configs = ProviderEnvRegistry.all_configs() >>> for provider, configs in all_configs.items(): … print(f”{provider}: {len(configs)} config(s)“)

### Method: `all_providers`
[Section titled “Method: all_providers”](#method-all_providers)

**

```
all_providers()
```

Get all registered provider names.

Returns: Tuple of provider names (lowercase, sorted)

Example: >>> providers = ProviderEnvRegistry.all_providers() >>> print(len(providers)) 40

### Method: `get`
[Section titled “Method: get”](#method-get)

**

```
get()
```

Get all configurations for a provider.

Handles inheritance - if a config has `inherits_from`, the parent’s configs are included in the result.

Args: provider: Provider name (case-insensitive)

Returns: List of ProviderEnvConfig instances (empty if not found)

Example: >>> configs = ProviderEnvRegistry.get(“deepseek”) >>> # Returns [DeepSeek config, OpenAI inherited configs]

### Method: `get_api_key_envs`
[Section titled “Method: get_api_key_envs”](#method-get_api_key_envs)

**

```
get_api_key_envs()
```

Get API key environment variable names for a provider.

Cached for performance.

Args: provider: Provider name

Returns: Tuple of environment variable names (e.g., (“OPENAI_API_KEY”,))

Example: >>> api_keys = ProviderEnvRegistry.get_api_key_envs(“openai”) >>> print(api_keys) (‘OPENAI_API_KEY’,)

### Method: `get_for_client`
[Section titled “Method: get_for_client”](#method-get_for_client)

**

```
get_for_client()
```

Get configs for provider filtered by client SDK.

Args: provider: Provider name client: SDK provider’s name (e.g., “openai”, “anthropic”); the result of `SDKClient.SOME_MEMBER.variable`

Returns: Tuple of matching configs

Example: >>> configs = ProviderEnvRegistry.get_for_client(“azure”, “openai”) >>> # Returns only Azure OpenAI config, not Cohere or Anthropic

### Method: `register`
[Section titled “Method: register”](#method-register)

**

```
register()
```

Register provider configuration.

Note: External registration is an internal API and may change. CodeWeaver has no stable public API during 0.x development.

Args: provider: Provider name (lowercase) config: Single config or list of configs external: If True, this is an external registration (plugin/extension). Prevents conflicts with built-in providers.

Raises: ValueError: If external provider conflicts with built-in provider

Example (internal use only): >>> ProviderEnvRegistry.register( … “myprovider”, ProviderEnvConfig(…), external=True … )

### Method: `to_dict`
[Section titled “Method: to_dict”](#method-to_dict)

**

```
to_dict()
```

Export all configurations as dictionaries.

Used by MCP registry generation script.

Returns: Serializable dictionary of all configs

Example: >>> import json >>> data = ProviderEnvRegistry.to_dict() >>> json.dumps(data, indent=2)