Skip to main content
Verlon AI provides an OpenAI-compatible API endpoint. You can use the official OpenAI SDK by pointing it to Verlon’s base URL instead of OpenAI’s.

Quick Start

Prerequisites

  • Verlon AI account (sign up)
  • Verlon API key from your Dashboard
  • A configured gate (gate UUID)

Installation

Configuration

Update your OpenAI client initialization - just 2 lines:

Making Requests

Verlon supports three ways to specify your gate:

Streaming Example

Streaming works exactly like the standard OpenAI SDK:

What’s Supported

Full support for stream: true with identical behavior to OpenAI
Works across all providers - Verlon handles format conversion
Image inputs in messages fully supported
System, user, assistant, and tool messages all supported
temperature, max_tokens, top_p, and other OpenAI parameters
Standard response.usage with token counts, plus Verlon’s cost field

Language Examples

Migration Guide

Follow these steps to migrate an existing OpenAI application:

1. Update Client Initialization

Find where you initialize the OpenAI client and update it:

2. Add Gate ID

Add gateId to your completion calls:

3. Update Environment Variables

.env

4. Test & Deploy

  1. Test in development
  2. Verify requests appear in Verlon dashboard
  3. Check cost tracking is working
  4. Deploy to production
Easy Rollback: If anything breaks, revert the 2 changes (baseURL + apiKey) - takes 30 seconds.

Advanced Usage

Multiple Gates

Use different gates based on the task:

Environment-Specific Configuration

Error Handling

How It Works

  1. You send  OpenAI SDK request to https://api.verlon.ai/v1/chat/completions
  2. Verlon receives  Validates gate, applies routing rules
  3. Verlon routes  Sends to the model configured in your gate (GPT, Claude, Gemini, etc.)
  4. Provider responds  Returns response in provider’s format
  5. Verlon normalizes  Converts back to OpenAI format
  6. You receive  Standard OpenAI response with added cost/metadata
Your code doesn’t know the difference.

FAQ

No. Just change baseURL and apiKey in the OpenAI client initialization.
Yes. Just revert baseURL and apiKey to OpenAI values.
Yes. stream: true works exactly like OpenAI.
Yes. Configure your gate to use any model  your code stays the same.
Fully supported. Verlon handles the conversion across all providers.
No. This approach uses only the OpenAI SDK.
Yes. The Vercel AI SDK’s OpenAI adapter works with Verlon’s OpenAI-compatible endpoint.

Where the Verlon SDK fits

This guide is the recommended integration path for inference — new projects and existing apps alike. The Verlon SDK is not an alternative inference client; it’s the observability SDK, and it composes with this setup rather than replacing it:
Reach for it when you want agent traces, per-task model control, and session grouping in the dashboard — see Agent Tracing. The gateway does not need it for routing, logging, or cost tracking; those come with this guide’s two-line setup. Video and OCR are the exception: Verlon doesn’t mirror drop-in routes for them yet, so they’re served by the v3 REST API (POST /v3/video, POST /v3/ocr).

Next Steps

Create a Gate

Set up routing rules and configure models

View Request Logs

Monitor your API usage and costs

Configure Fallbacks

Learn about fallback strategies

Verlon SDK

Add agent tracing and task attribution on top of this setup