Skip to main content
SDKs are in very early alpha: We’re working as hard as we can to get them into a stable state. Please bear with us as we iterate rapidly.
The AI Stats Python SDK currently provides a synchronous client for the AI Stats Gateway API.

Features

  • Typed request models generated from the OpenAPI spec.
  • Built-in helpers for chat, responses, messages, embeddings, and moderations.
  • Streaming helpers for text, responses, and messages (stream_* iterators).
  • Control-plane helpers such as models, health, providers, credits, and activity.
Some surfaces are still stubbed in the Python SDK and return a coming_soon payload (for example images, audio, video, files, batches, and generation lookup).

Quick example

from ai_stats import AIStats

client = AIStats(api_key="your-api-key")

response = client.generate_response(
    {
        "model": "openai/gpt-5-nano",
        "input": "Reply with: python sdk works",
    }
)

print(response.get("id"))

What’s included

  • AIStats client
  • chat.completions.create(...) and responses.create(...) compatibility helpers
  • Streaming iterators for text, responses, and messages
  • Generated request/response models in ai_stats.models
Last modified on February 17, 2026