yera.setup.provider_setup.openrouter

Obtain and validate OpenRouter provider configuration.

Symbols

class OpenRouterProviderSetup — Provide presentation-independent OpenRouter setup operations.

OpenRouterProviderSetup

Provide presentation-independent OpenRouter setup operations.

Configuration discovery looks for the conventional OpenRouter API-key environment variable. Validation checks that the configured variable contains a plausibly formatted OpenRouter API key.

Attributes

provider_type

Configuration key for the OpenRouter provider.

dependencies

Python import paths required by the integration.

Methods

get_config — Obtain OpenRouter configuration from the current environment.
validate — Validate an OpenRouter connection's API-key environment variable.

OpenRouterProviderSetup.get_config

get_config() → SetupResult[tuple[OpenRouterConnection, ...]]

Obtain OpenRouter configuration from the current environment.

Returns

type: SetupResult[tuple[OpenRouterConnection, ...]]

A result containing a connection referencing OPENROUTER_API_KEY when it is present. Otherwise, the result contains no configuration.

OpenRouterProviderSetup.validate

validate(
    config: OpenRouterConnection,
) → SetupResult[OpenRouterConnection]

Validate an OpenRouter connection's API-key environment variable.

Parameters

config
type: OpenRouterConnection

OpenRouter connection containing its environment-variable name and optional attribution settings.

Returns

type: SetupResult[OpenRouterConnection]

The supplied configuration and any blocking validation errors.