Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ai-stats.phaseo.app/llms.txt

Use this file to discover all available pages before exploring further.

Use this page when your first real AI Stats integration lives in Python and you want a practical starting point for a CLI, worker, or backend service.

Build a Python gateway CLI around AI Stats routes.

CursorOpen in Cursor

Sample project

What this app does

  • supports control routes like:
    • GET /v1/health
    • GET /v1/models
    • GET /v1/providers
  • supports generation routes like:
    • POST /v1/responses
    • POST /v1/chat/completions
    • POST /v1/embeddings
    • and several additional endpoints

Why this sample is useful

It gives you:
  • a Python-first reference without third-party dependencies
  • explicit request payloads and response handling
  • a practical pattern for workers, scripts, and internal tools

Run the sample

cd examples/gateway-python-quickstart
cp .env.example .env.local
Set:
  • AI_STATS_API_KEY
Then try:
python quickstart.py smoke
python quickstart.py responses --prompt "Return exactly: integration_ok"
python quickstart.py --help

What to look at in the code

  • how the environment is loaded
  • how the CLI dispatches commands
  • how different request payloads are built
  • how async video and music routes are handled separately from one-shot text routes

How to make it your own

  • strip it down to only the endpoints your service needs
  • keep one shared request helper instead of duplicating headers everywhere
  • switch to the Python SDK later if you want a higher-level client
Last modified on May 19, 2026