Skip to main content
The Venice API offers HTTP-based REST and streaming interfaces for building AI applications with uncensored models and private inference. You can create with text generation, image creation, embeddings, and more, all without restrictive content policies. Integration examples and SDKs are available in the documentation. Our API reference is also available as a OpenAPI YAML spec.

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:
  1. Default Behavior: Your system prompts are appended to Venice’s defaults
  2. Custom Behavior: Disable Venice’s system prompts entirely

Disabling Venice System Prompts

Use the venice_parameters option to remove Venice’s default system prompts:

Venice Parameters

The venice_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 the cache_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, br in requests to receive compressed responses where supported

Example: Accessing Response Headers

Best Practices

  1. Rate Limiting: Monitor x-ratelimit-remaining-requests and x-ratelimit-remaining-tokens headers and implement exponential backoff
  2. Balance Monitoring: Track x-venice-balance-usd and x-venice-balance-diem headers to avoid service interruptions
  3. System Prompts: Test with and without Venice’s system prompts to find the best fit for your use case
  4. API Keys: Keep your API keys secure and rotate them regularly
  5. Request Logging: Log CF-RAY header values for troubleshooting with support
  6. Model Deprecation: Check for x-venice-model-deprecation-warning headers when using models

Differences from OpenAI’s API

While Venice maintains high compatibility with the OpenAI API specification, there are some key differences:
  1. venice_parameters: Additional configurations like enable_web_search, character_slug, and strip_thinking_response for extended functionality
  2. System Prompts: Venice appends your system prompts to defaults that optimize for uncensored responses (disable with include_venice_system_prompt: false)
  3. Model Ecosystem: Venice offers its own model lineup including uncensored and reasoning models - use Venice model IDs rather than OpenAI mappings
  4. Response Headers: Unique headers for balance tracking (x-venice-balance-usd, x-venice-balance-diem), model deprecation warnings, and content safety flags
  5. 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:
Request fields not listed in this documentation may be passed through but are not validated or guaranteed to work.