Skip to main content
Get up and running with the Venice API in minutes. Generate an API key, make your first request, and start building.

Quickstart

1

Get your API key

Head to your Venice API Settings and generate a new API key.For a detailed walkthrough, check out the API Key guide.
2

Set up your API key

Add your API key to your environment. You can export it in your shell:
export VENICE_API_KEY='your-api-key-here'
Or add it to a .env file in your project:
VENICE_API_KEY=your-api-key-here
3

Install the SDK

Venice is OpenAI-compatible, so you can use the OpenAI SDK. If you prefer to use cURL or raw HTTP requests, you can skip this step.
pip install openai
npm install openai
4

Send your first request

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("VENICE_API_KEY"),
    base_url="https://api.venice.ai/api/v1"
)

completion = client.chat.completions.create(
    model="zai-org-glm-5",
    messages=[
        {"role": "system", "content": "You are a helpful AI assistant"},
        {"role": "user", "content": "Why is privacy important?"}
    ]
)

print(completion.choices[0].message.content)
import OpenAI from 'openai';

const client = new OpenAI({
    apiKey: process.env.VENICE_API_KEY,
    baseURL: 'https://api.venice.ai/api/v1'
});

const completion = await client.chat.completions.create({
    model: 'zai-org-glm-5',
    messages: [
        { role: 'system', content: 'You are a helpful AI assistant' },
        { role: 'user', content: 'Why is privacy important?' }
    ]
});

console.log(completion.choices[0].message.content);
curl https://api.venice.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zai-org-glm-5",
    "messages": [
      {"role": "system", "content": "You are a helpful AI assistant"},
      {"role": "user", "content": "Why is privacy important?"}
    ]
  }'
Message roles:
  • system - Instructions for how the model should behave
  • user - Your prompts or questions
  • assistant - Previous model responses (for multi-turn conversations)
  • tool - Function calling results (when using tools)
5

Switch models by changing the model ID

Every request includes a model ID. To use a different model, change the model value in your request. Popular choices:
  • zai-org-glm-5 - Default model for most use cases
  • kimi-k2-6 - Strong reasoning for more complex tasks
  • claude-opus-4-8 - High-intelligence model for complex tasks
  • venice-uncensored-1-2 - Venice’s uncensored model

View All Models

Browse the complete list of models with pricing, capabilities, and context limits
6

Use Venice Parameters

You can choose to enable Venice-specific features like web search using venice_parameters:
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("VENICE_API_KEY"),
    base_url="https://api.venice.ai/api/v1"
)

completion = client.chat.completions.create(
    model="zai-org-glm-5",
    messages=[
        {"role": "user", "content": "What are the latest developments in AI?"}
    ],
    extra_body={
        "venice_parameters": {
            "enable_web_search": "auto",
            "include_venice_system_prompt": True
        }
    }
)

print(completion.choices[0].message.content)
import OpenAI from 'openai';

const client = new OpenAI({
    apiKey: process.env.VENICE_API_KEY,
    baseURL: 'https://api.venice.ai/api/v1'
});

const completion = await client.chat.completions.create({
    model: 'zai-org-glm-5',
    messages: [
        { role: 'user', content: 'What are the latest developments in AI?' }
    ],
    venice_parameters: {
        enable_web_search: 'auto',
        include_venice_system_prompt: true
    }
});

console.log(completion.choices[0].message.content);
curl https://api.venice.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zai-org-glm-5",
    "messages": [
      {"role": "user", "content": "What are the latest developments in AI?"}
    ],
    "venice_parameters": {
      "enable_web_search": "auto",
      "include_venice_system_prompt": true
    }
  }'
See all available parameters.
7

Enable streaming (optional)

Stream responses in real-time using stream=True:
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("VENICE_API_KEY"),
    base_url="https://api.venice.ai/api/v1"
)

stream = client.chat.completions.create(
    model="zai-org-glm-5",
    messages=[{"role": "user", "content": "Write a short story about AI"}],
    stream=True
)

for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content is not None:
        print(chunk.choices[0].delta.content, end="")
import OpenAI from 'openai';

const client = new OpenAI({
    apiKey: process.env.VENICE_API_KEY,
    baseURL: 'https://api.venice.ai/api/v1'
});

const stream = await client.chat.completions.create({
    model: 'zai-org-glm-5',
    messages: [{ role: 'user', content: 'Write a short story about AI' }],
    stream: true
});

for await (const chunk of stream) {
    if (chunk.choices && chunk.choices[0]?.delta?.content) {
        process.stdout.write(chunk.choices[0].delta.content);
    }
}
curl https://api.venice.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zai-org-glm-5",
    "messages": [
      {"role": "user", "content": "Write a short story about AI"}
    ],
    "stream": true
  }'
8

Customize response behavior (optional)

Control how the model responds with parameters like temperature, max tokens, and more:
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("VENICE_API_KEY"),
    base_url="https://api.venice.ai/api/v1"
)

completion = client.chat.completions.create(
    model="zai-org-glm-5",
    messages=[
        {"role": "system", "content": "You are a creative storyteller"},
        {"role": "user", "content": "Tell me a creative story"}
    ],
    temperature=0.8,
    max_tokens=500,
    top_p=0.9,
    frequency_penalty=0.5,
    presence_penalty=0.5,
    extra_body={
        "venice_parameters": {
            "include_venice_system_prompt": False
        }
    }
)

print(completion.choices[0].message.content)
import OpenAI from 'openai';

const client = new OpenAI({
    apiKey: process.env.VENICE_API_KEY,
    baseURL: 'https://api.venice.ai/api/v1'
});

const completion = await client.chat.completions.create({
    model: 'zai-org-glm-5',
    messages: [
        { role: 'system', content: 'You are a creative storyteller' },
        { role: 'user', content: 'Tell me a creative story' }
    ],
    temperature: 0.8,
    max_tokens: 500,
    top_p: 0.9,
    frequency_penalty: 0.5,
    presence_penalty: 0.5,
    venice_parameters: {
        include_venice_system_prompt: false
    }
});

console.log(completion.choices[0].message.content);
curl https://api.venice.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zai-org-glm-5",
    "messages": [
      {"role": "system", "content": "You are a creative storyteller"},
      {"role": "user", "content": "Tell me a creative story"}
    ],
    "temperature": 0.8,
    "max_tokens": 500,
    "top_p": 0.9,
    "frequency_penalty": 0.5,
    "presence_penalty": 0.5,
    "stream": false,
    "venice_parameters": {
      "include_venice_system_prompt": false
    }
  }'
Check out the Chat Completions docs for more information on all supported parameters.

Next Steps

Now that you’ve made your first requests, explore more of what Venice API has to offer:

Browse Models

Compare all available models with their capabilities, pricing, and context limits

API Reference

Explore detailed API documentation with all endpoints and parameters

Structured Responses

Learn how to get JSON responses with guaranteed schemas

AI Agents Guide

Build with agent apps, coding agents, MCP tools, skills, and crypto workflows

Additional Resources

Rate Limiting

Understand rate limits and best practices for production usage

Error Codes

Reference for handling API errors and troubleshooting issues

Postman Collection

Import our complete Postman collection for easy testing

Privacy & Security

Learn about Venice’s privacy-first architecture and data handling

Need Help?