Start now

Integrate the Venice AI API in Minutes

Drop the Venice AI API into your existing stack and get uncensored responses without the usual content refusals.

Base URL
https://api.veniceaiapi.com/v1
Model
uncensored

Base URL and Authentication Setup

The API lives at https://api.veniceaiapi.com/v1. You authenticate with a single API key passed in the Authorization header.

Sign up via Google or email to get your key instantly. No phone number required. Use the key with any OpenAI-compatible SDK by setting the base URL.

Each account holds one active key. Generating a new one revokes the old key immediately. This ensures simple access control without complex permission scopes.

The model ID you must send is "uncensored". It is an open-weight model tuned to answer without content refusals for lawful adult use.

  • Base URL: https://api.veniceaiapi.com/v1
  • Auth Header: Authorization: Bearer YOUR_API_KEY
  • Model: uncensored

You can test connectivity with a simple GET request to /v1/models. This confirms your key works before you send heavy payloads.

The /v1/chat/completions Endpoint

Send text prompts to POST /v1/chat/completions and receive text responses. This endpoint handles all standard chat interactions.

Include your messages array with role and content fields. The model processes the input and returns a completion. You can control the output length using the max_tokens parameter.

The default max output is 2,048 tokens. You can increase this up to 16,000 tokens per request. The total context window allows 100,000 tokens for prompt and completion combined.

Errors and refusals do not consume your prepaid credit. This means you only pay for successful token generation.

Model Parameters: Temperature, Top-P, and Seed

Control the randomness of the output using standard LLM parameters. Set temperature to adjust creativity. Lower values make responses more deterministic and focused.

Use top_p for nucleus sampling. This limits the model to consider the top percentage of probability mass. It helps prevent repetitive or nonsensical outputs.

Set seed for reproducible results. This is useful for debugging or testing specific prompt variations. You can also use stop sequences to halt generation early.

Other supported parameters include presence_penalty and frequency_penalty. These help manage token diversity in long conversations.

Adjust these settings to fit your use case. Roleplay benefits from higher temperature. Code generation might need lower values.

Streaming Responses with Server-Sent Events

Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) instead of a single JSON object.

Each chunk contains partial text content. This allows you to display results in real time to your users. It significantly improves the perceived latency for long responses.

The final chunk includes the total token usage statistics. You can track your credit consumption accurately in real time.

Handle stream errors gracefully. Network interruptions may truncate the response. You can resume or retry the request if needed.

Function Calling and JSON Mode

Use function calling to integrate the API with your backend logic. Define tools in your request and the model will return structured JSON arguments.

Set response_format: {"type": "json_object"} to force strict JSON output. This is ideal for parsing data into your application.

Function calling works alongside streaming. You can receive structured data in real time. This enables complex multi-step interactions.

The model understands tool definitions and executes them accordingly. You handle the tool execution logic in your code.

This feature makes the API suitable for building agents or automated workflows.

Rate Limits and Token Constraints

Each API key is limited to 300 requests per minute. You can have 8 concurrent requests at the same time. This prevents sudden bursts from overwhelming the system.

The maximum request body size is 8 MB. Ensure your payloads fit within this limit. Large context windows consume this quota quickly.

Common errors include 401 for invalid keys and 402 for insufficient credit. A 429 error indicates you have hit the rate limit.

Refunds are not available for credit. However, mistakes like double charges are fixed via Support. Your credit never expires.

Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens. Top-ups are crypto only from $20 to $500.

cURL

curl https://api.veniceaiapi.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Return status as json"}]
  }'

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.veniceaiapi.com/v1", api_key="YOUR_KEY")

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)

Node.js

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.veniceaiapi.com/v1", apiKey: process.env.API_KEY });

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);

Streaming

stream = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Tell the story in second person."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Frequently asked questions

What is the Venice AI API context window and how does it affect performance?

The context window is 100,000 tokens for both prompt and completion combined. This allows for long conversations or document processing. The max output per request is 16,000 tokens. You can adjust this with the max_tokens parameter.

How do I handle errors and refusals in the API?

Errors do not consume your credit. Refusals for unlawful content like minor sexual content are free. Other refusals depend on the model's tuning. Check the status code for 401, 402, or 429 errors.

Can I use the API with Vercel or other serverless platforms?

Yes, the API is OpenAI-compatible. You can integrate it with any SDK or framework. Set the base URL and API key in your environment variables. It works well with Vercel templates and other serverless functions.

Secure your API key

Register an account, retrieve your key, update the endpoint. Minimal effort required.

Start now