yera 0.11.1

yera.providers.openrouter_common

Common infrastructure for accessing OpenRouter services.

Symbols

def get_openrouter_client — Build an OpenRouter client from a configured connection.

get_openrouter_client

get_openrouter_client(
    connection: OpenRouterConnection,
    secret_store: SecretStore | None = None,
) → OpenRouter

Build an OpenRouter client from a configured connection.

Parameters

connection
type: OpenRouterConnection

OpenRouter connection containing authentication and attribution configuration.

secret_store
type: SecretStore | None = None

Optional store override for resolving a stored key.

Returns

type: OpenRouter

OpenRouter client authenticated with the resolved API key.

Raises

ProviderCredentialError

If the referenced API key cannot be resolved.