Skip to main content

AI Gateway

Overview

The Vercel AI SDK is a TypeScript toolkit for building AI-powered applications with streaming, structured outputs, and multi-model support. By connecting it to Orq.ai’s AI Gateway via the @orq-ai/vercel-provider, you get access to 300+ models with a single provider setup.

Key Benefits

Orq.ai’s AI Gateway enhances Vercel AI applications with:

Complete Observability

Track every generation, stream, and structured output with detailed traces

Built-in Reliability

Automatic fallbacks, retries, and load balancing for production resilience

Cost Optimization

Real-time cost tracking and spend management across all AI operations

Multi-Provider Access

Access 300+ LLMs and 20+ providers through a single, unified integration

Prerequisites

Before integrating Vercel AI with Orq.ai, ensure you have:
  • An Orq.ai account and API Key
  • Node.js 18 or higher
To set up an API key, see API keys & Endpoints.

Installation

Configuration

Configure the Orq.ai provider with the API key:
TypeScript
base_url: https://api.orq.ai/v3/router

Text Generation

TypeScript

Streaming Responses

TypeScript

Structured Output

Use a JSON system prompt and parse the response:
TypeScript

Model Selection

With Orq.ai, you can use any supported model from 20+ providers:
TypeScript