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.

Automatic discovery looks for the conventional OpenRouter API-key environment variable. Validation resolves the configured API-key reference from either the environment or the protected credential store, then checks its prefix and length locally. It does not contact OpenRouter.

Attributes

provider_type

Configuration key for the OpenRouter provider.

display_name

Human-readable provider name shown during setup.

dependencies

Python import paths required by the integration.

connection_cls

OpenRouter connection schema produced by the integration.

Methods

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

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,
    secret_store: SecretStore | None = None,
) → SetupResult[OpenRouterConnection]

Validate an OpenRouter connection's API-key reference locally.

The reference may point to an environment variable or an entry in the protected credential store. Validation checks the resolved key's prefix and length without contacting OpenRouter.

Parameters

config
type: OpenRouterConnection

OpenRouter connection containing its API-key reference and optional attribution settings.

secret_store
type: SecretStore | None = None

Optional protected store used to resolve the API key.

Returns

type: SetupResult[OpenRouterConnection]

The supplied configuration and any blocking validation errors.