UNPKG

@devvai/devv-code-backend

Version:

Backend SDK for Devv Code - Provides authentication, data management, email and AI capabilities

29 lines (28 loc) 863 B
import OpenAI from 'openai'; /** * OpenRouterAI extends OpenAI client with pre-configured authentication for OpenRouter * * Usage: * ```typescript * const ai = new OpenRouterAI(); * const response = await ai.chat.completions.create({ * model: 'openai/gpt-4-turbo', // Required: specify OpenRouter model * messages: [{ role: 'user', content: 'Hello!' }] * }); * ``` * * Common OpenRouter models: * - openai/gpt-4-turbo * - openai/gpt-3.5-turbo * - anthropic/claude-3-opus * - anthropic/claude-3-sonnet * - google/gemini-pro * - meta-llama/llama-3-70b-instruct * * Note: If you encounter API key errors, ensure you have configured * your OpenRouter API key in the external API keys configuration. */ export declare class OpenRouterAI extends OpenAI { constructor(); protected prepareRequest(request: RequestInit): Promise<void>; }