Venice AI API Documentation and Quickstart
Get started with the uncensored LLM API by using the provided base URL and your API key to send requests. This quickstart guide covers authentication, standard completions, streaming, and tool integration for immediate deployment.
- Base URL
https://api.veniceaiapikey.com/v1- Model
uncensored
Authentication and Base URL
Your venice ai api key authenticates every request to the API. Replace the standard base URL in your SDK configuration with the one above. The system uses prepaid credit, so ensure your balance is sufficient before sending heavy payloads.
Chat Completions Endpoint
Send text to the model using the standard chat completions endpoint. The model ID is always uncensored, ensuring consistent behavior without content refusals for lawful adult topics.
Configure your client to point to the correct base URL and include the model identifier in the request body. You can adjust parameters like temperature or top_p to control creativity.
Errors and refusals are free, so you only pay for actual token usage. The context window supports up to 100,000 tokens for both input and output combined.
Streaming and SSE Usage
Enable real-time token generation by setting stream: true in your request. The API returns Server-Sent Events (SSE) that you can parse incrementally.
Each chunk contains partial text, but token usage metrics appear only in the final chunk. This approach reduces perceived latency for users waiting for long-form content.
Handle the stream end event to finalize the response. Ensure your client buffers the accumulated text correctly before presenting it to the end user.
Function Calling and JSON Mode
Use the API for structured data extraction or tool execution. Set response_format to {"type": "json_object"} to enforce strict JSON output.
Define tools in the request body to allow the model to call functions. The model will return structured arguments that your backend can execute.
This feature is ideal for building agents or automating workflows. Ensure your function definitions are clear to minimize hallucination in the arguments.
Parameters and Settings
Control the model's behavior using standard parameters. Use temperature for creativity, top_p for nucleus sampling, and stop sequences to truncate output.
Set seed for reproducible results during testing. Adjust presence_penalty and frequency_penalty to influence topic diversity.
The maximum output is 16,000 tokens per request. If you do not specify max_tokens, the default is 2,048. Plan your prompts to stay within the 100,000 token context window.
Rate Limits and Constraints
Each API key allows 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB.
If you exceed these limits, you will receive a 429 error. A single account supports one active key; generating a new key replaces the previous one.
Credit never expires, so you can top up whenever needed. Use crypto for top-ups, with bonus credit available for larger amounts.
cURL
curl https://api.veniceaiapikey.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Generate a summary of the current weather conditions"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.veniceaiapikey.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.veniceaiapikey.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
How do I get my Venice AI API key?
Sign up using Google or an email address on the registration page. Your API key is displayed immediately after signup, allowing you to start making requests without waiting for approval or verification.
What happens if I exceed the rate limit?
You will receive a 429 Too Many Requests error. The limit is 300 requests per minute per key, with a maximum of 8 concurrent requests. Wait a moment and retry, or distribute requests across multiple keys if needed.
Is the uncensored model suitable for roleplay?
Yes, the model is designed to answer without content refusals for lawful adult topics, making it ideal for roleplay and unrestricted creative writing. It does not gate these features behind expensive tiers or separate models.
Retrieve your API key
Sign up, copy your unique key, and update your base URL. That is the entire configuration.