Skip to main content
PyPI version The TopK Python library provides convenient access to the TopK API from any Python 3.9+ application. The library includes type definitions for all request params and response fields, and features both synchronous and asynchronous clients.

Installation

Building with a coding agent

Using Claude Code, Cursor, Codex, or another coding agent? Install the TopK skill so the agent writes correct TopK code. It covers schema design, chunking, hybrid queries, multi-tenancy, and the common mistakes.

Prerequisites

Usage

Async usage

Simply import AsyncClient instead of Client and use async for / await with each API call:

Handling errors

Retries

The client automatically retries transient errors (server unavailable, network failures) and LSN consistency timeouts. Retry behaviour can be configured via RetryConfig:

Requirements

Python 3.9 or higher.