Skip to main content

Official Python SDK for Zaguan CoreX

Project description

zaguan-sdk-python

Official Zaguán SDK for Python

Overview

The official Python SDK for Zaguán CoreX - an enterprise-grade AI gateway that provides unified access to 15+ AI providers and 500+ models through a single, OpenAI-compatible API.

Installation

pip install zaguan-sdk

Quick Start

Synchronous Usage

from zaguan_sdk import ZaguanClient, ChatRequest, Message

# Initialize client
client = ZaguanClient(
    base_url="https://api.zaguanai.com",
    api_key="your-api-key"
)

# Create chat request
request = ChatRequest(
    model="openai/gpt-4o-mini",
    messages=[
        Message(role="user", content="Hello! How are you?")
    ]
)

# Make request
response = client.chat(request)

# Print response
print(response.choices[0].message.content)

Asynchronous Usage

import asyncio
from zaguan_sdk import AsyncZaguanClient, ChatRequest, Message

async def main():
    # Initialize client
    client = AsyncZaguanClient(
        base_url="https://api.zaguanai.com",
        api_key="your-api-key"
    )

    # Create chat request
    request = ChatRequest(
        model="openai/gpt-4o-mini",
        messages=[
            Message(role="user", content="Hello! How are you?")
        ]
    )

    # Make request
    response = await client.chat(request)

    # Print response
    print(response.choices[0].message.content)

asyncio.run(main())

Features

  • Synchronous and Asynchronous Clients: Support for both sync and async usage patterns
  • OpenAI Compatibility: Drop-in replacement for OpenAI SDK with additional features
  • Multi-Provider Support: Access to 15+ AI providers through a single API
  • Streaming Support: Real-time response streaming with cancellation support
  • Error Handling: Comprehensive error handling with specific exception types
  • Type Safety: Full type hints and Pydantic models for all API objects
  • Credits Management: Access to credits balance, history, and statistics
  • Embeddings: Create embeddings for semantic search and RAG
  • Audio: Transcription, translation, and text-to-speech (Whisper, TTS)
  • Images: Generation, editing, and variations (DALL-E)
  • Moderations: Content safety and policy compliance checking

Supported Endpoints

✅ Chat Completions (streaming & non-streaming)
✅ Models & Capabilities
✅ Credits Management
✅ Embeddings
✅ Audio (Transcription, Translation, Speech)
✅ Images (Generation, Editing, Variations)
✅ Content Moderation

100% coverage of major OpenAI-compatible endpoints

Documentation

For detailed documentation, see the files in the docs/SDK directory:

Development

Installation

pip install -r requirements.txt

Running Tests

python -m pytest tests/ -v

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zaguan_sdk-0.1.0.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zaguan_sdk-0.1.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file zaguan_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: zaguan_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zaguan_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a15333ad52efe16f73d4cf020fa288241cc7e2bfebcdbef83f1ceff9103dacf4
MD5 e5c7a92dfc2ed01e1a616083f4bc65ba
BLAKE2b-256 a3cacb959cf2bdc46d00841ed85dd4173a071717bff60989604394197ed99955

See more details on using hashes here.

File details

Details for the file zaguan_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zaguan_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zaguan_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97851c6d264662b9470ada3bff27b17e24900f0c9c10cc6a8c6450569a9887f4
MD5 179a0f3e3f14438be68d1d4f9a7705e0
BLAKE2b-256 1b72e75a71ac541f6079697987183e04b3968b310b04a3a501458a40f978e301

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page