Launch HN: Speko (YC S26) – 语音 AI 版的 OpenRouter
Launch HN: Speko (YC S26) – OpenRouter for Voice AI
原始链接: https://speko.ai/
```javascript
import { defineAgent, voice } from '@livekit/agents';
import * as openai from '@livekit/agents-plugin-openai';
const key = process.env.SPEKO_API_KEY!;
const baseURL = 'https://api.speko.ai/v1';
export default defineAgent({
entry: async (ctx) => {
const session = new voice.AgentSession({
// 使用 OpenAI 兼容接口配置语音转文字 (STT)
stt: new openai.STT({ apiKey: key, baseURL, model: 'auto' }),
// 使用 OpenAI 兼容接口配置大语言模型 (LLM)
llm: new openai.LLM({ apiKey: key, baseURL, model: 'auto' }),
// 使用 OpenAI 兼容接口配置文字转语音 (TTS)
tts: new openai.TTS({ apiKey: key, baseURL, model: 'auto' }),
});
await session.start({
agent: new voice.Agent({ ... })
});
},
});
```