Quick Start
Monetize your first AI interaction in under 5 minutes.
Prerequisites
- An Atheon Gateway Account.
- An API Key (get it from the Project Settings page).
Step 1: Install
Install the SDK for your backend.
npm install @atheon-inc/codex
pip install atheon-codex
Step 2: Integrate Logic (Backend)
In your chat completion handler, pass the data to Atheon.
import { AtheonCodexClient } from "@atheon-inc/codex";
const client = new AtheonCodexClient({ apiKey: process.env.ATHEON_CODEX_API_KEY });
// 1. Get LLM Output
const userQuery = "How do I center a div?";
const llmOutput = "You can use Flexbox...";
// 2. Inject Atheon Unit
const result = await client.fetchAndIntegrateAtheonUnit({
query: userQuery,
baseContent: llmOutput
});
// 3. Send to Frontend (Content + Tracking Configs)
res.json({
text: result.response_data.integrated_content,
tracking: result.response_data.integration_configs
});
import os
from atheon_codex import AtheonCodexClient
client = AtheonCodexClient(
api_key=os.environ.get("ATHEON_CODEX_API_KEY")
)
# 1. Get LLM Output
user_query = "How do I center a div?"
llm_output = "You can use Flexbox..."
# 2. Inject Atheon Unit
result = client.fetch_and_integrate_atheon_unit(
query=user_query,
base_content=llm_output
)
# 3. Send to Frontend (Content + Tracking Configs)
return {
"text": result.response_data.integrated_content,
"tracking": result.response_data.integration_configs
}
Step 3: Render (Frontend)
Wrap your output in the Atheon Container.
<script
data-atheon-publisher-key="YOUR_PUBLISHER_KEY"
src="https://js.atheon.ad/atheon.js"
defer
></script>
<atheon-container id="chat-bubble">
<div id="text-content"></div>
</atheon-container>
<script>
// Hydrate with data from backend
const container = document.getElementById('chat-bubble');
container.setAttribute('data-atheon', JSON.stringify(backendResponse.tracking));
document.getElementById('text-content').innerText = backendResponse.text;
</script>