Async Python SDK for the Fanvue API, generated from Fanvue's official API reference (.mdx) endpoints.
- Fully async (
httpx.AsyncClient) - Generated resource methods for all documented API reference endpoints
- Generated Pydantic response models for endpoint payloads
- No SDK-side fallback values injected into API response payloads
- OAuth handled externally (pass token/header/provider)
- Python
>=3.11
pip install fanvue-python-sdkFor development tools:
pip install -e .[dev]import asyncio
from fanvue_sdk import FanvueAsyncClient
async def main() -> None:
async with FanvueAsyncClient(
api_version="2025-06-26",
access_token="<oauth-access-token>",
) as client:
me = await client.users.get_current_user()
print(type(me).__name__)
print(me.email)
print(me.model_dump())
if __name__ == "__main__":
asyncio.run(main())OAuth flow/token management is external. Provide exactly one of:
access_token(SDK sendsAuthorization: Bearer <token>)authorization_header(full header value)auth_header_provider(sync or async callable returning header value)
The SDK always sends X-Fanvue-API-Version using the api_version you pass.
The generated client exposes these resources:
userschatschat_messageschat_templateschat_smart_listschat_custom_listschat_custom_list_memberspostscreatorsinsightsmediatracking_linksvaultagencies
A generated operation index is available in docs-endpoints.md.
- Operation methods live in
fanvue_sdk/resources/*.py(exposed asclient.<resource>.<operation>(...)). - Response models are generated in
fanvue_sdk/models.py. - Each method returns a typed Pydantic response model (or
Nonefor 204 endpoints).
Example:
me = await client.users.get_current_user()
print(me.displayName)
payload = me.model_dump() # reuse this for external APIsThe SDK code is generated from Fanvue's official docs listing:
- index:
https://api.fanvue.com/docs/llms.txt - endpoint pages:
https://api.fanvue.com/docs/api-reference/reference/.../*.mdx
Regenerate operations and resources:
python3 scripts/generate_sdk.pyGenerated files:
fanvue_sdk/_operations.pyfanvue_sdk/models.pyfanvue_sdk/resources/*.py(exceptbase.py)fanvue_sdk/resources/__init__.pydocs-endpoints.md
Build and run tests:
docker compose up --buildOr run with plain Docker:
docker build -t fanvue-python-sdk .
docker run --rm fanvue-python-sdkruff check .
mypy
pytest