A powerful new option has arrived for AI-powered image generation. Recraft's state-of-the-art image models (V3 and V2) are now accessible via Vercel's AI Gateway, eliminating the need for separate provider accounts. This integration offers developers a simplified API and enhanced observability. You can read the original announcement for more details.

Why Recraft Models Stand Out
Recraft's image models, particularly V3, are gaining attention for several key capabilities:
- Photorealistic Quality: High-fidelity image generation and accurate text rendering within images.
- Complex Prompt Following: Excels at understanding and executing detailed instructions.
- V3 Exclusive Features: Supports long multi-word text generation, precise element positioning, anatomical correctness, and native vector graphic output.
- Diverse Styles: Comes with over 20 built-in specialized styles, ranging from realistic portraits to pixel art.

Hands-On Code: Generating Images with the AI SDK
Using the Vercel AI SDK's generateImage function, you can call the Recraft model in just a few lines. Here's an example using the Recraft V3 model.
import { generateImage } from 'ai';
const result = await generateImage({
model: 'recraft/recraft-v3',
prompt: `A misty Japanese forest with ancient cedar trees, painted in the style of traditional ukiyo-e woodblock prints with soft indigo and moss green tones.`,
});
// You can access the generated image data from the result object.
Simply change the model to 'recraft/recraft-v2' to use the V2 model instead.

The AI Gateway Advantage
Beyond mere model access, AI Gateway provides essential features for building production-ready AI applications.
- Unified API: Call various AI models through a single, consistent interface.
- Usage & Cost Tracking: Monitor all your model consumption in one place.
- High Availability: Configure retries, failover, and performance optimizations for uptime that often exceeds individual providers.
- Built-in Observability: Gain insights with integrated monitoring tools.
- BYOK Support: Bring Your Own Key for supported models.
These tools are a significant advantage for developers looking to integrate AI features reliably. Checking the AI Gateway model leaderboard can also help you see which models are trending in the community.