Core API Reference
Low-level AI infrastructure endpoints
Direct access to persona management, knowledge processing, and query execution. Perfect for custom implementations and advanced use cases requiring full control.
Quick Example
Core API Quick Example
import { RodgerClient } from '@rodger-ai/sdk';
const client = new RodgerClient({
apiKey: 'your-api-key',
apiUrl: 'https://api.rodger.ai'
});
// Create an agent
const agent = await client.createPersona({
name: 'Support Assistant',
instructions: 'You are a helpful customer support agent.',
traits: ['helpful', 'patient', 'professional']
});
// Query the agent
const response = await client.query(agent.id, {
message: 'How can I reset my password?'
});AI Agents
Create and manage AI agents with custom configurations, traits, and instructions.
POST /personasCreate agent
GET /personasList agents
PUT /personas/:idUpdate agent
DELETE /personas/:idDelete agent
Knowledge
Ingest and process knowledge sources with advanced RAG capabilities.
POST /knowledgeAdd source
GET /knowledgeList sources
GET /knowledge/searchSearch knowledge
DELETE /knowledge/:idDelete source
Query Processing
Send queries to personas and manage conversation sessions.
POST /querySend query
POST /query/streamStream query
GET /sessionsList sessions
DELETE /sessions/:idDelete session
Authentication
Manage API keys and authentication tokens for secure access.
POST /auth/api-keysCreate API key
GET /auth/api-keysList API keys
PUT /auth/api-keys/:idRotate key
DELETE /auth/api-keys/:idRevoke key
MCP Tools Integration
Enable external tool integrations using Model Context Protocol with secure credential management.
MCP Tool Execution Example
# Execute a Slack notification via MCP
curl -X POST https://api.rodger.ai/api/mcp/tools/execute \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"toolName": "slack",
"action": "send-message",
"parameters": {
"channel": "#support",
"message": "Customer issue escalated",
"priority": "high"
},
"monitorExecution": true
}'Streaming with Vercel AI SDK v5
Stream AI responses with real-time tool execution using Server-Sent Events.
Streaming Chat Example
// Using EventSource for streaming
const eventSource = new EventSource(
'https://api.rodger.ai/api/ai-sdk/agents/agent-123/chat',
{
headers: {
'Authorization': 'Bearer your-api-key',
'Content-Type': 'application/json'
}
}
);
eventSource.onmessage = (event) => {
const chunk = JSON.parse(event.data);
if (chunk.type === 'text') {
console.log('AI:', chunk.content);
} else if (chunk.type === 'tool_call') {
console.log('Tool called:', chunk.toolCall.name);
} else if (chunk.type === 'tool_result') {
console.log('Tool result:', chunk.result);
}
};
// Using fetch with streaming
const response = await fetch('https://api.rodger.ai/api/ai-sdk/agents/agent-123/chat', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
messages: [{ role: 'user', content: 'Deploy to staging' }],
enableMCPTools: true,
stream: true
})
});
const reader = response.body.getReader();
while (true) {
const { done, value } = await reader.read();
if (done) break;
// Process streaming chunks
}