r"""Get a BYOK provider credential Get a single bring-your-own-key (BYOK) provider credential by its `id`. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: The BYOK credential ID (UUID). :param http_referer: The app identifier should be
(
self,
*,
id: str,
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,
)
| 1067 | raise errors.OpenRouterDefaultError("Unexpected response received", http_res) |
| 1068 | |
| 1069 | async def get_async( |
| 1070 | self, |
| 1071 | *, |
| 1072 | id: str, |
| 1073 | http_referer: Optional[str] = None, |
| 1074 | x_open_router_title: Optional[str] = None, |
| 1075 | x_open_router_categories: Optional[str] = None, |
| 1076 | retries: OptionalNullable[utils.RetryConfig] = UNSET, |
| 1077 | server_url: Optional[str] = None, |
| 1078 | timeout_ms: Optional[int] = None, |
| 1079 | http_headers: Optional[Mapping[str, str]] = None, |
| 1080 | ) -> components.GetBYOKKeyResponse: |
| 1081 | r"""Get a BYOK provider credential |
| 1082 | |
| 1083 | Get a single bring-your-own-key (BYOK) provider credential by its `id`. [Management key](/docs/guides/overview/auth/management-api-keys) required. |
| 1084 | |
| 1085 | :param id: The BYOK credential ID (UUID). |
| 1086 | :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. |
| 1087 | This is used to track API usage per application. |
| 1088 | |
| 1089 | :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. |
| 1090 | |
| 1091 | :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. |
| 1092 | |
| 1093 | :param retries: Override the default retry configuration for this method |
| 1094 | :param server_url: Override the default server URL for this method |
| 1095 | :param timeout_ms: Override the default request timeout configuration for this method in milliseconds |
| 1096 | :param http_headers: Additional headers to set or replace on requests. |
| 1097 | """ |
| 1098 | base_url = None |
| 1099 | url_variables = None |
| 1100 | if timeout_ms is None: |
| 1101 | timeout_ms = self.sdk_configuration.timeout_ms |
| 1102 | |
| 1103 | if server_url is not None: |
| 1104 | base_url = server_url |
| 1105 | else: |
| 1106 | base_url = self._get_url(base_url, url_variables) |
| 1107 | |
| 1108 | request = operations.GetBYOKKeyRequest( |
| 1109 | http_referer=http_referer, |
| 1110 | x_open_router_title=x_open_router_title, |
| 1111 | x_open_router_categories=x_open_router_categories, |
| 1112 | id=id, |
| 1113 | ) |
| 1114 | |
| 1115 | req = self._build_request_async( |
| 1116 | method="GET", |
| 1117 | path="/byok/{id}", |
| 1118 | base_url=base_url, |
| 1119 | url_variables=url_variables, |
| 1120 | request=request, |
| 1121 | request_body_required=False, |
| 1122 | request_has_path_params=True, |
| 1123 | request_has_query_params=True, |
| 1124 | user_agent_header="user-agent", |
| 1125 | accept_header_value="application/json", |
| 1126 | http_headers=http_headers, |
nothing calls this directly
no test coverage detected