Skip to content

Releases: OnlistTeam/python-sdk

v0.2.1

Choose a tag to compare

@onlist-io onlist-io released this 30 Jun 09:23

Fixed

  • Added eval_type_backport dependency for Python 3.9 compatibility. Pydantic v2 models using X | None union syntax now work correctly on Python 3.9.

Full Changelog: v0.2.0...v0.2.1

v0.2.0

Choose a tag to compare

@onlist-io onlist-io released this 30 Jun 09:21

What's New

Typed Marketplace Responses

models.list() now returns list[Model] instead of list[dict], giving full attribute access:

models = client.marketplace.models.list()
for m in models.data:
    print(m.id, m.name)  # was m["id"], m["name"]

ModelDetail and ProviderDetail now inherit from their base types instead of duplicating fields.

Rankings API

Access model and app usage leaderboards:

rankings = client.marketplace.rankings.models()
apps = client.marketplace.rankings.apps()

Context Manager Support

with Onlist() as client:
    response = client.chat.completions.create(...)
# httpx client is properly closed

async with AsyncOnlist() as client:
    response = await client.chat.completions.create(...)

Marketplace Retry

Automatic retries with exponential backoff and jitter for transient failures (408, 429, 5xx). Configurable via max_retries (default: 2).

Other Improvements

  • OPENAI_API_KEY fallback: The client reads OPENAI_API_KEY if ONLIST_API_KEY is not set, for easier migration.
  • NotFoundError: Dedicated error class for 404 responses from marketplace endpoints.

Full Changelog: v0.1.0...v0.2.0

v0.1.0

Choose a tag to compare

@onlist-io onlist-io released this 20 Jun 09:38

Onlist Python SDK v0.1.0

Initial release of the official Python SDK for Onlist.

Features

  • Onlist / AsyncOnlist clients — drop-in replacement for openai.OpenAI
  • Marketplace API: query models, providers, and pricing
  • ProviderRouting type for marketplace routing control
  • Error hierarchy: AuthenticationError, RateLimitError, ProviderError, etc.
  • Full type hints with py.typed (PEP 561)
  • 5 ready-to-run examples

Installation

pip install onlist

Quick Start

from onlist import Onlist

client = Onlist(api_key="sk-...")
response = client.chat.completions.create(
    model="anthropic/claude-sonnet-4-6",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)