Venice AI API Endpoint: Switch to Another Base URL
If your code points at a venice ai api endpoint and you want to try another provider, the change is small: a base URL, a key and a model ID. This page lists what to edit, what to test and what behaves differently afterwards.

Key points
- Four edits cover most migrations: base URL, API key, model ID, balance handling.
- The new base URL is https://api.veniceapialternative.com/v1 and the model ID is uncensored.
- Three endpoints are supported: chat completions, responses and models.
- Test with the $0.50 trial before moving real traffic.
The short answer: four edits
Any client that speaks the OpenAI chat format only needs configuration changes to reach a different provider. For a venice ai api endpoint, the same holds in reverse: you are replacing four values, not rewriting your integration.
- Base URL: set it to
https://api.veniceapialternative.com/v1. - API key: create one on the API key page and send it as
Authorization: Bearer <key>. - Model ID: use
uncensored. There is a single model, so no model list to map. - Balance checks: read the
X-Balance-USDheader, or callGET /v1/balance.
This is an independent service, not run by or affiliated with Venice or any other vendor. It hosts one open-weight model, so any model name your code used before must be replaced.
Before you edit: find every place the endpoint lives
The base URL is rarely in only one file. Search your repository for the old host name, for the old model string, and for the environment variable that holds the key. Typical hiding places are SDK constructors, .env files, Docker or CI secrets, front-end config and background workers that were written separately from the main app.
A useful habit is to move all three values into environment variables first, then migrate. That makes the switch a deploy-time change and gives you a one-line rollback.
export LLM_BASE_URL="https://api.veniceapialternative.com/v1"
export LLM_API_KEY="YOUR_KEY"
export LLM_MODEL="uncensored"Code for Python, Node and curl
Python (openai SDK)
import os
from openai import OpenAI
client = OpenAI(
base_url=os.environ.get("LLM_BASE_URL", "https://api.veniceapialternative.com/v1"),
api_key=os.environ["LLM_API_KEY"],
)
resp = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Say hello in five words."}],
)
print(resp.choices[0].message.content)
Node.js
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.veniceapialternative.com/v1",
apiKey: process.env.LLM_API_KEY,
});
const resp = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Say hello in five words." }],
});
console.log(resp.choices[0].message.content);
curl
curl -i https://api.veniceapialternative.com/v1/chat/completions \
-H "Authorization: Bearer $LLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"uncensored","messages":[{"role":"user","content":"Say hello in five words."}]}'
The -i flag prints response headers, which is how you see X-Request-Id and X-Balance-USD on the first call.
What stays the same, and what does not
The request shape is the familiar one: messages with roles, stream, tools, tool_choice, response_format for JSON mode, and the sampling parameters temperature, top_p, stop, seed and the penalties. Streaming uses SSE with usage at the end, and tool results go back as role: "tool" messages.
| Item | Here |
|---|---|
| Endpoints | POST /v1/chat/completions, POST /v1/responses, GET /v1/models |
| Model ID | uncensored (one model) |
| Context window | 100,000 tokens, prompt plus completion |
| Max request body | 8 MB |
| Modalities | Text only: no images, audio, video, embeddings or fine-tuning |
The last row is the one that breaks migrations. If your app calls an image, speech or embedding route on the old provider, those calls have no equivalent here. Keep that part on its current provider and move only the text calls.
Handle limits and errors differently
A full key allows 8 concurrent requests and 300 requests per minute. A trial key allows 2 concurrent and 60 per minute. Past either limit you get HTTP 429, with error code rate_limited for requests per minute or concurrency for too many at once. A 429 with a Retry-After: 5 header means temporary overload: wait and retry.
Note that a streamed request holds its concurrency slot until the stream finishes. If your old integration fired dozens of parallel calls, put a semaphore of 8 or fewer in front of the client.
import time, random
from openai import OpenAI, RateLimitError
client = OpenAI(base_url="https://api.veniceapialternative.com/v1", api_key="YOUR_KEY")
def ask(prompt, tries=4):
for i in range(tries):
try:
r = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": prompt}],
)
return r.choices[0].message.content
except RateLimitError:
time.sleep(5 + random.random() * i)
raise RuntimeError("still rate limited")
Failed or refused requests are not charged, so retries on errors do not cost you credit.
Streaming and tool calls after the switch
If your app streams tokens to a UI, nothing changes in the client: set stream: true and read server-sent events. The usage block arrives at the end of the stream, which is handy for logging the cost of each reply.
from openai import OpenAI
client = OpenAI(base_url="https://api.veniceapialternative.com/v1", api_key="YOUR_KEY")
stream = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "List three uses of a message queue."}],
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
if chunk.usage:
print("\n", chunk.usage)
Tool calling follows the same flow you already know. You pass tools and optionally tool_choice, the model returns tool_calls (streamed in pieces when streaming), you run the function, and you send the result back as a role: "tool" message. JSON mode works with response_format: {"type": "json_object"}. Always validate the parsed JSON in your code, because no model guarantees a schema.
Common problems after switching
- Authentication failures. Check that the key is sent as a Bearer token and that you copied the whole string. A key from the old provider will not work here.
- Not found errors. The base URL must end at
/v1. If you paste the full/chat/completionspath into an SDK that appends it again, the route will be wrong. - Unknown model. Any model string other than
uncensoredis wrong. Search for hard-coded names in config and tests. - Bursts of 429. Limit parallelism to the concurrency of your key type, and respect
Retry-After. - Unexpected cost. Long chat histories are billed as input on every turn. Trim them.
If something still looks off, send the X-Request-Id value from the response to the support page contact. It identifies the exact request and saves time on both sides.
Migration checklist and testing
Work through this in order. Each step is a small, reversible change.
- Claim the $0.50 trial from the API key page. It needs no card and lasts 7 days.
- Run the curl call above and confirm the response and the headers.
- Switch one non-critical code path to the new base URL and key.
- Replay a sample of real prompts and compare output quality, length and latency by eye.
- Check
usagein the responses and multiply by your volume at $0.15 per 1M input and $0.50 per 1M output tokens. - Add a balance alert on
X-Balance-USD. - Top up (from $20, with bonuses from $50) and move the rest of the traffic.
Prompts that depended on another model's quirks may need small edits, such as a different system prompt. That is normal when changing models, so judge on your own test set, not on a single answer. This model is tuned to answer without content refusals for lawful adult use, and sexual content involving minors is not allowed.
The docs describe each endpoint and header. Our page on the Venice API alternative covers how the product compares, and the pricing page shows top-up amounts, bonuses and payment methods. Prompts sent to the API are not used for training, and credit never expires, so a small test top-up carries no deadline.
More guides
Questions and answers
What is the base URL?
Use https://api.veniceapialternative.com/v1 with any OpenAI-compatible client, and send your key as a Bearer token.
Which model ID should I send?
Send uncensored. There is one model, so there is nothing to map from your old model names.
How do I check my balance?
Read the X-Balance-USD response header, call GET /v1/balance, or use the OpenAI-style GET /v1/dashboard/billing/credit_grants.
Can I call image or embedding endpoints?
No. The API is text only, with no image, audio, video, embedding or fine-tuning endpoints.