Skip to main content

pumble-python-sdk

Unofficial Python SDK, MCP server, and MCP App for the Pumble API Keys addon. This project is independent. Pumble and CAKE.com do not endorse or sponsor it.

Three layers: a Speakeasy-generated raw SDK (26 operations), a value-typed async façade (no write retries, direct-read proof on every write), and integration surfaces — CLI (pumble-keys), MCP server (pumble-keys-mcp, stdio or Streamable HTTP, no SSE), an interactive MCP App, webhook/PumbleApp helpers, and Pumble OAuth. One workspace per deployment; the API key lives in the environment only.

Documentation

Status: released. See CHANGELOG.md for versions, SECURITY.md for the security policy, and SOURCE_BASELINE.md for the anchored sources.

Summary

Pumble API Addon documentation: Strongly-typed OpenAPI contract for the Pumble API-Keys add-on (https://pumble.com/api). All response and request schemas in this document were validated against the live API on 2026-05-21 against a sacrificial workspace; field names, casing, and nullability reflect actual server behavior.

Authentication

All endpoints expect the workspace API key in the ApiKey request header. Keys are issued from the Pumble web app at Workspace settings → API keys.

Errors

The Pumble service emits two distinct error body shapes, depending on which validation layer rejects the request:

  1. { "error": "<string>" } — legacy/free-form messages from path handlers (most common).
  2. { "message": "<string>", "localizedMessage": "<string>", "code": <int> } — structured validation errors from the framework layer.

Both are documented under the Error schema (a oneOf union). Generated SDKs receive a single union type for typed error handling.

Table of Contents

SDK Installation

[!NOTE] Python version upgrade policy

Once a Python version reaches its official end of life date, a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.

The SDK can be installed with uv, pip, or poetry package managers.

uv

uv is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.

uv add pumble_keys_sdk

PIP

PIP is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.

pip install pumble_keys_sdk

Poetry

Poetry is a modern tool that simplifies dependency management and package publishing by using a single pyproject.toml file to handle project metadata and dependencies.

poetry add pumble_keys_sdk

Shell and script usage with uv

You can use this SDK in a Python shell with uv and the uvx command that comes with it like so:

uvx --from pumble_keys_sdk python

It's also possible to write a standalone Python script without needing to set up a whole project like so:

#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = [
#     "pumble_keys_sdk",
# ]
# ///

from pumble_keys import PumbleSDK

sdk = PumbleSDK(
  # SDK arguments
)

# Rest of script here...

Once that is saved to a file, you can run it with uv run script.py where script.py can be replaced with the actual file name.

IDE Support

PyCharm

Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.

SDK Example Usage

Example

# Synchronous Example
from pumble_keys import PumbleSDK


with PumbleSDK(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as pumble_sdk:

    res = pumble_sdk.channels.list_channels()

    # Handle response
    print(res)

The same SDK client can also be used to make asynchronous requests by importing asyncio.

# Asynchronous Example
import asyncio
from pumble_keys import PumbleSDK

async def main():

    async with PumbleSDK(
        api_key_auth="<YOUR_API_KEY_HERE>",
    ) as pumble_sdk:

        res = await pumble_sdk.channels.list_channels_async()

        # Handle response
        print(res)

asyncio.run(main())

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
api_key_auth apiKey API key

To authenticate with the API the api_key_auth parameter must be set when initializing the SDK client instance. For example:

from pumble_keys import PumbleSDK


with PumbleSDK(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as pumble_sdk:

    res = pumble_sdk.channels.list_channels()

    # Handle response
    print(res)

Available Resources and Operations

Available methods

Channels

Messages

ScheduledMessages

Users

Pagination

Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the returned response object will have a Next method that can be called to pull down the next group of results. If the return value of Next is None, then there are no more pages to be fetched.

Here's an example of one such pagination call:

from pumble_keys import PumbleSDK


with PumbleSDK(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as pumble_sdk:

    res = pumble_sdk.messages.fetch_thread_replies(root_message_id="cccccccccccccccccccc0001", channel_id="bbbbbbbbbbbbbbbbbbbb0001", channel="bbbbbbbbbbbbbbbbbbbb0001", cursor="bbbbbbbbbbbbbbbbbbbb0001", limit=100)

    while res is not None:
        # Handle items

        res = res.next()

Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a RetryConfig object to the call:

from pumble_keys import PumbleSDK
from pumble_keys.utils import BackoffStrategy, RetryConfig


with PumbleSDK(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as pumble_sdk:

    res = pumble_sdk.channels.list_channels(,
        RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))

    # Handle response
    print(res)

If you'd like to override the default retry strategy for all operations that support retries, you can use the retry_config optional parameter when initializing the SDK:

from pumble_keys import PumbleSDK
from pumble_keys.utils import BackoffStrategy, RetryConfig


with PumbleSDK(
    retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
    api_key_auth="<YOUR_API_KEY_HERE>",
) as pumble_sdk:

    res = pumble_sdk.channels.list_channels()

    # Handle response
    print(res)

Error Handling

PumbleSDKBaseError is the base class for all HTTP error responses. It has the following properties:

Property Type Description
err.message str Error message
err.status_code int HTTP response status code eg 404
err.headers httpx.Headers HTTP response headers
err.body str HTTP body. Can be empty string if no body is returned.
err.raw_response httpx.Response Raw HTTP response
err.data Optional. Some errors may contain structured data. See Error Classes.

Example

from pumble_keys import PumbleSDK, models


with PumbleSDK(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as pumble_sdk:
    res = None
    try:

        res = pumble_sdk.channels.list_channels()

        # Handle response
        print(res)


    except models.errors.PumbleSDKBaseError as e:
        # The base class for HTTP error responses
        print(e.message)
        print(e.status_code)
        print(e.body)
        print(e.headers)
        print(e.raw_response)

        # Depending on the method different errors may be thrown
        if isinstance(e, models.errors.LegacyError):
            print(e.data.error)  # str

Error Classes

Primary errors:

  • PumbleSDKBaseError: The base class for HTTP error responses.
    • LegacyError: Free-form error message from the request handler layer. Status code 403.
    • StructuredError: Structured validation error from the framework layer. Status code 403.
Less common errors (5)

Network errors:

Inherit from PumbleSDKBaseError:

  • ResponseValidationError: Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the cause attribute.

Server Selection

Override Server URL Per-Client

The default server can be overridden globally by passing a URL to the server_url: str optional parameter when initializing the SDK client instance. For example:

from pumble_keys import PumbleSDK


with PumbleSDK(
    server_url="https://pumble-api-keys.addons.marketplace.cake.com",
    api_key_auth="<YOUR_API_KEY_HERE>",
) as pumble_sdk:

    res = pumble_sdk.channels.list_channels()

    # Handle response
    print(res)

Custom HTTP Client

The Python SDK makes API calls using the httpx HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance. Depending on whether you are using the sync or async version of the SDK, you can pass an instance of HttpClient or AsyncHttpClient respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls. This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of httpx.Client or httpx.AsyncClient directly.

For example, you could specify a header for every request that this sdk makes as follows:

from pumble_keys import PumbleSDK
import httpx

http_client = httpx.Client(headers={"x-custom-header": "someValue"})
s = PumbleSDK(client=http_client)

or you could wrap the client with your own custom logic:

from pumble_keys import PumbleSDK
from pumble_keys.httpclient import AsyncHttpClient
import httpx

class CustomClient(AsyncHttpClient):
    client: AsyncHttpClient

    def __init__(self, client: AsyncHttpClient):
        self.client = client

    async def send(
        self,
        request: httpx.Request,
        *,
        stream: bool = False,
        auth: Union[
            httpx._types.AuthTypes, httpx._client.UseClientDefault, None
        ] = httpx.USE_CLIENT_DEFAULT,
        follow_redirects: Union[
            bool, httpx._client.UseClientDefault
        ] = httpx.USE_CLIENT_DEFAULT,
    ) -> httpx.Response:
        request.headers["Client-Level-Header"] = "added by client"

        return await self.client.send(
            request, stream=stream, auth=auth, follow_redirects=follow_redirects
        )

    def build_request(
        self,
        method: str,
        url: httpx._types.URLTypes,
        *,
        content: Optional[httpx._types.RequestContent] = None,
        data: Optional[httpx._types.RequestData] = None,
        files: Optional[httpx._types.RequestFiles] = None,
        json: Optional[Any] = None,
        params: Optional[httpx._types.QueryParamTypes] = None,
        headers: Optional[httpx._types.HeaderTypes] = None,
        cookies: Optional[httpx._types.CookieTypes] = None,
        timeout: Union[
            httpx._types.TimeoutTypes, httpx._client.UseClientDefault
        ] = httpx.USE_CLIENT_DEFAULT,
        extensions: Optional[httpx._types.RequestExtensions] = None,
    ) -> httpx.Request:
        return self.client.build_request(
            method,
            url,
            content=content,
            data=data,
            files=files,
            json=json,
            params=params,
            headers=headers,
            cookies=cookies,
            timeout=timeout,
            extensions=extensions,
        )

s = PumbleSDK(async_client=CustomClient(httpx.AsyncClient()))

Resource Management

The PumbleSDK class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a context manager and reuse it across the application.

from pumble_keys import PumbleSDK
def main():

    with PumbleSDK(
        api_key_auth="<YOUR_API_KEY_HERE>",
    ) as pumble_sdk:
        # Rest of application here...


# Or when using async:
async def amain():

    async with PumbleSDK(
        api_key_auth="<YOUR_API_KEY_HERE>",
    ) as pumble_sdk:
        # Rest of application here...

Debugging

You can setup your SDK to emit debug logs for SDK requests and responses.

You can pass your own logger class directly into your SDK.

from pumble_keys import PumbleSDK
import logging

logging.basicConfig(level=logging.DEBUG)
s = PumbleSDK(debug_logger=logging.getLogger("pumble_keys"))

Release files for pumble-keys-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pumble-keys-sdk 0.1.0
File Size Uploaded
pumble_keys_sdk-0.1.0.tar.gz 237.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pumble-keys-sdk 0.1.0
File Interpreter ABI Platform
pumble_keys_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 543.2 kB

Release files / pumble_keys_sdk-0.1.0.tar.gz

Download URL pumble_keys_sdk-0.1.0.tar.gz
Size 237.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b68d280142512c1b46e51316355ba91119fc6b78855b13992df0dd9d6e6f5d47
BLAKE2b-256 checksum
How to use checksums
d1cf48f85164312d6771c59083367f96792740937158403142278bfad3cd537f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.

Transparency log

Release files / pumble_keys_sdk-0.1.0-py3-none-any.whl

Download URL pumble_keys_sdk-0.1.0-py3-none-any.whl
Size 305.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b54bf53e177a61bf9c62959f4a1151ae82d9cbef78e68138627735f7a75350a1
BLAKE2b-256 checksum
How to use checksums
01d16c9efc259b8bc68bcb1d5370b6e74af37958d17d7d9c8e507610eacd750d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page