EN ▾
Get API key

Gemini API Key Integration: Use a Compatible Key Instead

A gemini api key integration normally means pasting Google's key into an app. The key on this site is a different thing: it opens an independent, OpenAI-compatible endpoint, so you paste it into the OpenAI-style fields of your tool and add one custom address.

Updated

A brass key above connected sockets, illustrating one API key plugged into several tools

Key points

  1. The key works with any client that lets you set a custom OpenAI base URL.
  2. Three values are needed: base URL, key, and model ID uncensored.
  3. Keep the key in an environment variable, never in a repository.
  4. Full keys allow 8 concurrent requests and 300 per minute.

Which key goes where

People who want this kind of integration often have one of two goals. Either they want Google's models inside some app, or they want a Gemini-like experience without the content filters. For the first goal you need a key from Google and Google's documentation. For the second, this page applies.

The key you get here is not interchangeable with a Google key. Pasting it into a field labeled for Google will fail, and pasting a Google key here will fail too. What it does work with is the field that most tools label OpenAI, Custom OpenAI or OpenAI-compatible. There you set three values and you are done:

Field in your toolValue to enter
API URL or base URLhttps://api.geminiuncensored.top/v1
API keyThe key from your account
Modeluncensored

Authentication is a standard bearer header, Authorization: Bearer <key>. Every tool below builds that header for you from the key field.

Generate the key and add credit

Create an account with Google sign-in or with an email and password, then open the API key page. Your key is shown there. New users also see a button to claim $0.50 of trial credit. It is one click, one claim per person, valid for 7 days and requires no payment details.

The trial is enough to confirm that an integration works, but it comes with tighter limits: 2 concurrent requests and 60 requests per minute. Once you add paid credit, the key moves to the full limits of 8 concurrent and 300 per minute. Top-ups here are crypto only (USDT on TRC20 or USDC on Base), any whole amount from $20 to $500, with +5% from $50, +10% from $100 and +15% from $200. Usage is billed at $0.15 per million input tokens and $0.50 per million output tokens, as laid out on the pricing page.

To get a feel for the running cost of an integration, take a chat message that sends 1,000 input tokens (persona, history and your new line) and gets 300 tokens back. Input costs 1,000 × 0.15 / 1,000,000 = $0.00015 and output costs 300 × 0.50 / 1,000,000 = $0.00015, so one message is $0.0003. A thousand such messages cost $0.30. Heavy daily use of a chat front end is therefore measured in cents, not dollars, while the longest histories cost proportionally more.

Keep the key out of your code

An API key is a password with a price tag attached: anyone who has it can spend your balance. Treat it accordingly.

  • Put it in an environment variable or a .env file, and add that file to .gitignore before the first commit.
  • Call the API from a server or a script you control. A key embedded in browser JavaScript is visible to every visitor.
  • Never paste it into a screenshot, a support message or a shared chat.
  • If a key ever lands in a public repo or a chat log, treat it as exposed and stop using it.

On macOS or Linux, set it for your current shell like this, and every example below will read it from there.

export UNCENSORED_API_KEY="paste-your-key-here"

# quick check: expect the model list with the ID uncensored
curl https://api.geminiuncensored.top/v1/models \
  -H "Authorization: Bearer $UNCENSORED_API_KEY"

Connect SillyTavern

SillyTavern lets you add an OpenAI-compatible endpoint, which is exactly what this service is. The setup is a few clicks inside the API connection panel.

  1. Open the plug icon (API Connections) and choose Chat Completion as the API type.
  2. In the source dropdown, pick the custom OpenAI-compatible option.
  3. Enter https://api.geminiuncensored.top/v1 as the endpoint, including the /v1 at the end.
  4. Paste your key into the API key field.
  5. Type uncensored into the model field, or press connect and select it from the list that the server returns.
  6. Press connect. A green status means the key and the address are both right.

Labels shift a little between SillyTavern versions, so look for the wording rather than the exact position. Then set the context size slider to a value you are comfortable paying for. The window supports 100,000 tokens in total, but a long chat resends its history on every message, so a smaller limit keeps each reply cheaper. Streaming is supported, so leave the stream option on for a typing effect.

If the connection fails, the usual culprits are a trailing slash or missing /v1 in the URL, a stray space copied along with the key, or an empty balance.

The context slider deserves a number. If a chat front end is set to send up to 8,000 tokens of history, each message costs at most 8,000 × 0.15 / 1,000,000 = $0.0012 in input, so a thousand full-context messages come to $1.20 before output. At the maximum of 100,000 tokens the same input is $0.015 per message. Pick the smallest window that keeps your story coherent, and use the character summary or lorebook features of your front end for facts that must never fall out of memory.

Connect LangChain in Python

LangChain ships an OpenAI chat wrapper in the langchain-openai package. Because the wrapper accepts a custom base URL, nothing else in your chains has to change.

pip install langchain-openai
import os
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="uncensored",
    base_url="https://api.geminiuncensored.top/v1",
    api_key=os.environ["UNCENSORED_API_KEY"],
    temperature=0.8,
)

print(llm.invoke("Write a two-line toast for a retired sea captain.").content)

for chunk in llm.stream("List three names for a fictional port city."):
    print(chunk.content, end="", flush=True)

Once llm exists, you can drop it into prompt templates, output parsers and agents the same way you would use any chat model. Tool calling is supported by the endpoint, so agents that bind tools can use it.

One thing to plan for is parallelism. A batch job that fires fifty prompts at once will hit the concurrency cap of 8 and receive HTTP 429 with the code concurrency. Cap the number of workers in the call itself.

import os
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="uncensored",
    base_url="https://api.geminiuncensored.top/v1",
    api_key=os.environ["UNCENSORED_API_KEY"],
)

prompts = ["Give one tagline for a bakery.", "Give one tagline for a bike shop."]
results = llm.batch(prompts, config={"max_concurrency": 4})
for r in results:
    print(r.content)

Other clients and plain SDKs

The same three values work anywhere an OpenAI-compatible provider can be added: chat front ends, editor plugins, automation tools and your own scripts. In the official Python SDK the integration is just the client constructor:

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.geminiuncensored.top/v1",
    api_key=os.environ["UNCENSORED_API_KEY"],
)

r = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Reply with the single word ready."}],
)
print(r.choices[0].message.content)

Some apps hide the base URL behind an advanced toggle, and others use an environment variable such as OPENAI_BASE_URL. If you cannot find the field, the documentation shows how to switch a client in three lines.

Settings for roleplay, fiction and companion apps

Most people who connect a key like this are building or using chat front ends for fiction, roleplay or companion-style apps for adults. A few settings make a visible difference there, and none of them require special tooling.

  • Temperature: 0.7 to 1.0 gives varied prose. Drop to 0.4 or lower if replies drift off character.
  • Penalties: small frequency and presence penalties reduce looping phrases in long scenes. The endpoint passes them through to the model.
  • Persona text or system prompt: keep it short and concrete. Every token in it is resent with each message, so a 1,500-token persona description costs $0.000225 in input per call at $0.15 per million.
  • Max response length: set it in the tool so one reply does not turn into a wall of text.
  • Stop strings: if the model starts to write your character's lines, add your name followed by a colon as a stop sequence.

The model is tuned to answer without content refusals for lawful adult use, but one rule is fixed: no sexual content involving minors, and requests like that will not be served. Keep your characters and scenes within that line.

Test the integration and read the signals

After connecting, send one short message and inspect the response headers if your tool exposes them, or run the curl command with -i. Four headers are worth knowing: X-Request-Id identifies the call, X-Balance-USD shows your remaining credit, and X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency report the limits that apply to your key.

If something breaks, match the symptom to the cause:

  • Authentication error right away: the key was copied with a space or newline, or belongs to a different service.
  • Not found: the base URL is missing /v1 or has a typo in the domain.
  • 429 with rate_limited: too many requests per minute. Add a delay between calls.
  • 429 with Retry-After: 5: temporary overload. Wait five seconds and retry.

Failed or refused requests are not charged, so a broken configuration will not eat your balance while you debug it.

Once a single message works, test the path you will really use. Send a long prompt to see that your tool does not truncate it, start a streamed reply and stop it halfway, and trigger two requests at the same time if your front end can do that. Each of these exercises a different part of the connection, and finding a problem now is cheaper than finding it in the middle of a long session.

Questions and answers

Can I use my Google Gemini key with this endpoint?

No. Keys are issued per service. The key from this site works only with this API, and Google's key works only with Google's.

Which model name should I enter in my tool?

Enter uncensored. It is the single model ID this API exposes, and you can confirm it with a GET request to the models endpoint.

Is there a way to try the integration without paying?

Yes. New users can claim $0.50 of trial credit with one click on the API key page. It needs no payment details, lasts 7 days and is limited to one per person.

Why does my batch job fail with 429?

Most likely you exceeded the concurrency limit of 8 requests at once (2 on a trial key). Lower the number of parallel workers and retry.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.