Skip to main content

autumn-sdk

The official Python SDK for the Autumn billing API.

PyPI version License: Apache-2.0

Summary

Table of Contents

SDK Installation

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 git+<UNSET>.git

PIP

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

pip install git+<UNSET>.git

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 git+<UNSET>.git

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 autumn-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 = [
#     "autumn-sdk",
# ]
# ///

from autumn_sdk import Autumn

sdk = Autumn(
  # 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 autumn_sdk import Autumn


with Autumn(
    x_api_version="2.6.0",
    secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:

    res = autumn.check(customer_id="cus_123", feature_id="messages")

    # Handle response
    print(res)

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

# Asynchronous Example
import asyncio
from autumn_sdk import Autumn

async def main():

    async with Autumn(
        x_api_version="2.6.0",
        secret_key="<YOUR_BEARER_TOKEN_HERE>",
    ) as autumn:

        res = await autumn.check_async(customer_id="cus_123", feature_id="messages")

        # Handle response
        print(res)

asyncio.run(main())

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
secret_key http HTTP Bearer

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

from autumn_sdk import Autumn


with Autumn(
    secret_key="<YOUR_BEARER_TOKEN_HERE>",
    x_api_version="2.6.0",
) as autumn:

    res = autumn.check(customer_id="cus_123", feature_id="messages")

    # Handle response
    print(res)

Available Resources and Operations

Available methods

Autumn SDK

  • check - Checks whether a customer currently has enough balance to use a feature.

Use this to gate access before a feature action. Enable sendEvent when you want to check and consume balance atomically in one request.

  • track - Records usage for a customer feature. Queued by default; pass async: false to apply it before responding with updated balances.

Use this after an action happens to decrement usage, or send a negative value to credit balance back.

  • track_tokens - Records AI token usage for a customer and returns the updated AI credit balance.

Use this after an LLM request when you have input and output token counts. Autumn converts token usage to a dollar amount using the configured model pricing and markup, then tracks that value against the customer's AI credit system.

  • batch_track - Enqueue up to 1000 usage events for asynchronous processing. Items are validated synchronously up front; validated items are then enqueued via SQS for background deduction by workers. The response returns 200 (or 202) immediately and does not include balance information. On partial enqueue failure (some items fail to enqueue, others succeed), the endpoint still returns 200 (or 202) and logs the failures server-side; clients should NOT retry, because retrying re-enqueues the already-succeeded items. A 503 is returned only when zero items were successfully enqueued (queue entirely unavailable) — that case is safe to retry.

Accounts

  • get - Gets an account: a group of customers that belong to the same business. Look it up by its account_id, or by the customer_id of any customer linked to it. Accounts only organize customers — each customer keeps its own plans, billing and Stripe customer.
  • update - Updates an account's name or ID, and links or unlinks customers. Account IDs are optional and only ever set by you. A customer belongs to at most one account. Look the account up by account_id or by any linked customer's customer_id; when that customer has no account yet, linking customers to it creates one. Linking a customer that is already in another account fails unless you pass move: true. Removing the last customer deletes the account and returns null.

Analytics

  • query - Query data in SQL

ApprovalRules

  • list - Lists the organization's approval rules, oldest first. Every member and key can read rules. For each request, only the most specific level with a rule for that person decides (user, then role, then everyone), and every rule at that level must pass.
  • get - Gets one approval rule by ID.
  • create - Creates an approval rule as version 1. allow is true (always allowed), false (never allowed) or an object of conditions that must all match. Problems with the rule come back as invalid_approval_rule with every issue under details.issues. Rules apply in live only. Only owners and admins (an OAuth token also needs organisation:write consent) and live secret keys with every scope can call it. Anyone else, whatever their scopes and including any sandbox key, gets 403 approval_rule_editor_required.
  • update - Updates the fields you pass and saves the rule as its next version. The whole rule is checked again, so changing actions re-checks the conditions in allow. Sending allow replaces it, so switching between true, false and conditions is one field. Only owners and admins (an OAuth token also needs organisation:write consent) and live secret keys with every scope can call it. Anyone else, whatever their scopes and including any sandbox key, gets 403 approval_rule_editor_required.
  • delete - Deletes an approval rule. Its versions stay readable through approval_rules.versions.list. Only owners and admins (an OAuth token also needs organisation:write consent) and live secret keys with every scope can call it. Anyone else, whatever their scopes and including any sandbox key, gets 403 approval_rule_editor_required.
  • list_versions - Lists a rule's saved versions, newest first, including after the rule is deleted.
  • can - Says whether the caller could make some request for an action: scope when their scope allows it and no rule rules it out, blocked when a rule never allows it, and none when they lack the action's scope. A conditional rule can still deny a given request; preview it to see. Alias actions such as billing.multi_attach are read as the action they're checked as.

Balances

  • create - Create a balance for a customer feature.
  • list - Lists individual balances (one row per grant) across customers, live or expired: plan balances, standalone balances, top-ups, and pooled balances. Pages may hold fewer than limit rows while has_more is true.
  • list_ledger - Lists what changed one customer's balance of a feature, newest first: plan changes, resets, updates, and tracks grouped per UTC day. Each entry says why, who made it, and the balance before and after. coverage says whether history is being recorded for the customer and since when.
  • aggregate_ledger - Returns a customer's balance of a feature at each UTC hour or day of a range, and at each change other than a track, for charting it over time.
  • count_ledger - Counts the entries of each type that balances.list_ledger lists for one customer's balance of a feature over a range, for showing beside a filter by type.
  • update - Update a customer balance.
  • delete - Delete a balance for a customer feature. Can only delete a balance that is not attached to a price (eg. you cannot delete messages that have an overage price).
  • finalize - Finalize a previously locked balance. Use 'confirm' to commit the deduction, or 'release' to return the held balance.

Billing

  • attach - Attaches a plan to a customer. Handles new subscriptions, upgrades and downgrades.

Use this endpoint to subscribe a customer to a plan, upgrade/downgrade between plans, or add an add-on product.

  • create_schedule - Creates a multi-phase subscription schedule for a customer. The first phase starts immediately and subsequent phases automatically transition at their scheduled start times.

Use this endpoint to schedule future plan changes (e.g. switch from a trial plan to a paid plan on a specific date) or to define a sequence of plans that should activate over time.

  • multi_attach - Attaches multiple plans to a customer in a single request. Creates a single Stripe subscription with all plans consolidated.

Use this endpoint when you need to subscribe a customer to multiple plans at once, such as a base plan plus add-ons, or to create a bundle of products.

  • preview_attach - Previews the billing changes that would occur when attaching a plan, without actually making any changes.

Use this endpoint to show customers what they will be charged before confirming a subscription change.

  • preview_multi_attach - Previews the billing changes that would occur when attaching multiple plans, without actually making any changes.

Use this endpoint to show customers what they will be charged before confirming a multi-plan subscription.

  • update - Updates an existing subscription. Use to modify feature quantities, cancel, or change plan configuration.

Use this endpoint to update prepaid quantities, cancel a subscription (immediately or at end of cycle), or modify subscription settings.

  • preview_update - Previews the billing changes that would occur when updating a subscription, without actually making any changes.

Use this endpoint to show customers prorated charges or refunds before confirming subscription modifications.

  • multi_update - Updates multiple plans on a customer in a single request. Currently supports cancel actions (immediately, end of cycle, or uncancel) across one or more subscriptions.

Use this endpoint to cancel or uncancel several plans atomically in one call — for example canceling a main plan together with its add-ons, or plans across multiple entities.

  • preview_multi_update - Previews the billing changes of a multi-plan update without making any changes. Returns one core preview per affected subscription.

Use this endpoint to show customers the credits and next-cycle changes of canceling multiple plans before confirming.

  • open_customer_portal - Create a billing portal session for a customer to manage their subscription.
  • setup_payment - Create a payment setup session for a customer to add or update their payment method.
  • transfer - Moves one of a customer's plans between entities, or between an entity and the customer. Nothing is charged or refunded.
  • verify - Checks a customer's Stripe subscriptions against Autumn's record of their plans and reports any drift. Read-only: it never changes Autumn or Stripe.

Use this endpoint to audit that a customer's Stripe subscriptions, items, quantities, prices, schedules and cancellation state match what Autumn expects, for example after a migration or a manual change in Stripe.

Customers

  • get_or_create - Creates a customer if they do not exist, or returns the existing customer by your external customer ID.

Use this as the primary entrypoint before billing operations so the customer record is always present and up to date.

  • get - Fetches a customer by ID, optionally expanding related data such as invoices or entities.

Use this when you know the customer exists or assert they exist without creating them.

  • list - Lists customers with cursor pagination and optional filters. Pass start_cursor: "" (or omit) for the first page; use next_cursor from a prior response for subsequent pages.
  • update - Updates an existing customer by ID.
  • delete - Deletes a customer by ID.
  • swap - Atomically exchanges the IDs of two customers. Plans, entities, balances and payment-processor links stay with each underlying customer, so afterwards each ID owns what the other ID had.
  • advance_test_clock - Advance a customer's Stripe test clock to a future time in milliseconds. Only Stripe test-mode customers with a test clock are supported. Advancement is asynchronous; Stripe enforces clock status and advancement limits.
  • list_subscriptions - Lists recurring plans (including add-ons) across customers, live or expired. Filter by customer, entity, plan, or status. Pages may hold fewer than limit rows while has_more is true.
  • list_purchases - Lists one-off plan purchases across customers, live or expired. Filter by customer, entity, plan, or status. Pages may hold fewer than limit rows while has_more is true.

Entities

  • create - Creates an entity for a customer and feature, then returns the entity with balances and subscriptions.

Use entities when usage and access must be scoped to sub-resources (for example seats, projects, or workspaces) instead of only the customer.

  • get - Fetches an entity by its ID.

Use this to read one entity's current state. Pass customerId when you want to scope the lookup to a specific customer.

  • list - Lists entities across the organization with pagination and optional filters.

Use this to page through entities globally, including filtering by plans inherited from parent customers or attached directly to entities.

  • update - Updates an existing entity and returns the refreshed entity object.

Use this to change entity billing controls or other mutable entity fields after the entity has already been created.

  • delete - Deletes an entity by entity ID.

Use this when the underlying resource is removed and you no longer want entity-scoped balances or subscriptions tracked for it.

Events

  • list - List usage events for your organization. Filter by customer, feature, or time range.
  • aggregate - Aggregate usage events by time period. Returns usage totals grouped by feature and optionally by a custom property.
  • query - Query events in SQL

Features

  • create - Creates a new feature.

Use this to programmatically create features for metering usage, managing access, or building credit systems.

  • get - Retrieves a single feature by its ID.

Use this when you need to fetch the details of a specific feature.

  • list - Lists all features in the current environment.

Use this to retrieve all features configured for your organization to display in dashboards or for feature management.

  • update - Updates an existing feature.

Use this to modify feature properties like name, display settings, or to archive a feature.

  • delete - Deletes a feature by its ID.

Use this to permanently remove a feature. Note: features that are used in products cannot be deleted - archive them instead.

Invoices

  • create - Creates a standalone send-invoice Stripe invoice from catalog pricing and custom charges. Quantities are billable units, exclusive of any included usage; Autumn applies billing units and tiers. Nothing about the customer's plans, balances or subscriptions changes. Pass preview: true to get the calculated lines and totals without creating an invoice.
  • finalize - Finalizes a draft Stripe invoice, such as one left in draft by invoice mode with finalize set to false. Stripe then collects it: a send-invoice invoice is emailed and an automatically-charged one is charged. Any plan still waiting on the invoice to be paid expires at its due date. Already open or paid invoices are returned unchanged.
  • insert - Inserts or updates up to 500 historical invoices without reading or mutating the billing processor.
  • list - Lists invoices with cursor pagination and optional filters (customer, entity, status, processor). Pass start_cursor: "" (or omit) for the first page; use next_cursor from a prior response for subsequent pages.
  • list_templates - Lists the organization's invoice templates, newest first, with offset pagination. Use a template's id as invoice_template_id when creating or reissuing an invoice.
  • pay - Marks an open Stripe invoice as paid out of band. No charge is attempted; use this when payment was collected elsewhere (e.g. a marketplace). Already-paid invoices are returned unchanged.
  • issue_credit_note - Issues a Stripe credit note against an open or paid invoice, for a flat amount or for specific invoice lines. On an open invoice the credit reduces what is still owed. On a paid invoice the credited money goes to the chosen destination: the customer's balance (default), a refund, or a record of money returned outside Stripe. Line amounts are pre-discount and pre-tax, like the invoice's own item amounts. Pass preview to see the credit note without issuing it.
  • reissue - Voids an open send-invoice Stripe invoice and issues a replacement with the same line items. An invoice template can supply the replacement's footer (e.g. bank details) and memo. The replacement keeps the original due date unless net_terms_days is passed, which is required once the original is past due. Pass update_customer_email to change the customer's billing email first so the replacement is sent there. The replacement stays linked to the same subscription and fulfils the same pending plan when paid.
  • update - Changes which payment methods a draft or open Stripe invoice accepts. The customer sees the change on the hosted invoice page straight away.
  • void - Voids a draft, open or uncollectible Stripe invoice. A draft is retired without charging or emailing the customer: a one-off draft is deleted from Stripe, and a subscription draft is finalized without collection and then voided. Any plan still waiting on the invoice to be paid expires. Voiding an unpaid subscription invoice lets Stripe re-derive the subscription status from its remaining invoices, which can move a past-due subscription back to active. Already-void invoices are returned unchanged.

Keys

  • mint - Mints a per-customer token (a scoped am_jwt_ credential) so a downstream / self-hosted app can call Autumn directly without your secret key. Returns a short-lived access token plus a rotating refresh token, both bound to the given customer. Authenticated with your secret key.
  • refresh - Exchanges a refresh token (sent as the Bearer credential) for a freshly rotated access + refresh pair. Self-service for the token holder — no secret key required. The previous refresh token is honored for one rotation as a grace window; replaying an older one revokes the customer's tokens.
  • revoke - Revokes every outstanding token (access and refresh) for a customer. Authenticated with your secret key. New tokens can be issued afterwards with keys.mint.

Licenses

  • attach - Assigns licenses to one or more entities.
  • release - Releases licenses assigned to one or more entities.

Logs

  • search - Search API requests and incoming Stripe webhooks for your organization and environment.

Plans

Platform

  • get_stripe_connection - Read a managed organization's Stripe OAuth connection, account ID, and authorization time in the selected environment.
  • disconnect_stripe - Revoke Autumn's Stripe OAuth access for a managed organization in the selected environment. Does not delete the Stripe account or cancel subscriptions.
  • link_revenue_cat - Generate a RevenueCat OAuth URL for linking a project to an organization.
  • sync_revenue_cat - Push an organization's plans into RevenueCat as products (creating or renaming them across the project's apps) and set test-store prices from each plan's price. Requires the org to have linked RevenueCat via OAuth.
  • get_revenue_cat_keys - Retrieve a managed organization's RevenueCat public (SDK) API keys, grouped by app — for the test store, App Store, and Google Play Store. Use these to configure the RevenueCat SDK in the org's mobile app.

Referrals

  • create_code - Create or fetch a referral code for a customer in a referral program.
  • redeem_code - Redeem a referral code for a customer.
  • create_program - Create a referral program linked to an existing reward.
  • list_programs - List the referral programs configured for the org.
  • get_program - Fetch a referral program by ID.
  • update_program - Update a referral program. Omitted fields keep their current value.
  • delete_program - Delete a referral program.

Rewards

  • create - Create a coupon or feature grant.
  • list - List the coupons and feature grants configured for the org.
  • get - Fetch a coupon or feature grant by ID.
  • update - Update a coupon or feature grant. Omitted fields keep their current value.
  • delete - Delete a coupon or feature grant.
  • redeem_code - Redeem a reward promo code for a customer.

Sandboxes

  • create - Creates a sandbox: an isolated copy of your organization with its own catalog, customers and secret key. Returns the sandbox's secret key once, in this response — store it, it cannot be read back. Authenticated with your organization's secret key (a sandbox's own key cannot create sandboxes). Autumn creates a new Stripe test account for each sandbox; if your organization has automatic tax on, pass stripe.head_office so Stripe can calculate tax there straight away.
  • list - Lists every sandbox belonging to your organization, newest first. Secret keys are never returned here — only sandboxes.create shows one.
  • delete - Permanently deletes a sandbox and everything inside it: its catalog, customers and secret key. Cannot be undone.
  • reset - Wipes every customer, plan, feature and migration draft in the sandbox the calling key belongs to, leaving the sandbox itself, its secret keys and its settings in place. There is no id to pass: a sandbox's own key resets that sandbox, and an organization's test-mode key resets its default sandbox environment. Refused for live keys — only sandboxes can be reset. Cannot be undone.

Webhooks

  • create - Creates a webhook: a URL Autumn sends the listed events to, in the environment of the calling key. You choose the id, and it can't be changed later. Returns the signing secret once, in this response — store it, it cannot be read back.
  • get - Gets one webhook by ID. The signing secret is never returned here — only webhooks.create and webhooks.sync show one, when they create the webhook.
  • list - Lists every webhook in the environment of the calling key, including ones made in the dashboard (these show their ep_… ID).
  • update - Updates a webhook's URL, events, description or disabled state. Only the fields you pass change. The ID can't be changed — to rename, create a new webhook.
  • delete - Permanently deletes a webhook. Autumn stops sending it events immediately. Cannot be undone.
  • preview_sync - Shows what webhooks.sync would do with the same body, without changing anything: which webhooks it would create, update or delete, and which existing ones it would leave alone because the body doesn't list them.
  • sync - Makes the listed webhooks exist as described: creates missing ones and updates ones that differ. Webhooks not listed are left alone, unless skip_deletions is false: then every webhook not listed is deleted, including ones made in the dashboard. Returns the signing secret of each webhook it created, once. Each webhook is applied on its own: failures are listed in errors while the rest still apply, and the request fails only when none could be applied.

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 autumn_sdk import Autumn
from autumn_sdk.utils import BackoffStrategy, RetryConfig


with Autumn(
    x_api_version="2.6.0",
    secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:

    res = autumn.check(customer_id="cus_123", feature_id="messages",
        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 autumn_sdk import Autumn
from autumn_sdk.utils import BackoffStrategy, RetryConfig


with Autumn(
    retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
    x_api_version="2.6.0",
    secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:

    res = autumn.check(customer_id="cus_123", feature_id="messages")

    # Handle response
    print(res)

Error Handling

AutumnError 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

Example

from autumn_sdk import Autumn, errors


with Autumn(
    x_api_version="2.6.0",
    secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
    res = None
    try:

        res = autumn.check(customer_id="cus_123", feature_id="messages")

        # Handle response
        print(res)


    except errors.AutumnError 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)

Error Classes

Primary error:

  • AutumnError: The base class for HTTP error responses.
Less common errors (5)

Network errors:

Inherit from AutumnError:

  • 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 autumn_sdk import Autumn


with Autumn(
    server_url="https://api.useautumn.com",
    x_api_version="2.6.0",
    secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:

    res = autumn.check(customer_id="cus_123", feature_id="messages")

    # 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 autumn_sdk import Autumn
import httpx

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

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

from autumn_sdk import Autumn
from autumn_sdk.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 = Autumn(async_client=CustomClient(httpx.AsyncClient()))

Resource Management

The Autumn 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 autumn_sdk import Autumn
def main():

    with Autumn(
        x_api_version="2.6.0",
        secret_key="<YOUR_BEARER_TOKEN_HERE>",
    ) as autumn:
        # Rest of application here...


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

    async with Autumn(
        x_api_version="2.6.0",
        secret_key="<YOUR_BEARER_TOKEN_HERE>",
    ) as autumn:
        # 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 autumn_sdk import Autumn
import logging

logging.basicConfig(level=logging.DEBUG)
s = Autumn(debug_logger=logging.getLogger("autumn_sdk"))

Development

Contributions

We welcome contributions! Feel free to open a PR or an issue on the Autumn GitHub repository.

Metadata

Release files for autumn-sdk 1.3.1

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

Source distribution (sdist)

Source distribution for autumn-sdk 1.3.1
File Size Uploaded Provenance Actions
autumn_sdk-1.3.1.tar.gz 1.1 MB Without provenance Details for autumn_sdk-1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for autumn-sdk 1.3.1
File Interpreter ABI Platform Actions
autumn_sdk-1.3.1-py3-none-any.whl Python 3 none any Details for autumn_sdk-1.3.1-py3-none-any.whl

Total release size: 2.3 MB

Release files / autumn_sdk-1.3.1.tar.gz

Download URL autumn_sdk-1.3.1.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
12be40374518428f72e2c286ed7a71c18f4d3d452ffc8d333c45273c5742ec45
BLAKE2b-256 checksum
How to use checksums
199ff1394aeb1b9f6aeb95e53f3a9090a1fda16403e5a59e42e4a3fbb8ec01be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / autumn_sdk-1.3.1-py3-none-any.whl

Download URL autumn_sdk-1.3.1-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ca8e139df2d263e4ba1d21cb3718f9f5d5c58ed1abf51d0386a974a723de5849
BLAKE2b-256 checksum
How to use checksums
a2afd040e2a958262d8e155d9bf5e833bb831ec1d3d42a762157bbaf9414f68d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Security for autumn-sdk 1.3.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.1 This release

2 release files No provenance

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