Quickstart
1. Get API Key
Navigate to the platform dashboard under API Keys to retrieve your key.
2. Make First Request
curl -X POST https://thalium-chain-executor.fly.dev/v1/brain/{brainId}/invoke \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"session_id": "session_123",
"input": {
"type": "text",
"content": "What is Thalium?"
}
}'
3. SSE Response Flow
- fast.artifact: Returns in 1-3s with initial classification
- full.artifact: Returns in 6-15s with complete response
4. Artifact Structure
{
"trace_id": "trace_123",
"status": "completed",
"address_key": "knowledge_retrieval.global.thalium.introduction",
"confidence_score": 87,
"gate_decision": "pass",
"provenance": ["memory_ring:entity_123"],
"anchor_trace": "redis://shard-a/abc123"
}
5. TypeScript Example
const response = await fetch(`https://thalium-chain-executor.fly.dev/v1/brain/${brainId}/invoke`, {
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({
session_id: 'session_123',
input: { type: 'text', content: 'What is Thalium?' }
})
});
const reader = response.body?.getReader();
while (reader) {
const { done, value } = await reader.read();
if (done) break;
const text = new TextDecoder().decode(value);
text.split('\n').forEach(line => {
if (line.startsWith('data:')) {
const data = JSON.parse(line.substring(5));
if (data.event === 'fast.artifact') {
console.log('Fast artifact:', data);
} else if (data.event === 'full.artifact') {
console.log('Full artifact:', data);
}
}
});
}