Skip to main content
Venice AI is a drop-in replacement for OpenAI. Same SDK, same code — just change two lines. Get privacy-first inference, uncensored models, and competitive pricing.

The 2-Line Migration

Python

# Before (OpenAI)
from openai import OpenAI
client = OpenAI()

# After (Venice) — change api_key and base_url
from openai import OpenAI
client = OpenAI(
    api_key="your-venice-api-key",          # ← Change 1
    base_url="https://api.venice.ai/api/v1"  # ← Change 2
)

Node.js

// Before (OpenAI)
import OpenAI from 'openai';
const client = new OpenAI();

// After (Venice)
import OpenAI from 'openai';
const client = new OpenAI({
  apiKey: 'your-venice-api-key',
  baseURL: 'https://api.venice.ai/api/v1',
});

cURL

# Before
curl https://api.openai.com/v1/chat/completions ...

# After — just change the URL and key
curl https://api.venice.ai/api/v1/chat/completions ...

Environment Variables

# Before
OPENAI_API_KEY=sk-...
OPENAI_BASE_URL=https://api.openai.com/v1

# After
OPENAI_API_KEY=your-venice-api-key
OPENAI_BASE_URL=https://api.venice.ai/api/v1
Many libraries and tools read OPENAI_API_KEY and OPENAI_BASE_URL automatically. Just updating these env vars may be all you need.

Model Mapping

OpenAI ModelVenice EquivalentTypePricing (Input/Output per 1M)
gpt-4ozai-org-glm-4.7 (Private)Text0.55/0.55 / 2.65
gpt-4oopenai-gpt-52 (Anonymized)Text2.19/2.19 / 17.50
gpt-4o-miniqwen3-4bText0.05/0.05 / 0.15
gpt-4-turbomistral-31-24bText0.50/0.50 / 2.00
o1 / o3qwen3-235b-a22b-thinking-2507 (Private)Reasoning0.45/0.45 / 3.50
o1 / o3grok-41-fast (Anonymized)Reasoning0.50/0.50 / 1.25
gpt-4-visionmistral-31-24b or qwen3-vl-235b-a22bVision0.50/0.50 / 2.00
text-embedding-3-smalltext-embedding-bge-m3Embeddings0.15/0.15 / 0.60
dall-e-3qwen-image (Private, $0.01) or flux-2-proImageFrom $0.01
whispernvidia/parakeet-tdt-0.6b-v3STT$0.0001/sec
tts-1tts-kokoroTTS$3.50/1M chars

Feature Compatibility

FeatureOpenAIVeniceNotes
Chat CompletionsFully compatible
StreamingSSE format identical
Function CallingSame tools parameter
Structured OutputSame response_format
VisionSame content array format
EmbeddingsSame API
Image GenerationOpenAI-compatible via /images/generations*
TTSCompatible
STTCompatible
Assistants APIUse Characters or Minds instead
Batch APINot yet available
Fine-tuningNot available
*Venice also provides an OpenAI-compatible endpoint at POST /images/generations for easier migration from DALL-E. For Venice’s native image API with additional options, see Image Generate.

Venice-Only Features

Venice offers capabilities OpenAI doesn’t:
response = client.chat.completions.create(
    model="venice-uncensored",
    messages=[{"role": "user", "content": "Latest AI news today"}],
    extra_body={
        "venice_parameters": {
            "enable_web_search": "auto"
        }
    }
)

2. Web Scraping

response = client.chat.completions.create(
    model="venice-uncensored",
    messages=[{"role": "user", "content": "Summarize https://example.com/article"}],
    extra_body={
        "venice_parameters": {
            "enable_web_scraping": True
        }
    }
)

3. Characters (AI Personas)

response = client.chat.completions.create(
    model="venice-uncensored",
    messages=[{"role": "user", "content": "Tell me about yourself"}],
    extra_body={
        "venice_parameters": {
            "character_slug": "venice-ai"
        }
    }
)

4. Uncensored Models

Venice’s private models have no content filtering, making them suitable for:
  • Creative writing without guardrails
  • Security research and red teaming
  • Honest analysis without refusal patterns
  • Medical/legal information without disclaimers

5. Video Generation

# Queue a video generation job
import requests

response = requests.post(
    "https://api.venice.ai/api/v1/video/queue",
    headers={"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"},
    json={
        "model": "wan-2.6-text-to-video",
        "prompt": "A serene lake at sunset with gentle waves",
        "resolution": "720p",
        "duration": 5,
    }
)
job_id = response.json()["id"]

Why Migrate?

Privacy

  • Zero data retention on private models — your prompts are never stored
  • No training on your data — ever
  • OpenAI retains data for 30 days and may use it for safety research

Cost

  • Private models are often cheaper than OpenAI equivalents
  • qwen3-4b at $0.05/1M input is 10x cheaper than gpt-4o-mini
  • venice-uncensored at 0.20/1Minputvsgpt4oat0.20/1M input vs gpt-4o at 2.50/1M

Freedom

  • No content filtering on uncensored models
  • No account suspensions for controversial use cases
  • Web3-native with crypto payment options
  • DIEM staking for daily credits

Model Diversity

  • Access to models from multiple providers (Qwen, Llama, Mistral, Gemma, Claude, GPT, Grok, etc.)
  • Switch between private and anonymized models per request
  • New models added regularly

Framework Migration

Most AI frameworks work with Venice by changing the base URL:
FrameworkChange Required
LangChainbase_url in ChatOpenAI
Vercel AI SDKbaseURL in createOpenAI
CrewAIOPENAI_API_BASE env var
LlamaIndexapi_base in OpenAI
AutoGenbase_url in config
Haystackapi_base_url in OpenAIGenerator
Claude Code--api-base flag or env var
CursorCustom API endpoint in settings
Continue.devapiBase in config.json

Get Your API Key

Generate a Venice API key and start migrating in minutes