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, images, audio, embeddings, moderations, files, batches, generations, and async video jobs.
  • Streaming helpers for text, responses, and messages (stream_* iterators).
  • Control-plane helpers such as models, endpoints, organisations, pricing discovery/calculation, API-key lifecycle, workspace lifecycle, current-key inspection, health, providers, credits, activity, and analytics.

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
  • Resource helpers such as client.batches, client.videos, client.files, and client.async_jobs
  • Async-job websocket URL helpers for batch and video lifecycle streams
  • Model lifecycle helpers such as get_model_deprecation_info(...) and validate_model(...)
  • Streaming iterators for text, responses, and messages
  • Generated request/response models in ai_stats.models
Last modified on May 6, 2026