Quickstart
The r-mad.ai API is a single OpenAI-compatible chat completions endpoint, authenticated with an API key issued to your organization.
1. Get an API key
Sign in to the dashboard, open API Keys, and create a key. The full secret is shown once — store it somewhere safe, since only the last four characters are retrievable afterwards.
2. Make a request
curl https://api.r-mad.ai/api/llm/chat/completions \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "Say hello in one sentence."}
]
}'
import requests
response = requests.post(
"https://api.r-mad.ai/api/llm/chat/completions",
headers={"X-API-Key": "YOUR_API_KEY"},
json={
"messages": [
{"role": "user", "content": "Say hello in one sentence."},
],
},
)
print(response.json()["choices"][0]["message"]["content"])
const response = await fetch("https://api.r-mad.ai/api/llm/chat/completions", {
method: "POST",
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
messages: [{role: "user", content: "Say hello in one sentence."}],
}),
});
const data = await response.json();
console.log(data.choices[0].message.content);
3. Read the response
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1735689600,
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "Hello! Hope you're having a great day."},
"finish_reason": "stop"
}
],
"usage": {"prompt_tokens": 12, "completion_tokens": 11, "total_tokens": 23}
}
That's it — no model field to choose or manage, no separate tool-configuration step. Your org's system prompt (if any) and MCP integration (if any) are both applied automatically. See Authentication, Rate Limits, and System Prompts for the details, or jump straight to the API Reference.