1) Simple chat (user API key)
curl "https://api.ara.so/v1/chat" \
-X POST \
-H "Authorization: Bearer $ARA_USER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "Draft a concise product launch message." }
]
}'
2) Follow-up turn
curl "https://api.ara.so/v1/chat" \
-X POST \
-H "Authorization: Bearer $ARA_USER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "Draft 3 concise launch taglines." },
{ "role": "assistant", "content": "Tagline A, Tagline B, Tagline C." },
{ "role": "user", "content": "Now rewrite those for a B2B audience." }
]
}'
3) Minimal JavaScript server example
const apiKey = process.env.ARA_USER_API_KEY; // ara_api_...
async function run() {
const resp = await fetch("https://api.ara.so/v1/chat", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
messages: [{ role: "user", content: "Summarize this week in one paragraph." }],
}),
});
if (!resp.ok) {
throw new Error(`Ara API ${resp.status}: ${await resp.text()}`);
}
const data = await resp.json();
console.log(data);
}
run().catch((err) => {
console.error(err);
process.exitCode = 1;
});
