GitHub

API reference for client.

Effect's generated OpenRouterClient: a method per operation of the OpenRouter API, generated from Effect's Generated.ts by scripts/gen_ai_schemas.py; do not edit.

A JSON operation gives its decoded body (with include_response=True, the body and the response); a documented error status fails with OpenRouterClientError (tag names the operation and status, cause is the decoded body). ...Sse operations stream the decoded events, ...Stream ones the body's bytes.

Classes

Functions

make

make(http_client, *, transform_client=None) -> OpenRouterClient

The client over http_client (requests carry relative paths: prepend the API's URL to the client). transform_client picks the client each JSON operation runs on, per call.

ParameterTypeDescription
http_client_HttpClientService[_HttpClientError]
transform_client_c.ClientTransform | None = None

Returns OpenRouterClient

def make(
    http_client: _HttpClientService[_HttpClientError],
    *,
    transform_client: _c.ClientTransform | None = None,
) -> OpenRouterClient:
    """The client over ``http_client`` (requests carry relative paths:
    prepend the API's URL to the client). ``transform_client`` picks the
    client each JSON operation runs on, per call."""
    return OpenRouterClient(http_client, transform_client)