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

Method delete

src/openrouter/byok.py:685–811  ·  view source on GitHub ↗

r"""Delete a BYOK provider credential Delete (soft-delete) a bring-your-own-key (BYOK) provider credential by its `id`. The encrypted key material is wiped and the record is marked as deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: The

(
        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,
    )

Source from the content-addressed store, hash-verified

683 raise errors.OpenRouterDefaultError("Unexpected response received", http_res)
684
685 def delete(
686 self,
687 *,
688 id: str,
689 http_referer: Optional[str] = None,
690 x_open_router_title: Optional[str] = None,
691 x_open_router_categories: Optional[str] = None,
692 retries: OptionalNullable[utils.RetryConfig] = UNSET,
693 server_url: Optional[str] = None,
694 timeout_ms: Optional[int] = None,
695 http_headers: Optional[Mapping[str, str]] = None,
696 ) -> components.DeleteBYOKKeyResponse:
697 r"""Delete a BYOK provider credential
698
699 Delete (soft-delete) a bring-your-own-key (BYOK) provider credential by its `id`. The encrypted key material is wiped and the record is marked as deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
700
701 :param id: The BYOK credential ID (UUID).
702 :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
703 This is used to track API usage per application.
704
705 :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
706
707 :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
708
709 :param retries: Override the default retry configuration for this method
710 :param server_url: Override the default server URL for this method
711 :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
712 :param http_headers: Additional headers to set or replace on requests.
713 """
714 base_url = None
715 url_variables = None
716 if timeout_ms is None:
717 timeout_ms = self.sdk_configuration.timeout_ms
718
719 if server_url is not None:
720 base_url = server_url
721 else:
722 base_url = self._get_url(base_url, url_variables)
723
724 request = operations.DeleteBYOKKeyRequest(
725 http_referer=http_referer,
726 x_open_router_title=x_open_router_title,
727 x_open_router_categories=x_open_router_categories,
728 id=id,
729 )
730
731 req = self._build_request(
732 method="DELETE",
733 path="/byok/{id}",
734 base_url=base_url,
735 url_variables=url_variables,
736 request=request,
737 request_body_required=False,
738 request_has_path_params=True,
739 request_has_query_params=True,
740 user_agent_header="user-agent",
741 accept_header_value="application/json",
742 http_headers=http_headers,

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