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

# builders
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fbuilders%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%2Fbuilders%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/providers/env_registry/builders.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fbuilders%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fbuilders%2F&text=builders)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fbuilders%2F&text=builders)[Share on Bluesky](https://bsky.app/intent/compose?text=builders%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fbuilders%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fbuilders%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fbuilders%2F&title=builders)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fbuilders%2F&t=builders)[Share on Email](mailto:?subject=builders&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fbuilders%2F)[Share on WhatsApp](https://wa.me/?text=builders%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fbuilders%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fenv_registry%2Fbuilders%2F&text=builders)
# `codeweaver.providers.env_registry.builders`
[Section titled “codeweaver.providers.env_registry.builders”](#codeweaverprovidersenv_registrybuilders)
Composable builder functions for common provider patterns.

These reduce boilerplate by providing templates for common configurations. Typical usage: 1-2 lines per provider instead of 50+ lines.

## Function: `httpx_env_vars`
[Section titled “Function: httpx_env_vars”](#function-httpx_env_vars)

**

```
httpx_env_vars()
```

Standard httpx environment variables used by most HTTP-based providers.

Returns: Frozenset of (key, EnvVarConfig) tuples for common HTTP settings

Example: >>> base_vars = httpx_env_vars() >>> custom_vars = base_vars | frozenset([(“custom”, EnvVarConfig(…))])

## Function: `multi_client_provider`
[Section titled “Function: multi_client_provider”](#function-multi_client_provider)

**

```
multi_client_provider()
```

Build multi-client provider configuration (like Azure).

Some providers (Azure, Heroku) support multiple underlying clients with different environment variables for each.

Args: provider_name: Provider name (e.g., “azure”, “heroku”) configs: Tuple of configs for each client

Returns: Tuple of ProviderEnvConfig with updated provider names

Example: >>> _azure_openai = ProviderEnvConfig(…) >>> _azure_cohere = ProviderEnvConfig(…) >>> AZURE = multi_client_provider(“azure”, [_azure_openai, _azure_cohere])

## Function: `openai_compatible_provider`
[Section titled “Function: openai_compatible_provider”](#function-openai_compatible_provider)

**

```
openai_compatible_provider()
```

Build configuration for OpenAI-compatible provider.

This template covers ~15 providers that use the OpenAI SDK client with provider-specific API keys and base URLs.

Args: provider_name: Display name (e.g., “DeepSeek”, “Fireworks”) api_key_env: Environment variable name for API key base_url_env: Optional env var for base URL default_url: Optional default base URL additional_clients: Extra client names beyond “openai” note: Optional note about the provider extra_vars: Additional custom environment variables

Returns: Configured ProviderEnvConfig with OpenAI inheritance

Example: >>> DEEPSEEK = openai_compatible_provider( … “DeepSeek”, api_key_env=“DEEPSEEK_API_KEY” … ) >>> GROQ = openai_compatible_provider( … “Groq”, … api_key_env=“GROQ_API_KEY”, … base_url_env=“GROQ_BASE_URL”, … default_url=“[https://api.groq.com ↗](https://api.groq.com)”, … additional_clients=(“groq”,), … )

## Function: `simple_api_key_provider`
[Section titled “Function: simple_api_key_provider”](#function-simple_api_key_provider)

**

```
simple_api_key_provider()
```

Build configuration for simple API key-based provider.

For providers with their own SDK client (not OpenAI-compatible).

Args: provider_name: Display name (e.g., “Voyage”, “Cohere”) client: Client SDK name (e.g., “voyage”, “cohere”) api_key_env: Environment variable name for API key base_url_env: Optional env var for base URL additional_vars: Additional custom environment variables note: Optional note about the provider

Returns: Configured ProviderEnvConfig

Example: >>> VOYAGE = simple_api_key_provider( … “Voyage”, client=“voyage”, api_key_env=“VOYAGE_API_KEY” … ) >>> COHERE = simple_api_key_provider( … “Cohere”, … client=“cohere”, … api_key_env=“COHERE_API_KEY”, … base_url_env=“COHERE_BASE_URL”, … )