For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog inStart for free
  • Overview
    • Introduction
    • How it works
    • Quickstart
    • Customer showcase
  • Working with SDKs
    • Project structure
    • Adding custom code
    • Migrating to Replay
    • Capabilities
  • Generators
      • Generating an SDK
      • Publishing to PyPI
      • Configuration
      • Adding custom code
      • Dynamic authentication
      • aiohttp support
      • Changelog
      • Customer showcase
  • Reference
    • generators.yml
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
Book a demoLog inStart for free
On this page
  • Installation
  • Generated dependencies
  • CI testing
GeneratorsPython

aiohttp support

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Dynamic authentication

Next

Changelog

Every Fern-generated Python SDK ships with opt-in support for aiohttp as an async HTTP transport. When the aiohttp optional extra is installed, the generated async client uses it automatically instead of the default httpx.AsyncClient.

This matters for SDKs that make many concurrent async API calls: httpx.AsyncClient serializes DNS lookups via asyncio.getaddrinfo under heavy concurrency, while aiohttp uses its own resolver to avoid that bottleneck.

No generator configuration is required. The [aiohttp] extra, runtime auto-detection, and CI coverage are generated for every Python SDK.

Installation

SDK users opt in by installing the aiohttp extra alongside your package:

$pip install your-package[aiohttp]

Or with Poetry:

$poetry add "your-package[aiohttp]"

If a user passes a custom httpx_client to the async client constructor, auto-detection is skipped and the provided client is used as-is.

Generated dependencies

The generated pyproject.toml includes an [aiohttp] optional dependency group:

pyproject.toml
1[tool.poetry.extras]
2aiohttp = ["aiohttp", "httpx-aiohttp"]

If you define your own extras via the extras configuration option in generators.yml, the built-in aiohttp extra is preserved and merged with your custom configuration.

CI testing

The generated GitHub Actions workflow runs tests in two passes so both transport paths are covered:

  1. Standard tests without the aiohttp extra.
  2. Tests marked @pytest.mark.aiohttp with the extra installed.

To verify the aiohttp path locally:

$poetry install --extras aiohttp
$poetry run pytest -m aiohttp