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

# SDK Reference

> Install the MeshAPI SDK for your language and make your first API call.

MeshAPI provides official SDKs for Python, Node.js, and Go. Each SDK wraps the REST API with typed parameters, streaming helpers, and automatic retries.

<Info>
  Java SDK is coming soon.
</Info>

## Installation

<Tabs>
  <Tab title="Python">
    ```bash theme={null}
    pip install meshapi
    ```

    For realtime (WebSocket) support:

    ```bash theme={null}
    pip install 'meshapi[realtime]'
    ```

    Python 3.9+. Built on `httpx` and Pydantic v2.
  </Tab>

  <Tab title="Node.js">
    ```bash theme={null}
    npm install meshapi-node-sdk
    ```

    Node 18+ is required. Node 18–21 requires `npm install ws` for realtime WebSocket support; Node 22+ has WebSocket built in.
  </Tab>

  <Tab title="Go">
    ```bash theme={null}
    go get github.com/aifiesta/meshapi-go-sdk
    ```

    Go 1.21+.
  </Tab>

  <Tab title="Java">
    Java SDK — coming soon.
  </Tab>
</Tabs>

## Initialize the client

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from meshapi import MeshAPI

    client = MeshAPI(
        base_url="https://api.meshapi.ai",
        token="rsk_...",
    )
    ```

    For async applications, use `AsyncMeshAPI`:

    ```python theme={null}
    from meshapi import AsyncMeshAPI

    async with AsyncMeshAPI(base_url="https://api.meshapi.ai", token="rsk_...") as client:
        ...
    ```
  </Tab>

  <Tab title="Node.js">
    ```typescript theme={null}
    import { MeshAPI } from "meshapi-node-sdk";

    const client = new MeshAPI({
      baseUrl: "https://api.meshapi.ai",
      token: "rsk_...",
    });
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    import meshapi "github.com/aifiesta/meshapi-go-sdk"

    client := meshapi.New(meshapi.Config{
        BaseURL: "https://api.meshapi.ai",
        Token:   "rsk_...",
    })
    ```
  </Tab>
</Tabs>

## What's covered

| Page                                        | What it covers                                                    |
| ------------------------------------------- | ----------------------------------------------------------------- |
| [Chat Completions](/sdk/chat)               | Basic chat, multi-turn, templates, async                          |
| [Streaming](/sdk/streaming)                 | Streaming responses, cancellation, recovery                       |
| [Structured Output](/sdk/structured-output) | JSON schema response format                                       |
| [Embeddings](/sdk/embeddings)               | Single and batch embeddings                                       |
| [Image Generation](/sdk/images)             | Generate images                                                   |
| [Audio](/sdk/audio)                         | Text-to-speech, speech-to-text, translate to English, list voices |
| [Video Generation](/sdk/video)              | Submit tasks, poll status, list                                   |
| [Batches](/sdk/batches)                     | Async batch job lifecycle                                         |
| [Model Compare](/sdk/compare)               | Fan out to multiple models                                        |
| [Responses API](/sdk/responses)             | Responses API create and stream                                   |
| [Prompt Templates](/sdk/templates)          | Create, update, delete, use in chat                               |
| [RAG (Files & Search)](/sdk/rag)            | Upload, embed, and search documents                               |
| [Realtime Audio](/sdk/realtime)             | Bidirectional WebSocket audio sessions                            |
| [Models](/sdk/models)                       | List models, filter free/paid                                     |
| [Error Handling](/sdk/error-handling)       | Typed exceptions, error codes, retries                            |
