> ## Documentation Index
> Fetch the complete documentation index at: https://docs.venice.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The Venice API is OpenAI-compatible: use any OpenAI SDK with the base URL `https://api.venice.ai/api/v1` and a Venice API key, or pay per request from a USDC wallet through x402 with no account.
> Read model IDs from `GET /models` or `GET /models/traits` at runtime instead of hardcoding them from memory or from these pages. Models are added and retired often.
> Every model's price is in https://docs.venice.ai/pricing.md. Quote video and audio jobs with `POST /video/quote` or `POST /audio/quote` before you queue them.
> Search these docs from an MCP client at https://docs.venice.ai/mcp. The full agent guide is https://docs.venice.ai/agents.md.

# Migrate from OpenAI

> Move OpenAI-compatible apps to Venice by swapping the base URL to api.venice.ai and your API key for private, uncensored inference with the same SDK.

Venice AI is a **drop-in replacement** for OpenAI. Same SDK, same code — just change two lines. Get privacy-first inference, uncensored models, and competitive pricing.

## The 2-Line Migration

```python Python theme={"system"}
# Before (OpenAI)
from openai import OpenAI
client = OpenAI()

# After (Venice) — change api_key and base_url
from openai import OpenAI
client = OpenAI(
    api_key="your-venice-api-key",           # ← Change 1
    base_url="https://api.venice.ai/api/v1",  # ← Change 2
)
```

```javascript Node.js theme={"system"}
// Before (OpenAI)
import OpenAI from "openai";
const client = new OpenAI();

// After (Venice)
import OpenAI from "openai";
const client = new OpenAI({
  apiKey: "your-venice-api-key",
  baseURL: "https://api.venice.ai/api/v1",
});
```

```bash cURL theme={"system"}
# Before
curl https://api.openai.com/v1/chat/completions ...

# After — just change the URL and key
curl https://api.venice.ai/api/v1/chat/completions ...
```

Generate a key from [venice.ai/settings/api](https://venice.ai/settings/api?utm_source=venice-api-documentation) or follow the [API key guide](https://docs.venice.ai/guides/getting-started/generating-api-key.md).

### Environment variables

```bash theme={"system"}
# Before
OPENAI_API_KEY=sk-...
OPENAI_BASE_URL=https://api.openai.com/v1

# After
OPENAI_API_KEY=your-venice-api-key
OPENAI_BASE_URL=https://api.venice.ai/api/v1
```

> [!TIP]
>
> Many libraries and tools read `OPENAI_API_KEY` and `OPENAI_BASE_URL` automatically. Updating these env vars may be all you need. Some tools still use `OPENAI_API_BASE` for the same URL.

## Models

Pass a Venice model ID, a trait such as `default` or `most_uncensored`, or, for chat and embedding models, a familiar OpenAI-style name. Venice maps OpenAI chat and embedding model names through [compatibility mapping](https://docs.venice.ai/api-reference/endpoint/models/compatibility_mapping.md); other endpoints, including audio, need Venice model IDs. Traits always resolve to the current model for that role — see [model traits](https://docs.venice.ai/api-reference/endpoint/models/traits.md).

Browse the live catalog and prices on [Text models](https://docs.venice.ai/models/text.md). For a first-request walkthrough, see the [Quickstart](https://docs.venice.ai/getting-started/quick-start.md).

## Feature compatibility

| Feature | OpenAI | Venice | Notes |
| - | - | - | - |
| Chat Completions | ✅ | ✅ | Compatible. Unknown top-level fields, including OpenAI-only ones such as `logit_bias` and `service_tier`, return HTTP 400 |
| Streaming | ✅ | ✅ | Same SSE format, plus a final usage chunk, see [Streaming format](#streaming-format) |
| Function Calling | ✅ | ✅ | Same `tools` parameter |
| Structured Output | ✅ | ✅ | Same `response_format` |
| Vision | ✅ | ✅ | Same content array format |
| Embeddings | ✅ | ✅ | Text only; token arrays return HTTP 400 |
| Image Generation | ✅ | ✅ | OpenAI-compatible via `/images/generations` |
| Image Edits | ✅ | ❌ | No `/images/edits` endpoint. Use the native [`/image/edit`](https://docs.venice.ai/guides/media/image-editing) endpoint |
| TTS | ✅ | ✅ | Compatible request shape; use Venice model IDs (OpenAI audio model names return HTTP 400) |
| STT | ✅ | ✅ | Compatible request shape; use Venice model IDs. `response_format` is `json` or `text` only. No `/audio/translations` |
| Responses API | ✅ | ✅ | Native for OpenAI models, translated for others, see [limitations](https://docs.venice.ai/guides/features/responses-api.md#limitations) |
| Assistants API | ✅ | ❌ | Use [Characters](https://docs.venice.ai/guides/features/characters.md) or [function calling](https://docs.venice.ai/guides/features/function-calling.md) |
| Batch API | ✅ | ❌ | Not yet available |
| Fine-tuning | ✅ | ❌ | Not available |

For native image options beyond the OpenAI-compatible endpoint, see [Image generation](https://docs.venice.ai/guides/media/image-generation.md).

### Streaming format

Chat Completions streams use the OpenAI chunk format and end with `data: [DONE]`. Two details differ:

* **Usage chunk.** Every stream ends with a usage chunk before `[DONE]`, even when `stream_options.include_usage` is false. Its `choices` array is empty and it carries `usage` and a `cost` object. Clients that read `choices[0]` on every chunk should skip chunks with no choices.
* **Errors after the stream starts.** The HTTP status is already 200, so the error arrives as a `data:` event with an `error` object (`message`, `type`, `code`), followed by `data: [DONE]`. When the model is overloaded, the object also includes `retry_after` in seconds.

```
data: {"error":{"message":"...","type":"server_error","code":"...","param":null}}

data: [DONE]
```

## Venice-only features

Pass Venice-specific options through `extra_body` as `venice_parameters`. Built-in web search is the usual first extra:

```python theme={"system"}
response = client.chat.completions.create(
    model="default",
    messages=[{"role": "user", "content": "Latest AI news today"}],
    extra_body={
        "venice_parameters": {
            "enable_web_search": "auto"
        }
    },
)
```

Unknown keys inside `venice_parameters` are ignored rather than rejected, so check the spelling of each key against the [API reference](https://docs.venice.ai/api-reference/endpoint/chat/completions.md).

The same pattern covers web scraping, citations, and [Characters](https://docs.venice.ai/guides/features/characters.md). If a client cannot change the request body, append a [model feature suffix](https://docs.venice.ai/api-reference/endpoint/chat/model_feature_suffix.md) such as `default:enable_web_search=auto`.

Venice also has native [video](https://docs.venice.ai/guides/media/video-generation.md), [music](https://docs.venice.ai/guides/media/music-and-sound-effects.md), [web retrieval](https://docs.venice.ai/guides/tools/web-retrieval.md), and [x402](https://docs.venice.ai/guides/integrations/x402-venice-api.md) APIs alongside the OpenAI-compatible surface.

## Frameworks

Most AI frameworks work with Venice by changing the base URL:

> [card] [LangChain](https://docs.venice.ai/guides/integrations/langchain.md)
>
> `base_url` in `ChatOpenAI`; `check_embedding_ctx_length=False` on `OpenAIEmbeddings`

> [card] [Vercel AI SDK](https://docs.venice.ai/guides/integrations/vercel-ai-sdk.md)
>
> `baseURL` in `createOpenAI`

> [card] [LlamaIndex](https://docs.venice.ai/guides/integrations/llamaindex.md)
>
> `api_base` on the OpenAI-compatible client

> [card] [CrewAI](https://docs.venice.ai/guides/integrations/crewai.md)
>
> `OPENAI_API_BASE` env var

> [card] [PydanticAI](https://docs.venice.ai/guides/integrations/pydanticai.md)
>
> OpenAI-compatible model with Venice base URL

> [card] [Cursor](https://docs.venice.ai/guides/integrations/cursor.md)
>
> Custom API endpoint in settings

> [card] [Claude Code](https://docs.venice.ai/guides/integrations/claude-code.md)
>
> Route Claude Code through Venice

> [card] [Codex CLI](https://docs.venice.ai/guides/integrations/codex-cli.md)
>
> `config.toml` model provider

> [card] [Aider](https://docs.venice.ai/guides/integrations/aider.md)
>
> `OPENAI_API_BASE` env var

More coding agents and tools are listed in [AI Agents](https://docs.venice.ai/guides/integrations/ai-agents.md).

## Uncensored models

Venice's private uncensored models have no content filtering, making them suitable for:

* Creative writing without guardrails
* Security research and red teaming
* Honest analysis without refusal patterns
* Medical and legal information without extra disclaimers

Use the `most_uncensored` trait or a current uncensored model ID from [Text models](https://docs.venice.ai/models/text.md).

> [card] [Get Your API Key](https://venice.ai/settings/api?utm_source=venice-api-documentation)
>
> Generate a Venice API key and start migrating in minutes


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.