r"""List BYOK provider credentials List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider.
(
self,
*,
http_referer: Optional[str] = None,
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
offset: Optional[int] = None,
limit: Optional[int] = None,
workspace_id: Optional[str] = None,
provider: Optional[operations.Provider] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
http_headers: Optional[Mapping[str, str]] = None,
)
| 180 | raise errors.OpenRouterDefaultError("Unexpected response received", http_res) |
| 181 | |
| 182 | async def list_async( |
| 183 | self, |
| 184 | *, |
| 185 | http_referer: Optional[str] = None, |
| 186 | x_open_router_title: Optional[str] = None, |
| 187 | x_open_router_categories: Optional[str] = None, |
| 188 | offset: Optional[int] = None, |
| 189 | limit: Optional[int] = None, |
| 190 | workspace_id: Optional[str] = None, |
| 191 | provider: Optional[operations.Provider] = None, |
| 192 | retries: OptionalNullable[utils.RetryConfig] = UNSET, |
| 193 | server_url: Optional[str] = None, |
| 194 | timeout_ms: Optional[int] = None, |
| 195 | http_headers: Optional[Mapping[str, str]] = None, |
| 196 | ) -> Optional[operations.ListBYOKKeysResponse]: |
| 197 | r"""List BYOK provider credentials |
| 198 | |
| 199 | List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required. |
| 200 | |
| 201 | :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. |
| 202 | This is used to track API usage per application. |
| 203 | |
| 204 | :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. |
| 205 | |
| 206 | :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. |
| 207 | |
| 208 | :param offset: Number of records to skip for pagination |
| 209 | :param limit: Maximum number of records to return (max 100) |
| 210 | :param workspace_id: Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace. |
| 211 | :param provider: Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`). |
| 212 | :param retries: Override the default retry configuration for this method |
| 213 | :param server_url: Override the default server URL for this method |
| 214 | :param timeout_ms: Override the default request timeout configuration for this method in milliseconds |
| 215 | :param http_headers: Additional headers to set or replace on requests. |
| 216 | """ |
| 217 | base_url = None |
| 218 | url_variables = None |
| 219 | if timeout_ms is None: |
| 220 | timeout_ms = self.sdk_configuration.timeout_ms |
| 221 | |
| 222 | if server_url is not None: |
| 223 | base_url = server_url |
| 224 | else: |
| 225 | base_url = self._get_url(base_url, url_variables) |
| 226 | |
| 227 | request = operations.ListBYOKKeysRequest( |
| 228 | http_referer=http_referer, |
| 229 | x_open_router_title=x_open_router_title, |
| 230 | x_open_router_categories=x_open_router_categories, |
| 231 | offset=offset, |
| 232 | limit=limit, |
| 233 | workspace_id=workspace_id, |
| 234 | provider=provider, |
| 235 | ) |
| 236 | |
| 237 | req = self._build_request_async( |
| 238 | method="GET", |
| 239 | path="/byok", |
no test coverage detected