Unified access to 200+ LLMs
The AI Gateway provides unified access to 200+ large language models from OpenAI, Anthropic, Google, Meta, and more. Features automatic fallbacks, response caching, streaming support, and detailed usage tracking. One API, all models.
import { sylphx } from '@sylphx/sdk'
const response = await sylphx.ai.chat({
model: 'gpt-4o',
messages: [
{ role: 'user', content: 'Explain quantum computing in simple terms' }
],
})
console.log(response.content)const stream = await sylphx.ai.chat({
model: 'claude-3.5-sonnet',
messages: [{ role: 'user', content: 'Write a haiku' }],
stream: true,
})
for await (const chunk of stream) {
process.stdout.write(chunk.content)
}const response = await sylphx.ai.chat({
model: 'gpt-4o',
fallback: ['claude-3.5-sonnet', 'gemini-2.0-flash'],
messages: [{ role: 'user', content: 'Hello!' }],
})
console.log('Used model:', response.model)Looking for more examples?
View on GitHub