Unified AI Gateway plugin for ElizaOS - Vercel AI Gateway + FAL.ai for text, images, video, and more
npm install @ghostspeak/plugin-gateway-ghostUnified Vercel AI Gateway plugin for ElizaOS - one API key for all model types.
- Single API Key: One AI_GATEWAY_API_KEY for all model operations
- January 2026 Models: Claude Haiku/Opus 4.5, FLUX 2 Pro, Grok 2 Vision
- Full Model Coverage: Text, embeddings, images, vision, speech, transcription
- Streaming Support: Full async streaming for text generation
- Local Tokenization: Uses js-tiktoken, no API calls needed
| ModelType | Default Model | Description |
|-----------|---------------|-------------|
| TEXT_SMALL | anthropic/claude-haiku-4.5 | Fast, efficient text |
| TEXT_LARGE | anthropic/claude-opus-4.5 | Best quality reasoning |
| TEXT_EMBEDDING | openai/text-embedding-3-large | 3072-dim embeddings |
| OBJECT_SMALL | anthropic/claude-haiku-4.5 | Structured JSON output |
| OBJECT_LARGE | anthropic/claude-opus-4.5 | Complex structured output |
| IMAGE | bfl/flux-2-pro | Image generation (FLUX) |
| IMAGE_DESCRIPTION | xai/grok-2-vision | Vision/multimodal |
| TRANSCRIPTION | openai/whisper-1 | Speech-to-text |
| TEXT_TO_SPEECH | openai/tts-1-hd | Text-to-speech (HD) |
| TEXT_TOKENIZER_* | (local) | Token encode/decode |
``bash`
npm install @ghostspeak/plugin-gateway-ghostor
bun add @ghostspeak/plugin-gateway-ghost
`bashRequired
AI_GATEWAY_API_KEY=your_vercel_ai_gateway_key
$3
`json
{
"name": "YourAgent",
"plugins": ["@ghostspeak/plugin-gateway-ghost"],
"bio": "Your agent bio..."
}
`Usage
The plugin automatically registers model handlers when loaded. ElizaOS will use these handlers for all model operations:
`typescript
// The plugin registers handlers for:
// - runtime.generateText() -> TEXT_SMALL/TEXT_LARGE
// - runtime.embed() -> TEXT_EMBEDDING
// - runtime.generateObject() -> OBJECT_SMALL/OBJECT_LARGE
// - runtime.generateImage() -> IMAGE
// - etc.
`Development
`bash
Install dependencies
bun installBuild
bun run buildTest (requires AI_GATEWAY_API_KEY)
AI_GATEWAY_API_KEY=your_key bun test
``MIT