Skip to main content
API Docs v1

Overview

Request TURN credentials from your server, hand them to your client. Two endpoints, no SDK required.

Base URL

https://api.tosses.dev/v1

Authentication

Pass your API key as key in the JSON request body. Keys are per-app and available from the dashboard. Never send your API key from client-side code; request credentials from your own backend and forward them to the client.

Endpoints

EndpointPurpose
POST /v1/credentialsGet TURN credentials for a user session. Supports regular credentials and gateway-pinned sessions.
POST /v1/exchangePeer transport address discovery. Lets two clients find each other's address after connecting to a relay.

Relay Selection

When you request credentials, Tosses geolocates the host_ip (or your server's IP if omitted) and routes to the closest healthy relay based on network proximity and real-time load. If multiple relays tie on location, the least-loaded one wins. Relay health is tracked continuously; overloaded or offline relays are excluded automatically.

IPs are never stored or logged, and are used only for routing purposes.