@hivetechs/hive-ai
Version:
Real-time streaming AI consensus platform with HTTP+SSE MCP integration for Claude Code, VS Code, Cursor, and Windsurf - powered by OpenRouter's unified API
31 lines (30 loc) • 1.08 kB
TypeScript
/**
* OpenRouter API Client - SOURCE_OF_TRUTH Implementation
*
* Simple OpenRouter API wrapper for consensus tool per exact design specifications.
* Only used for consensus pipeline - no other functionality.
* Now includes health monitoring integration for bulletproof error handling.
*/
export interface OpenRouterMessage {
role: 'user' | 'assistant' | 'system';
content: string;
}
export interface OpenRouterResponse {
content: string;
model: string;
usage?: {
prompt_tokens: number;
completion_tokens: number;
total_tokens: number;
};
}
/**
* Call OpenRouter API with model, messages, and API key
* Per SOURCE_OF_TRUTH: Function callOpenRouter(model, messages, apiKey)
*/
export declare function callOpenRouter(model: string, messages: OpenRouterMessage[], apiKey: string): Promise<OpenRouterResponse>;
/**
* Test OpenRouter API connectivity with a simple call
* Uses the first available model from OpenRouter data
*/
export declare function testOpenRouterConnection(apiKey: string, testModel?: string): Promise<boolean>;