Quickstart
Get started with Turnix in just 3 simple steps. Estimated setup time: ~10 minutes
1. Create a Project
A Project is the core unit of organization within Turnix. Projects help you segment your usage of the Turnix infrastructure, making it easier to manage and monitor clients, rooms, API activity, and traffic.
You can:
- Separate usage and statistics by environment, team, or app feature
- Track behavior and performance at a granular level
- Maintain organizational billing by aggregating usage across all projects
To create a new project, navigate to the Projects section in the Turnix Console.
➤ Create Your First Project
Click “Create New Project”, enter a name, and you’re good to go!
✅ Next, you'll need to create an API token to interact with Turnix endpoints.
2. Create an API Token
API tokens are bearer tokens used to authenticate with the Turnix API. Each token is scoped to a specific project and grants permission to perform key actions like:
- Requesting ICE credentials
- Managing client sessions and rooms
- Accessing usage and monitoring endpoints
API tokens are sensitive. Store them securely and rotate them periodically.
➤ Create Your First API Token
To generate a token:
- Go to the Tokens Page for your project
- Click “Create new API Token”
- Copy the token by clicking the clipboard icon
- You're done! The token is ready for use in authenticated API requests
Once your token is ready, you can use it to request ICE credentials.
3. Request ICE Credentials
ICE (Interactive Connectivity Establishment) credentials are required for peer-to-peer communication between clients. They help determine IP addresses and routes across NATs and firewalls to establish reliable real-time connections.
➤ Request ICE Credentials via API
To request credentials, send a POST
request to the following endpoint: https://turnix.io/api/v1/credentials/ice
Use the API token you created in step 2 in the Authorization
header as a Bearer token.
A basic request looks like this:
- CURL
- Ruby
- Node.js
- Dart
- Java
curl -X POST \
https://turnix.io/api/v1/credentials/ice \
-H 'Authorization: Bearer YOUR_API_BEARER_TOKEN' \
-H 'Content-Type: application/json'
require 'httparty'
response = HTTParty.post(
"https://turnix.io/api/v1/credentials/ice",
headers: {
"Authorization" => "Bearer YOUR_API_BEARER_TOKEN"
}
)
puts response.code # HTTP status code
puts response.body # Response body
const fetch = require('node-fetch');
(async () => {
try {
const response = await fetch('https://turnix.io/api/v1/credentials/ice', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_BEARER_TOKEN',
'Content-Type': 'application/json'
}
});
if (!response.ok) {
throw new Error(`Request failed with status ${response.status}`);
}
const data = await response.json();
console.log('Response:', data);
} catch (error) {
console.error('Error:', error.message);
}
})();
import 'package:http/http.dart' as http;
final headers = <String, String>{
'Authorization': 'Bearer $apiToken',
'Accept': 'application/json',
'Content-Type': 'application/json',
};
final response = await http.post(
Uri.parse("https://turnix.io/api/v1/credentials/ice"),
headers: headers
);
final body = json.decode(response.body) as Map<String, dynamic>;
import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String apiToken = "YOUR_API_TOKEN";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://turnix.io/api/v1/credentials/ice"))
.header("Authorization", "Bearer " + apiToken)
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
📘 Want to see all available parameters? Refer to the full ICE Credentials API Reference.
Response
{
"iceServers": [
{
"urls": [
"stun:stun.turnix.io:3478"
]
},
{
"username": "35bb4eb4-b518-4059-9399-272efdefc5d9",
"credential": "7ea616da55d417f4aaf6427016140416",
"urls": [
"turn:some-region.tunix.io:3478?transport=udp",
"turn:some-region.tunix.io:3478?transport=tcp"
]
}
]
}
Once you receive your ICE credentials, you can configure your WebRTC clients or media servers using the returned iceServers
list. You're now ready to start building reliable, real-time applications with Turnix.