MCPcopy Create free account
hub / github.com/OpenRouterTeam/python-sdk / list

Method list

src/openrouter/providers.py:15–126  ·  view source on GitHub ↗

r"""List all providers :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. :param x_open_router_title: The app display name allows you to customize how your

(
        self,
        *,
        http_referer: Optional[str] = None,
        x_open_router_title: Optional[str] = None,
        x_open_router_categories: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    )

Source from the content-addressed store, hash-verified

13 r"""Provider information endpoints"""
14
15 def list(
16 self,
17 *,
18 http_referer: Optional[str] = None,
19 x_open_router_title: Optional[str] = None,
20 x_open_router_categories: Optional[str] = None,
21 retries: OptionalNullable[utils.RetryConfig] = UNSET,
22 server_url: Optional[str] = None,
23 timeout_ms: Optional[int] = None,
24 http_headers: Optional[Mapping[str, str]] = None,
25 ) -> operations.ListProvidersResponse:
26 r"""List all providers
27
28 :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
29 This is used to track API usage per application.
30
31 :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
32
33 :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
34
35 :param retries: Override the default retry configuration for this method
36 :param server_url: Override the default server URL for this method
37 :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
38 :param http_headers: Additional headers to set or replace on requests.
39 """
40 base_url = None
41 url_variables = None
42 if timeout_ms is None:
43 timeout_ms = self.sdk_configuration.timeout_ms
44
45 if server_url is not None:
46 base_url = server_url
47 else:
48 base_url = self._get_url(base_url, url_variables)
49
50 request = operations.ListProvidersRequest(
51 http_referer=http_referer,
52 x_open_router_title=x_open_router_title,
53 x_open_router_categories=x_open_router_categories,
54 )
55
56 req = self._build_request(
57 method="GET",
58 path="/providers",
59 base_url=base_url,
60 url_variables=url_variables,
61 request=request,
62 request_body_required=False,
63 request_has_path_params=False,
64 request_has_query_params=True,
65 user_agent_header="user-agent",
66 accept_header_value="application/json",
67 http_headers=http_headers,
68 _globals=operations.ListProvidersGlobals(
69 http_referer=self.sdk_configuration.globals.http_referer,
70 x_open_router_title=self.sdk_configuration.globals.x_open_router_title,
71 x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories,
72 ),

Callers

nothing calls this directly

Calls 6

HookContextClass · 0.90
get_security_from_envFunction · 0.90
unmarshal_json_responseFunction · 0.90
_get_urlMethod · 0.80
_build_requestMethod · 0.80
do_requestMethod · 0.80

Tested by

no test coverage detected