
Before you start
You need an account with MozOut, with an active service or domain. The API answers at:
https://api.mozout.com/v1It speaks JSON over HTTPS, and field names are in English.
Check that the API responds
This operation does not need a key, so it is the best first test:
curl
curl "https://api.mozout.com/v1/ping" \
-H "Accept-Language: en"PHP
<?php
$ch = curl_init('https://api.mozout.com/v1/ping');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Accept-Language: en',
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, PHP_EOL, $body, PHP_EOL;Python
import os
import requests
headers = {
"Accept-Language": "en",
}
r = requests.get("https://api.mozout.com/v1/ping", headers=headers, timeout=30)
print(r.status_code)
print(r.text)JavaScript
const response = await fetch("https://api.mozout.com/v1/ping", {
headers: {
"Accept-Language": "en",
},
});
console.log(response.status);
console.log(await response.text());Response:
{
"data": {
"status": "ok",
"version": "v1",
"time": "2026-11-04T21:30:00+02:00"
},
"meta": {}
}The Python example uses the requests library, and the JavaScript one runs on Node.js 18 or later.
Create a key
- Sign in to My MozOut and open the API page.
- Name the key and choose its type. To begin, choose Sandbox mode (
sandbox_). - Choose the permissions and the validity.
- Confirm with your password and the 6-digit code you receive by email.
- Copy the key. It is shown only this once.
The details are in Authentication and keys.
Save the key
Keep the key in an environment variable, outside your code:
export RLX_API_KEY="sandbox_..."The examples in this documentation read the key from RLX_API_KEY.
Make your first request with a key
This operation shows the permissions, validity and limits of the key that made the request:
curl
curl "https://api.mozout.com/v1/token" \
-H "Authorization: Bearer $RLX_API_KEY" \
-H "Accept-Language: en"PHP
<?php
$ch = curl_init('https://api.mozout.com/v1/token');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RLX_API_KEY'),
'Accept-Language: en',
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, PHP_EOL, $body, PHP_EOL;Python
import os
import requests
headers = {
"Authorization": "Bearer " + os.environ["RLX_API_KEY"],
"Accept-Language": "en",
}
r = requests.get("https://api.mozout.com/v1/token", headers=headers, timeout=30)
print(r.status_code)
print(r.text)JavaScript
const response = await fetch("https://api.mozout.com/v1/token", {
headers: {
Authorization: `Bearer ${process.env.RLX_API_KEY}`,
"Accept-Language": "en",
},
});
console.log(response.status);
console.log(await response.text());Response:
{
"data": {
"id": 12,
"name": "Example key",
"type": "sandbox",
"mode": "sandbox",
"writes_simulated": true,
"suffix": "AbCd",
"permissions": [
"dns:read"
],
"allowed_ips": [
"198.51.100.0/24"
],
"expires_at": "2027-02-02T10:00:00+02:00",
"created_at": "2026-11-04T10:00:00+02:00",
"last_used_at": "2026-11-04T21:30:00+02:00",
"rate_limit": {
"limit": 90,
"remaining": 89,
"reset": 1793820660,
"window_seconds": 60
},
"spending": {
"limit": 0,
"spent": 0,
"currency": "USD",
"window_days": 30
}
},
"meta": {}
}Response format
A successful response always has data and meta, except GET /v1/openapi.json, which returns the document without this envelope:
{
"data": {},
"meta": {}
}An error response has error, with a stable code. See Errors.
Every response has the X-Correlation-ID header. Include it when you report a problem to support.
Message language
Send Accept-Language: pt or Accept-Language: en to choose the language of error messages. Without this header, messages are in English. The code field never changes with the language.
Long-running operations
Operations that take time answer 202 with an action_id. Instead of repeating the request, follow the result with GET /v1/actions/{id}. The states are queued, running, done and failed.
Next steps
- Permissions: give each key only what it needs.
- Limits: how many requests you can make per minute.
- Sandbox and Production: what
sandbox_andprod_keys do. - Reference: every operation, with a filter, linking to the page of each area.