This is an official provider SDK for 302AI that integrates with Vercel AI SDK.
The 302AI provider enables seamless integration with the Vercel AI SDK, offering access to a wide range of AI models for:
- Advanced language models including:
- GPT-4 series (gpt-4-turbo, gpt-4o, etc.)
- Claude-3 series (opus, sonnet, haiku)
- Gemini series
- Llama 3 series
- And many other leading models
- State-of-the-art image models including:
- Midjourney 6.0/6.1
- DALL-E 3
- Stable Diffusion variants (SD3, SDXL)
- Flux models
- Ideogram models
- Playground models
- Omnigen models
- And more specialized image generators
- High-quality embedding models including:
- OpenAI text-embedding-3 (small/large)
- BGE models
- Zhipu embeddings
- And other specialized embedding models
All models are accessible through a unified, type-safe API that follows Vercel AI SDK standards. For a complete list of supported models, please refer to our detailed documentation.
- 🚀 Simple, unified API for all AI operations
- 💪 Full TypeScript support
- 🔄 Streaming responses support
- 🛡️ Built-in error handling
- 📝 Comprehensive documentation
npm install @302ai/ai-sdk
import { ai302 } from '@302ai/ai-sdk';
import { generateText } from 'ai';
// Text Generation
const { text } = await generateText({
model: ai302('gpt-4-turbo'),
prompt: 'Hello, how can I help you today?'
});
// Image Generation
import { experimental_generateImage as generateImage } from 'ai';
const { image } = await generateImage({
model: ai302.image('midjourney/6.1'),
prompt: 'A beautiful sunset over mountains'
});
// Embeddings
import { embed } from 'ai';
const { embedding } = await embed({
model: ai302.textEmbeddingModel('text-embedding-3-large'),
value: 'Text to embed'
});
This SDK includes the following packages:
ai
: The @302ai/ai-sdk Core SDK for 302AI.
Each package is 100% TypeScript.
For detailed documentation about available models and usage, please check:
Apache License 2.0 - See LICENSE for details.