AI Gateway

Most popular

Unified access to 200+ LLMs

Passthrough

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.

Overview
Pricing
Usage
Docs
Examples
Chat Completionchat.ts
typescript
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)
Streaming Responsestream.ts
typescript
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)
}
With Fallbackfallback.ts
typescript
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