> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.meshapi.ai/llms.txt.
> For full documentation content, see https://developers.meshapi.ai/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.meshapi.ai/_mcp/server.

# Python SDK Overview

> Getting started with the MeshAPI Python SDK.

# Python SDK

Official Python SDK for [Mesh API](https://meshapi.ai), an AI model gateway that gives you instant access to 300+ LLMs through a single OpenAI-compatible API.

Python 3.9+. Built on `httpx` and Pydantic v2. Sync and async clients with first-class type hints.

## Install

```bash
pip install meshapi
# or
uv add meshapi
# or
poetry add meshapi
```

## Authentication

All requests require a Mesh API key (prefixed with `rsk_`). You can get your key at [meshapi.ai](https://meshapi.ai).

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

This single key provides access to all available resources, including chat, embeddings, images, files, batches, models, and templates.

## Type hints

Every request and response is a Pydantic v2 model. Import what you need:

```python
from meshapi import (
    MeshAPI,
    AsyncMeshAPI,
    MeshAPIConfig,
    MeshAPIError,
    ChatCompletionParams,
    # ...
)
```