Authentication
The Venice API uses API keys for authentication. Create and manage your API keys in your API settings. All API requests require HTTP Bearer authentication:Your API key is a secret. Do not share it or expose it in any client-side code.
OpenAI Compatibility
Venice’s API implements the OpenAI API specification, ensuring compatibility with existing OpenAI clients and tools. This allows you to integrate with Venice using the familiar OpenAI interface while accessing Venice’s unique features and uncensored models.Setup
Configure your client to use Venice’s base URL (https://api.venice.ai/api/v1) and make your first request:
Venice-Specific Features
System Prompts
Venice provides default system prompts designed to ensure uncensored and natural model responses. You have two options for handling system prompts:- Default Behavior: Your system prompts are appended to Venice’s defaults
- Custom Behavior: Disable Venice’s system prompts entirely
Disabling Venice System Prompts
Use thevenice_parameters option to remove Venice’s default system prompts:
Venice Parameters
Thevenice_parameters object allows you to access Venice-specific features not available in the standard OpenAI API:
These parameters can also be specified as model suffixes appended to the model name (e.g.,
zai-org-glm-5:enable_web_search=auto). See Model Feature Suffixes for details.Prompt Caching
Venice supports prompt caching on select models to reduce latency and costs for repeated content. For supported models, Venice automatically caches system prompts—no code changes required. You can also manually mark content for caching using thecache_control property on message content.
See Prompt Caching for details on how caching works, billing, and best practices.
Response Headers Reference
All Venice API responses include HTTP headers that provide metadata about the request, rate limits, model information, and account balance. In addition to error codes returned from API responses, you can inspect these headers to get the unique ID of a particular API request, monitor rate limiting, and track your account balance. Venice recommends logging request IDs (CF-RAY header) in production deployments for more efficient troubleshooting with our support team, should the need arise.
The table below provides a comprehensive reference of all headers you may encounter:
Important Notes
- Header Name Case: HTTP headers are case-insensitive, but Venice uses lowercase with hyphens for consistency
- String Values: Boolean values in headers are returned as strings (
"true"or"false") - Numeric Values: Large numbers and balance values may be returned as strings to prevent precision loss
- Optional Headers: Not all headers are returned in every response; presence depends on the endpoint and request context
- Compression: Use
Accept-Encoding: gzip, brin requests to receive compressed responses where supported
Example: Accessing Response Headers
Best Practices
- Rate Limiting: Monitor
x-ratelimit-remaining-requestsandx-ratelimit-remaining-tokensheaders and implement exponential backoff - Balance Monitoring: Track
x-venice-balance-usdandx-venice-balance-diemheaders to avoid service interruptions - System Prompts: Test with and without Venice’s system prompts to find the best fit for your use case
- API Keys: Keep your API keys secure and rotate them regularly
- Request Logging: Log
CF-RAYheader values for troubleshooting with support - Model Deprecation: Check for
x-venice-model-deprecation-warningheaders when using models
Differences from OpenAI’s API
While Venice maintains high compatibility with the OpenAI API specification, there are some key differences:- venice_parameters: Additional configurations like
enable_web_search,character_slug, andstrip_thinking_responsefor extended functionality - System Prompts: Venice appends your system prompts to defaults that optimize for uncensored responses (disable with
include_venice_system_prompt: false) - Model Ecosystem: Venice offers its own model lineup including uncensored and reasoning models - use Venice model IDs rather than OpenAI mappings
- Response Headers: Unique headers for balance tracking (
x-venice-balance-usd,x-venice-balance-diem), model deprecation warnings, and content safety flags - Content Policies: More permissive policies with dedicated uncensored models and optional content filtering
API Stability
Venice maintains backward compatibility for v1 endpoints and parameters. For model lifecycle policy, deprecation notices, and migration guidance, see Deprecations.OpenAPI Specification & Raw Data
For programmatic access to Venice API docs and data — including use with RAG (Retrieval-Augmented Generation) — the following resources are available:- OpenAPI Spec (YAML) — the full API specification in YAML format
- API Docs Source — all documentation pages (
.mdxformat) as a downloadable archive
Request fields not listed in this documentation may be passed through but are not validated or guaranteed to work.