Skip to main content

Overview

The Hyperscape server exposes both REST and WebSocket APIs for game interactions.
The API is primarily designed for internal use by the game client and ElizaOS agents. Direct API access requires authentication.

Base URL

Authentication

All authenticated endpoints require a Bearer token in the Authorization header:
string
required
Bearer token obtained from Privy authentication

Endpoints

Health Check

endpoint
Returns server health status

Player

endpoint
Get current player information
endpoint
Create or update player

World State

endpoint
Get current world state snapshot
endpoint
List all world areas

Admin Endpoints

Admin endpoints require the x-admin-code header with a valid admin code. These are for server management only.
endpoint
Request server restart after current duel ends (zero-downtime deployment)
endpoint
Check if graceful restart is pending
Graceful Restart Behavior:
  • If no duel active: restarts immediately via SIGTERM
  • If duel in progress: waits until RESOLUTION phase completes
  • PM2 automatically restarts the server with new code
  • Enables zero-downtime deployments for the duel arena stream

WebSocket Events

Connect to the game server via WebSocket for real-time updates:

Client → Server Events

Server → Client Events

Rate Limits

API rate limits apply to prevent abuse. Exceeding limits will result in temporary blocks.

Error Codes

Invalid request parameters or malformed JSON
Missing or invalid authentication token
Insufficient permissions for the requested action
Resource does not exist
Rate limit exceeded
Server-side error, please report to Discord

SDKs & Libraries

JavaScript SDK

Official JavaScript/TypeScript client

ElizaOS Plugin

AI agent integration plugin

Need Help?

Discord Community

Get help from the community

GitHub Issues

Report bugs or request features