> ## 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>

## API version

The released SDKs send no `X-Mesh-Version` header, so each request is served at your key's
pinned version, or the baseline `2026-08` if the key has none. A new key copies your
organization's default version, and new organizations default to the newest version,
`2026-09`. Check the key's **API Version** under **API Keys** in the dashboard before you
pin it. See [API versioning](/docs/reference/api-versioning#pinning-a-whole-api-key).

## 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 and edit 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, filter, search, and get models |
| [Error Handling](/sdk/error-handling) | Typed exceptions, error codes, retries |

The SDKs also wrap content moderation (`moderations.create`), web search (`web.search`),
and Auto Router model selection (`router.select`). Their request and response fields match
the [Moderations](/api/moderations/classify-content-against-the-content-policy),
[Web search](/docs/capabilities/web-search), and [Router select](/api/router/router-select)
references.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.