Skip to content
Open
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.66.0"
".": "0.67.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 119
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-e66c3f8aedccc39104386a3ec619f3fdcef7e8b00d9e5aa82e414a1b387351c2.yml
openapi_spec_hash: afeddf18ebc3da1521b3e6f6739411fa
config_hash: 80eef1b592110714ea55cd26c470fabb
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-51549f813f3002e18c6ca8d850cc0c7932828d511c151e0412c73b6798d19e30.yml
openapi_spec_hash: ee77b293c4bda91c1a32cfdd12b8739e
config_hash: 57567e00b41af47cef1b78e51b747aa0
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.67.0 (2026-06-11)

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

### Features

* Add project_id SDK client option mapped to X-Kernel-Project-Id ([1799732](https://github.com/kernel/kernel-python-sdk/commit/17997322232374c6c49d99333b564a0537f247c0))


### Documentation

* **api:** correct project-scoping descriptions in OpenAPI spec ([5929332](https://github.com/kernel/kernel-python-sdk/commit/592933283ff7bf0e6596ddbfbc4851e285a1d36e))

## 0.66.0 (2026-06-10)

Full Changelog: [v0.65.0...v0.66.0](https://github.com/kernel/kernel-python-sdk/compare/v0.65.0...v0.66.0)
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.66.0"
version = "0.67.0"
description = "The official Python library for the kernel API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
16 changes: 16 additions & 0 deletions src/kernel/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,16 @@ class Kernel(SyncAPIClient):
api_key: str
browser_route_cache: BrowserRouteCache

project_id: str | None

_environment: Literal["production", "development"] | NotGiven
_browser_routing: BrowserRoutingConfig

def __init__(
self,
*,
api_key: str | None = None,
project_id: str | None = None,
environment: Literal["production", "development"] | NotGiven = not_given,
base_url: str | httpx.URL | None | NotGiven = not_given,
timeout: float | Timeout | None | NotGiven = not_given,
Expand Down Expand Up @@ -140,6 +143,8 @@ def __init__(
)
self.api_key = api_key

self.project_id = project_id

self._environment = environment

base_url_env = os.environ.get("KERNEL_BASE_URL")
Expand Down Expand Up @@ -309,6 +314,7 @@ def default_headers(self) -> dict[str, str | Omit]:
return {
**super().default_headers,
"X-Stainless-Async": "false",
"X-Kernel-Project-Id": self.project_id if self.project_id is not None else Omit(),
**self._custom_headers,
}

Expand Down Expand Up @@ -347,6 +353,7 @@ def copy(
self,
*,
api_key: str | None = None,
project_id: str | None = None,
environment: Literal["production", "development"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
Expand Down Expand Up @@ -383,6 +390,7 @@ def copy(
http_client = http_client or self._client
return self.__class__(
api_key=api_key or self.api_key,
project_id=project_id or self.project_id,
base_url=base_url or self.base_url,
environment=environment or self._environment,
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
Expand Down Expand Up @@ -437,13 +445,16 @@ class AsyncKernel(AsyncAPIClient):
api_key: str
browser_route_cache: BrowserRouteCache

project_id: str | None

_environment: Literal["production", "development"] | NotGiven
_browser_routing: BrowserRoutingConfig

def __init__(
self,
*,
api_key: str | None = None,
project_id: str | None = None,
environment: Literal["production", "development"] | NotGiven = not_given,
base_url: str | httpx.URL | None | NotGiven = not_given,
timeout: float | Timeout | None | NotGiven = not_given,
Expand Down Expand Up @@ -477,6 +488,8 @@ def __init__(
)
self.api_key = api_key

self.project_id = project_id

self._environment = environment

base_url_env = os.environ.get("KERNEL_BASE_URL")
Expand Down Expand Up @@ -646,6 +659,7 @@ def default_headers(self) -> dict[str, str | Omit]:
return {
**super().default_headers,
"X-Stainless-Async": f"async:{get_async_library()}",
"X-Kernel-Project-Id": self.project_id if self.project_id is not None else Omit(),
**self._custom_headers,
}

Expand Down Expand Up @@ -684,6 +698,7 @@ def copy(
self,
*,
api_key: str | None = None,
project_id: str | None = None,
environment: Literal["production", "development"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
Expand Down Expand Up @@ -720,6 +735,7 @@ def copy(
http_client = http_client or self._client
return self.__class__(
api_key=api_key or self.api_key,
project_id=project_id or self.project_id,
base_url=base_url or self.base_url,
environment=environment or self._environment,
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
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.66.0" # x-release-please-version
__version__ = "0.67.0" # x-release-please-version
24 changes: 12 additions & 12 deletions src/kernel/resources/auth/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def create(

login_url: Optional login page URL to skip discovery

proxy: Proxy selection. Provide either id or name. The proxy must belong to the
caller's org.
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it.

record_session: Whether to record browser sessions for this connection by default. Useful for
debugging. Can be overridden per-login. Defaults to false.
Expand Down Expand Up @@ -264,8 +264,8 @@ def update(

login_url: Login page URL. Set to empty string to clear.

proxy: Proxy selection. Provide either id or name. The proxy must belong to the
caller's org.
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it.

record_session: Whether to record browser sessions for this connection by default

Expand Down Expand Up @@ -457,8 +457,8 @@ def login(
credentials are stored.

Args:
proxy: Proxy selection. Provide either id or name. The proxy must belong to the
caller's org.
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it.

record_session: Override the connection's default for recording this login's browser session.
When omitted, the connection's record_session default is used.
Expand Down Expand Up @@ -653,8 +653,8 @@ async def create(

login_url: Optional login page URL to skip discovery

proxy: Proxy selection. Provide either id or name. The proxy must belong to the
caller's org.
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it.

record_session: Whether to record browser sessions for this connection by default. Useful for
debugging. Can be overridden per-login. Defaults to false.
Expand Down Expand Up @@ -781,8 +781,8 @@ async def update(

login_url: Login page URL. Set to empty string to clear.

proxy: Proxy selection. Provide either id or name. The proxy must belong to the
caller's org.
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it.

record_session: Whether to record browser sessions for this connection by default

Expand Down Expand Up @@ -974,8 +974,8 @@ async def login(
credentials are stored.

Args:
proxy: Proxy selection. Provide either id or name. The proxy must belong to the
caller's org.
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it.

record_session: Override the connection's default for recording this login's browser session.
When omitted, the connection's record_session default is used.
Expand Down
20 changes: 10 additions & 10 deletions src/kernel/resources/browser_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def create(
specified, the matching profile will be loaded into the browser session.
Profiles must be created beforehand.

proxy_id: Optional proxy to associate to the browser session. Must reference a proxy
belonging to the caller's org.
proxy_id: Optional proxy to associate to the browser session. Must reference a proxy in
the same project as the browser session.

start_url: Optional URL to navigate to when a new browser is warmed into the pool.
Best-effort: failures to navigate do not fail pool fill. Only applied to
Expand Down Expand Up @@ -256,8 +256,8 @@ def update(
specified, the matching profile will be loaded into the browser session.
Profiles must be created beforehand.

proxy_id: Optional proxy to associate to the browser session. Must reference a proxy
belonging to the caller's org.
proxy_id: Optional proxy to associate to the browser session. Must reference a proxy in
the same project as the browser session.

size: Number of browsers to maintain in the pool. The maximum size is determined by
your organization's pooled sessions limit (the sum of all pool sizes cannot
Expand Down Expand Up @@ -338,7 +338,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncOffsetPagination[BrowserPool]:
"""
List browser pools owned by the caller's organization.
List browser pools in the resolved project.

Args:
limit: Limit the number of browser pools to return.
Expand Down Expand Up @@ -630,8 +630,8 @@ async def create(
specified, the matching profile will be loaded into the browser session.
Profiles must be created beforehand.

proxy_id: Optional proxy to associate to the browser session. Must reference a proxy
belonging to the caller's org.
proxy_id: Optional proxy to associate to the browser session. Must reference a proxy in
the same project as the browser session.

start_url: Optional URL to navigate to when a new browser is warmed into the pool.
Best-effort: failures to navigate do not fail pool fill. Only applied to
Expand Down Expand Up @@ -777,8 +777,8 @@ async def update(
specified, the matching profile will be loaded into the browser session.
Profiles must be created beforehand.

proxy_id: Optional proxy to associate to the browser session. Must reference a proxy
belonging to the caller's org.
proxy_id: Optional proxy to associate to the browser session. Must reference a proxy in
the same project as the browser session.

size: Number of browsers to maintain in the pool. The maximum size is determined by
your organization's pooled sessions limit (the sum of all pool sizes cannot
Expand Down Expand Up @@ -859,7 +859,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[BrowserPool, AsyncOffsetPagination[BrowserPool]]:
"""
List browser pools owned by the caller's organization.
List browser pools in the resolved project.

Args:
limit: Limit the number of browser pools to return.
Expand Down
8 changes: 4 additions & 4 deletions src/kernel/resources/browsers/browsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def create(
specified, the matching profile will be loaded into the browser session.
Profiles must be created beforehand.

proxy_id: Optional proxy to associate to the browser session. Must reference a proxy
belonging to the caller's org.
proxy_id: Optional proxy to associate to the browser session. Must reference a proxy in
the same project as the browser session.

start_url: Optional URL to open when the browser session is created. Navigation is
best-effort, so navigation failures do not prevent the session from being
Expand Down Expand Up @@ -794,8 +794,8 @@ async def create(
specified, the matching profile will be loaded into the browser session.
Profiles must be created beforehand.

proxy_id: Optional proxy to associate to the browser session. Must reference a proxy
belonging to the caller's org.
proxy_id: Optional proxy to associate to the browser session. Must reference a proxy in
the same project as the browser session.

start_url: Optional URL to open when the browser session is created. Navigation is
best-effort, so navigation failures do not prevent the session from being
Expand Down
10 changes: 4 additions & 6 deletions src/kernel/resources/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,9 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncOffsetPagination[Credential]:
"""List credentials owned by the caller's organization.
"""List credentials in the resolved project.

Credential values are not
returned.
Credential values are not returned.

Args:
domain: Filter by domain
Expand Down Expand Up @@ -509,10 +508,9 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[Credential, AsyncOffsetPagination[Credential]]:
"""List credentials owned by the caller's organization.
"""List credentials in the resolved project.

Credential values are not
returned.
Credential values are not returned.

Args:
domain: Filter by domain
Expand Down
4 changes: 2 additions & 2 deletions src/kernel/resources/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncOffsetPagination[ExtensionListResponse]:
"""
List extensions owned by the caller's organization.
List extensions in the resolved project.

Args:
limit: Limit the number of extensions to return.
Expand Down Expand Up @@ -308,7 +308,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[ExtensionListResponse, AsyncOffsetPagination[ExtensionListResponse]]:
"""
List extensions owned by the caller's organization.
List extensions in the resolved project.

Args:
limit: Limit the number of extensions to return.
Expand Down
12 changes: 6 additions & 6 deletions src/kernel/resources/proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ProxyCreateResponse:
"""
Create a new proxy configuration for the caller's organization.
Create a new proxy configuration in the resolved project.

Args:
type: Proxy type to use. In terms of quality for avoiding bot-detection, from best to
Expand Down Expand Up @@ -117,7 +117,7 @@ def retrieve(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ProxyRetrieveResponse:
"""
Retrieve a proxy belonging to the caller's organization by ID.
Retrieve a proxy in the resolved project by ID.

Args:
extra_headers: Send extra headers
Expand Down Expand Up @@ -151,7 +151,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncOffsetPagination[ProxyListResponse]:
"""
List proxies owned by the caller's organization.
List proxies in the resolved project.

Args:
limit: Limit the number of proxies to return.
Expand Down Expand Up @@ -313,7 +313,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ProxyCreateResponse:
"""
Create a new proxy configuration for the caller's organization.
Create a new proxy configuration in the resolved project.

Args:
type: Proxy type to use. In terms of quality for avoiding bot-detection, from best to
Expand Down Expand Up @@ -365,7 +365,7 @@ async def retrieve(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ProxyRetrieveResponse:
"""
Retrieve a proxy belonging to the caller's organization by ID.
Retrieve a proxy in the resolved project by ID.

Args:
extra_headers: Send extra headers
Expand Down Expand Up @@ -399,7 +399,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[ProxyListResponse, AsyncOffsetPagination[ProxyListResponse]]:
"""
List proxies owned by the caller's organization.
List proxies in the resolved project.

Args:
limit: Limit the number of proxies to return.
Expand Down
Loading
Loading