Multiplayer API Logo

Multiplayer API

Python SDK
Coming Soon

We're building a native Python SDK for Multiplayer API. Until it's ready, everything works today through the universal REST API with JSON — perfect for requests, httpx and aiohttp.

What's Coming

The Python SDK will wrap the full REST API with idiomatic Python — type hints, dataclasses and async support.

pip Installable

A proper package with type hints, dataclass responses and full coverage of players, rooms, matchmaking and leaderboards.

Async Realtime

Native asyncio + websockets client for the realtime relay at wss://realtime.michitai.com.

Engine Friendly

Works with Pygame, Godot-Python, Panda3D and any backend or tool that can make HTTP requests.

Use It Today via REST API

Every SDK feature is a plain JSON endpoint. No SDK required.

Register a player — pure JSON over HTTPS

import requests

API = "https://api.michitai.com/api"
API_TOKEN = "YOUR_API_TOKEN"

response = requests.post(
    f"{API}/game_players.php/register",
    params={"api_token": API_TOKEN},
    json={
        "player_name": "PlayerOne",
        "player_data": {"level": 1, "class": "mage"},
    },
)

data = response.json()
player_token = data["private_key"]
print(data)

Create and join a room

# Create a room
room = requests.post(
    f"{API}/game_room.php/create",
    params={"api_token": API_TOKEN, "player_token": player_token},
    json={"room_name": "Lobby 1", "max_players": 4},
).json()

# Send a heartbeat to stay connected
requests.post(
    f"{API}/game_room.php/heartbeat",
    params={"api_token": API_TOKEN, "player_token": player_token},
)

Fetch the leaderboard

leaderboard = requests.post(
    f"{API}/leaderboard.php",
    params={"api_token": API_TOKEN},
    json={
        "sort_by": ["level", "score"],
        "limit": 10,
    },
).json()

for entry in leaderboard["leaderboard"]:
    print(f"#{entry['rank']} - {entry['player_name']}")

Ready when you are

Create a free developer account, grab an API token and start making JSON calls from Python today. Check the full REST API reference for every endpoint, request body and response schema.