SDKs

Official Zaguan SDKs

Build AI applications with production-ready SDKs for Python, TypeScript, and Go. Each SDK provides type-safe, OpenAI-compatible interfaces with unified access to 15+ AI providers through a single API.

Why Use Zaguan SDKs?

OpenAI Compatible

Drop-in replacement for OpenAI SDKs with familiar interfaces and minimal code changes.

Multi-Provider Access

Unified access to 15+ AI providers including OpenAI, Anthropic, Google, DeepSeek, and more.

Production Ready

Built-in error handling, retries, timeouts, and comprehensive test coverage.

Type Safe

Full type definitions and validation for better developer experience and fewer runtime errors.

Available SDKs

🐍

Python SDK

v0.1.0zaguan-sdk

Official Python SDK with sync & async support, full type hints, and comprehensive API coverage.

Installation

pip install zaguan-sdk

Quick Start

from zaguan_sdk import ZaguanClient, ChatRequest, Message

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

response = client.chat(ChatRequest(
    model="openai/gpt-4o-mini",
    messages=[Message(role="user", content="Hello!")]
))

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

Key Features

Sync & async clients (ZaguanClient & AsyncZaguanClient)
Full type hints with Pydantic validation
Streaming support with cancellation
Complete OpenAI API coverage
Audio processing (Whisper, TTS)
Image generation (DALL-E)
Embeddings & content moderation
Credits tracking & usage analytics
📘

TypeScript SDK

v1.2.0@zaguan_ai/sdk

Official TypeScript SDK with full type safety, streaming support, and comprehensive OpenAI API coverage.

Installation

npm install @zaguan_ai/sdk

Quick Start

import { ZaguanClient } from '@zaguan_ai/sdk';

const client = new ZaguanClient({
  baseUrl: 'https://api.zaguanai.com/',
  apiKey: 'your-api-key',
});

const response = await client.chat({
  model: 'openai/gpt-4o-mini',
  messages: [{ role: 'user', content: 'Hello!' }],
});

console.log(response.choices[0].message.content);

Key Features

Full TypeScript type definitions
Async/await & streaming support
OpenAI-compatible interface
Audio processing (transcription, TTS)
Image generation & editing
Batch processing & Assistants API
Fine-tuning support
Retry logic with exponential backoff
🔷

Go SDK

v0.2.0github.com/ZaguanLabs/zaguan-sdk-go

Official Go SDK with idiomatic patterns, full type safety, and production-ready features.

Installation

go get github.com/ZaguanLabs/zaguan-sdk-go/sdk

Quick Start

package main

import (
    "context"
    "fmt"
    zaguansdk "github.com/ZaguanLabs/zaguan-sdk-go/sdk"
)

func main() {
    client := zaguansdk.NewClient(zaguansdk.Config{
        BaseURL: "https://api.zaguanai.com",
        APIKey:  "your-api-key",
    })
    
    resp, _ := client.Chat(context.Background(), 
        zaguansdk.ChatRequest{
            Model: "openai/gpt-4o-mini",
            Messages: []zaguansdk.Message{
                {Role: "user", Content: "Hello!"},
            },
        }, nil)
    
    fmt.Println(resp.Choices[0].Message.Content)
}

Key Features

Idiomatic Go with context.Context
Full type safety with structs
OpenAI & Anthropic native support
Streaming with SSE
Credits tracking & analytics
Provider-specific extensions
Zero dependencies (stdlib + uuid)
63% test coverage with 221 tests

Getting Started

  1. Get your API key: Sign up at zaguanai.com and obtain your API key from the dashboard.
  2. Install the SDK: Choose your preferred language and install the SDK using the package manager (pip, npm, or go get).
  3. Initialize the client: Create a client instance with your API key and the Zaguan API endpoint.
  4. Make your first request: Use the chat completion endpoint to interact with any of the 15+ supported AI providers.
  5. Explore advanced features: Check out streaming, function calling, vision, audio processing, and provider-specific capabilities.

Need Help?

Each SDK has comprehensive documentation, examples, and test coverage. Check the individual SDK documentation pages for detailed guides, API references, and troubleshooting tips.