> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sudoapp.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Official SDK for the Sudo AI platform - developer-friendly, type-safe, and feature-complete

The official SDK for Sudo provides a developer-friendly and type-safe way to integrate with the Sudo AI platform. Available in both Python and TypeScript, it offers comprehensive support for all Sudo features including AI responses with streaming, tool calling, structured outputs, and more.

## Key Features

<CardGroup cols={2}>
  <Card title="🚀 Easy to Use" icon="rocket">
    Simple installation with pip, npm, or your preferred package manager. Get started in minutes with intuitive APIs.
  </Card>

  <Card title="⚡ High Performance" icon="bolt">
    Built-in connection pooling, retry logic, and async support for optimal performance.
  </Card>

  <Card title="🔄 Streaming Support" icon="stream">
    Server-sent events for real-time streaming responses with proper context management.
  </Card>

  <Card title="🛠️ Tool Calling" icon="wrench">
    Native support for function calling and parallel tool execution.
  </Card>

  <Card title="📊 Structured Output" icon="chart-bar">
    JSON schema validation and structured data extraction capabilities.
  </Card>

  <Card title="🖼️ Multimodal" icon="image">
    Support for images, audio, and other modalities beyond text.
  </Card>
</CardGroup>

## Quick Start

<CodeGroup dropdown>
  ```typescript TypeScript theme={null}
  import { Sudo } from "sudo-ai";

  const sudo = new Sudo({
    serverURL: "https://sudoapp.dev/api",
    apiKey: process.env.SUDO_API_KEY ?? "",
  });

  async function main() {
    const response = await sudo.router.create({
      model: "claude-sonnet-4-20250514",
      messages: [
        { role: "user", content: "Hello! How are you?" }
      ]
    });
    
    console.log(response.choices[0].message.content);
  }

  main();
  ```

  ```python Python theme={null}
  import os
  from sudo import Sudo

  # Initialize the client
  with Sudo(
      server_url="https://sudoapp.dev/api",
      api_key=os.getenv("SUDO_API_KEY"),
  ) as client:
      # Create a chat completion
      response = client.router.create(
          model="claude-sonnet-4-20250514",
          messages=[
              {"role": "user", "content": "Hello! How are you?"}
          ]
      )
      
      print(response.choices[0].message.content)
  ```
</CodeGroup>

## Documentation Sections

<CardGroup cols={2}>
  <Card title="Installation & Setup" icon="download" href="/sdk/sudo-sdk/installation">
    Get started with installation, authentication, and basic configuration.
  </Card>

  <Card title="System Endpoints" icon="server" href="/sdk/sudo-sdk/system-endpoints">
    Health checks and model information endpoints.
  </Card>

  <Card title="Chat Completion" icon="comment" href="/sdk/sudo-sdk/ai-responses">
    Basic AI responses with various models and parameters.
  </Card>

  <Card title="Streaming" icon="stream" href="/sdk/sudo-sdk/streaming">
    Real-time streaming responses with server-sent events.
  </Card>

  <Card title="Tool Calling" icon="wrench" href="/sdk/sudo-sdk/tool-calling">
    Function calling and tool execution capabilities.
  </Card>

  <Card title="Structured Output" icon="code" href="/sdk/sudo-sdk/structured-output">
    JSON schema validation and structured data extraction.
  </Card>

  <Card title="Image Input" icon="image" href="/sdk/sudo-sdk/image-input">
    Working with images and multimodal inputs.
  </Card>

  <Card title="Image Generation" icon="image" href="/sdk/sudo-sdk/image-generation">
    Generate images with multiple providers and formats.
  </Card>

  <Card title="Audio Chat Completions" icon="speaker" href="/sdk/sudo-sdk/audio_chat_completions">
    Add audio input and output to Chat Completions.
  </Card>

  <Card title="Reasoning" icon="brain" href="/sdk/sudo-sdk/reasoning">
    Advanced reasoning capabilities with o1 models.
  </Card>

  <Card title="CRUD Operations" icon="database" href="/sdk/sudo-sdk/crud-operations">
    Managing stored Chat Completions (OpenAI only).
  </Card>
</CardGroup>

## SDK Benefits

### Type Safety

Both SDKs are fully typed - Python with Pydantic models and TypeScript with native types, providing excellent IDE support and compile-time error checking.

### Error Handling

Comprehensive error handling with specific error types and detailed error information in both languages.

### Resource Management

Automatic connection pooling and resource cleanup with context manager support (Python) and proper resource management (TypeScript).

### Performance

Built-in retry logic, connection reuse, and async support for high-performance applications in both languages.

## Next Steps

1. **[Install the SDK](/sdk/sudo-sdk/installation)** - Get started with installation and setup
2. **[Try Chat Completion](/sdk/sudo-sdk/ai-responses)** - Create your first AI response
3. **[Explore Streaming](/sdk/sudo-sdk/streaming)** - Add real-time capabilities
4. **[Advanced Features](/sdk/sudo-sdk/tool-calling)** - Tool calling, structured output, and more

<Note>
  The Sudo SDK follows semantic versioning in both languages. For Python, check the [PyPI page](https://pypi.org/project/sudo-sudo-ai/) and for TypeScript, check the [npm page](https://www.npmjs.com/package/sudo-ai) for the latest release information.

  **Python**: Compatible with Python 3.9+\
  **TypeScript**: Compatible with Node.js 14+ and modern browsers
</Note>
