Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.45.0"
".": "0.46.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 104
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-20310988401243aa5c4a2e2ac6cba5dd90873fb7b83497a2d50c691352c0dd7b.yml
openapi_spec_hash: e19e650b4b2c8c8fde1f739c4aab6b33
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-f7024f4171c7c4ec558de1c27f338b1089ffddd0d2dbfdb9bb9f9c2abe8f47bf.yml
openapi_spec_hash: ced43682b49e73a2862f99b49abb4fcd
config_hash: 16e4457a0bb26e98a335a1c2a572290a
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.46.0 (2026-04-06)

Full Changelog: [v0.45.0...v0.46.0](https://github.com/kernel/kernel-python-sdk/compare/v0.45.0...v0.46.0)

### Features

* Add optional url parameter to proxy check endpoint ([cdd4b02](https://github.com/kernel/kernel-python-sdk/commit/cdd4b026fc01b1118cbc35cbc61890d15af3e021))

## 0.45.0 (2026-03-30)

Full Changelog: [v0.44.0...v0.45.0](https://github.com/kernel/kernel-python-sdk/compare/v0.44.0...v0.45.0)
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ Methods:
- <code title="get /proxies/{id}">client.proxies.<a href="./src/kernel/resources/proxies.py">retrieve</a>(id) -> <a href="./src/kernel/types/proxy_retrieve_response.py">ProxyRetrieveResponse</a></code>
- <code title="get /proxies">client.proxies.<a href="./src/kernel/resources/proxies.py">list</a>() -> <a href="./src/kernel/types/proxy_list_response.py">ProxyListResponse</a></code>
- <code title="delete /proxies/{id}">client.proxies.<a href="./src/kernel/resources/proxies.py">delete</a>(id) -> None</code>
- <code title="post /proxies/{id}/check">client.proxies.<a href="./src/kernel/resources/proxies.py">check</a>(id) -> <a href="./src/kernel/types/proxy_check_response.py">ProxyCheckResponse</a></code>
- <code title="post /proxies/{id}/check">client.proxies.<a href="./src/kernel/resources/proxies.py">check</a>(id, \*\*<a href="src/kernel/types/proxy_check_params.py">params</a>) -> <a href="./src/kernel/types/proxy_check_response.py">ProxyCheckResponse</a></code>

# Extensions

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "kernel"
version = "0.45.0"
version = "0.46.0"
description = "The official Python library for the kernel API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "kernel"
__version__ = "0.45.0" # x-release-please-version
__version__ = "0.46.0" # x-release-please-version
48 changes: 43 additions & 5 deletions src/kernel/resources/proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from ..types import proxy_create_params
from ..types import proxy_check_params, proxy_create_params
from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
from .._utils import path_template, maybe_transform, async_maybe_transform
from .._compat import cached_property
Expand Down Expand Up @@ -195,17 +195,35 @@ def check(
self,
id: str,
*,
url: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ProxyCheckResponse:
"""
Run a health check on the proxy to verify it's working.
"""Run a health check on the proxy to verify it's working.

Optionally specify a URL
to test reachability against a specific target. For ISP and datacenter proxies,
this reliably tests whether the target site is reachable from the proxy's stable
exit IP. For residential and mobile proxies, the exit node varies between
requests, so this validates proxy configuration and connectivity rather than
guaranteeing site-specific reachability.

Args:
url: An optional URL to test reachability against. If provided, the proxy check will
test connectivity to this URL instead of the default test URLs. Only HTTP and
HTTPS schemes are allowed, and the URL must resolve to a public IP address. For
ISP and datacenter proxies, the exit IP is stable, so a successful check
reliably indicates that subsequent browser sessions will reach the target site
with the same IP. For residential and mobile proxies, the exit node changes
between requests, so a successful check validates proxy configuration but does
not guarantee that a subsequent browser session will use the same exit IP or
reach the same site — it is useful for verifying credentials and connectivity,
not for predicting site-specific behavior.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -218,6 +236,7 @@ def check(
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._post(
path_template("/proxies/{id}/check", id=id),
body=maybe_transform({"url": url}, proxy_check_params.ProxyCheckParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -394,17 +413,35 @@ async def check(
self,
id: str,
*,
url: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ProxyCheckResponse:
"""
Run a health check on the proxy to verify it's working.
"""Run a health check on the proxy to verify it's working.

Optionally specify a URL
to test reachability against a specific target. For ISP and datacenter proxies,
this reliably tests whether the target site is reachable from the proxy's stable
exit IP. For residential and mobile proxies, the exit node varies between
requests, so this validates proxy configuration and connectivity rather than
guaranteeing site-specific reachability.

Args:
url: An optional URL to test reachability against. If provided, the proxy check will
test connectivity to this URL instead of the default test URLs. Only HTTP and
HTTPS schemes are allowed, and the URL must resolve to a public IP address. For
ISP and datacenter proxies, the exit IP is stable, so a successful check
reliably indicates that subsequent browser sessions will reach the target site
with the same IP. For residential and mobile proxies, the exit node changes
between requests, so a successful check validates proxy configuration but does
not guarantee that a subsequent browser session will use the same exit IP or
reach the same site — it is useful for verifying credentials and connectivity,
not for predicting site-specific behavior.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -417,6 +454,7 @@ async def check(
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._post(
path_template("/proxies/{id}/check", id=id),
body=await async_maybe_transform({"url": url}, proxy_check_params.ProxyCheckParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down
1 change: 1 addition & 0 deletions src/kernel/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .app_list_params import AppListParams as AppListParams
from .browser_pool_ref import BrowserPoolRef as BrowserPoolRef
from .app_list_response import AppListResponse as AppListResponse
from .proxy_check_params import ProxyCheckParams as ProxyCheckParams
from .browser_list_params import BrowserListParams as BrowserListParams
from .browser_persistence import BrowserPersistence as BrowserPersistence
from .credential_provider import CredentialProvider as CredentialProvider
Expand Down
23 changes: 23 additions & 0 deletions src/kernel/types/proxy_check_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import TypedDict

__all__ = ["ProxyCheckParams"]


class ProxyCheckParams(TypedDict, total=False):
url: str
"""An optional URL to test reachability against.

If provided, the proxy check will test connectivity to this URL instead of the
default test URLs. Only HTTP and HTTPS schemes are allowed, and the URL must
resolve to a public IP address. For ISP and datacenter proxies, the exit IP is
stable, so a successful check reliably indicates that subsequent browser
sessions will reach the target site with the same IP. For residential and mobile
proxies, the exit node changes between requests, so a successful check validates
proxy configuration but does not guarantee that a subsequent browser session
will use the same exit IP or reach the same site — it is useful for verifying
credentials and connectivity, not for predicting site-specific behavior.
"""
34 changes: 26 additions & 8 deletions tests/api_resources/test_proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,24 @@ def test_path_params_delete(self, client: Kernel) -> None:
@parametrize
def test_method_check(self, client: Kernel) -> None:
proxy = client.proxies.check(
"id",
id="id",
)
assert_matches_type(ProxyCheckResponse, proxy, path=["response"])

@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_check_with_all_params(self, client: Kernel) -> None:
proxy = client.proxies.check(
id="id",
url="url",
)
assert_matches_type(ProxyCheckResponse, proxy, path=["response"])

@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_raw_response_check(self, client: Kernel) -> None:
response = client.proxies.with_raw_response.check(
"id",
id="id",
)

assert response.is_closed is True
Expand All @@ -204,7 +213,7 @@ def test_raw_response_check(self, client: Kernel) -> None:
@parametrize
def test_streaming_response_check(self, client: Kernel) -> None:
with client.proxies.with_streaming_response.check(
"id",
id="id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -219,7 +228,7 @@ def test_streaming_response_check(self, client: Kernel) -> None:
def test_path_params_check(self, client: Kernel) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.proxies.with_raw_response.check(
"",
id="",
)


Expand Down Expand Up @@ -390,15 +399,24 @@ async def test_path_params_delete(self, async_client: AsyncKernel) -> None:
@parametrize
async def test_method_check(self, async_client: AsyncKernel) -> None:
proxy = await async_client.proxies.check(
"id",
id="id",
)
assert_matches_type(ProxyCheckResponse, proxy, path=["response"])

@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_check_with_all_params(self, async_client: AsyncKernel) -> None:
proxy = await async_client.proxies.check(
id="id",
url="url",
)
assert_matches_type(ProxyCheckResponse, proxy, path=["response"])

@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_raw_response_check(self, async_client: AsyncKernel) -> None:
response = await async_client.proxies.with_raw_response.check(
"id",
id="id",
)

assert response.is_closed is True
Expand All @@ -410,7 +428,7 @@ async def test_raw_response_check(self, async_client: AsyncKernel) -> None:
@parametrize
async def test_streaming_response_check(self, async_client: AsyncKernel) -> None:
async with async_client.proxies.with_streaming_response.check(
"id",
id="id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -425,5 +443,5 @@ async def test_streaming_response_check(self, async_client: AsyncKernel) -> None
async def test_path_params_check(self, async_client: AsyncKernel) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
await async_client.proxies.with_raw_response.check(
"",
id="",
)