EN ▾
Get API key
gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc gemmaapi.cc

Gemma 4 API Key: How to Get One and Use It

If you searched for a gemma 4 api key, here is the short route on this site: sign up, open the API key page, copy the key and point any OpenAI client at our base URL. This is not Google's own Gemma service, so read the next section before you start.

Updated

Glowing key above a terminal connected by a cable to a server, representing an API key for an LLM endpoint

Key points

  • Sign up with Google or with email and password, then open the API key page.
  • New users can claim $0.50 of trial credit with one click, no card needed.
  • Use base URL https://api.gemmaapi.cc/v1 and model uncensored with any OpenAI SDK.
  • The trial key allows 2 concurrent requests and 60 requests per minute.

What this key is, and what it is not

Let us be clear about what you get. A gemma 4 api key from Google comes from Google's own developer tools, and the terms, quotas and safety filters there are set by Google. For that route, follow Google's current documentation.

The key described here is different. This site sells access to one open-weight model, run by an independent provider and tuned to answer without content refusals for lawful adult use. It is not the official API of Google, Meta, Mistral, Qwen, DeepSeek, OpenAI or any other vendor, and it is not a router that forwards your calls to those vendors. You send requests to one endpoint and one model ID, uncensored.

Why would that matter to you? If your app needs a model that does not stop mid-story, mid-roleplay or mid-analysis because a filter tripped, an OpenAI-compatible endpoint with a single permissive model is simpler than juggling settings elsewhere. If you specifically need Google's hosted model for its own sake, this is the wrong place. The page comparing Gemma 4 API options goes through that trade-off in more detail.

One hard limit applies to every account: no sexual content involving minors. Requests like that are not supported, and the rule is not negotiable.

Step by step: from sign-up to a working key

  1. Create an account. Open the API key page. You can sign in with Google, or register with an email address and a password.
  2. Claim the trial. After sign-up, the key page shows a button for the trial credit. One click adds $0.50. It is limited to one per person, it is valid for 7 days, and it needs no card.
  3. Copy the key. The key appears on the same page. Treat it like a password: anyone who has it can spend your balance.
  4. Store it as an environment variable rather than pasting it into source code. Examples follow below.
  5. Send a test request. A single short call confirms that the key, the URL and the model ID are right.

The whole sequence takes a few minutes. There is no waiting list and no application form. If you hit a snag with the sign-in, the support page lists how to reach us.

Set the key and make your first request

The API follows the OpenAI chat format. Two things change from a stock OpenAI setup: the base URL and the key. The model ID is uncensored, and authentication is a standard bearer header.

Environment variable

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

curl

curl https://api.gemmaapi.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Say hello in one sentence."}]
  }'

Python

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.gemmaapi.cc/v1",
    api_key=os.environ["API_KEY"],
)

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(resp.choices[0].message.content)

Node

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.gemmaapi.cc/v1",
  apiKey: process.env.API_KEY,
});

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Say hello in one sentence." }],
});
console.log(resp.choices[0].message.content);

If you get text back, you are done. The response headers also include X-Request-Id and X-Balance-USD, so you can see how much credit is left after each call. The quickstart in the docs has the same calls plus streaming and tools.

A short word on frontends. Chat apps and roleplay tools that accept a custom OpenAI-compatible endpoint need the same three values: the base URL, the key and the model ID. Paste them into the provider settings, press the connect or test button, and the tool will usually call the models endpoint for you. For creative-writing and companion apps for adults, that is the whole setup; nothing else on the server side needs to change.

Check that the key works with the models endpoint

The API has two methods: POST /v1/chat/completions and GET /v1/models. The second one is a cheap way to test a key without spending tokens on a completion.

curl https://api.gemmaapi.cc/v1/models \
  -H "Authorization: Bearer $API_KEY"

A list that includes uncensored means the key is accepted. A 401 means the key is wrong or has stray whitespace. Many tools call this endpoint when you add a custom provider, so a failure here usually explains a failure in the tool as well.

Only text is supported. There is no image, audio or video generation, no embeddings and no fine-tuning. If a client asks for an embeddings model during setup, it will not find one here.

Limits that apply to your key

Your first key will be a trial key, and the limits are tighter than on a funded account.

Key typeConcurrent requestsRequests per minute
Trial260
Full8300

Go over the per-minute cap and you get HTTP 429 with error code rate_limited. Have too many requests in flight and the code is concurrency. If the service is briefly overloaded, you also get a 429, this time with a Retry-After: 5 header, so wait five seconds and retry.

A detail that catches people: a streamed request keeps its concurrency slot until the stream ends. If you open two streams on a trial key and leave them idle, a third call will fail even though you are nowhere near 60 per minute. Close streams you no longer read.

Other limits: the context window is 100,000 tokens, counting prompt and completion together, and the maximum request body is 8 MB. The max_tokens parameter is optional.

Common problems and how to fix them

Most failed first requests come from a short list of mistakes. Work through it from the top.

  • 401 Unauthorized. The key is missing, truncated or has a trailing space or newline. Re-copy it, and print its length in your code to catch invisible characters.
  • 404 or a connection error. The base URL is wrong. It must end in /v1, and the client appends /chat/completions itself. Do not put the full path into the base URL field.
  • Model not found. The model ID is uncensored, in lowercase. Names such as a Gemma version string will not match, because this endpoint serves a single model.
  • 429 on the first calls. You are on a trial key with 2 concurrent requests. If your script fires ten calls at once, eight will be rejected. Run them in a loop or use a small worker pool of two.
  • Request too large. The body limit is 8 MB, and the prompt plus completion must fit in 100,000 tokens. Trim the input or split the job.

Everything is plain HTTP, so the fastest way to separate a client problem from a key problem is the curl call above. If curl works and your tool does not, the fault lies in the tool settings.

Moving from the trial to a funded key

The $0.50 trial is meant for testing. At the listed prices, it covers a lot of short requests (the pricing page has the numbers), but it expires after 7 days. When you are ready to keep going, add credit.

Top-ups are any whole amount from $20 to $500. Bigger top-ups carry a bonus: +5% from $50, +10% from $100 and +15% from $200. Payment is by by crypto (USDT on TRC20, USDC on Base). Credit is prepaid, there is no subscription, and the balance never expires. Failed or refused requests are not charged.

Once your balance is topped up, the key moves to the full limits of 8 concurrent requests and 300 requests per minute.

Keeping the key safe

  • Keep it on the server. Do not ship it in browser JavaScript or a mobile app bundle, where anyone can read it.
  • Do not commit it. Add the .env file to .gitignore before your first commit, not after.
  • Use a separate key for each environment where you can, so a leaked staging key does not touch production.
  • Watch X-Balance-USD in the response headers. A balance that drops faster than your traffic explains is the earliest sign of a leak.

Prompts are not used for training. The details of what is stored are on the privacy page.

Questions and answers

Is this the official Google Gemma API?

No. It is an independent OpenAI-compatible API serving one open-weight model under the ID uncensored. It is not the official API of Google or any other vendor.

Do I need a credit card to get a key?

No. You sign up with Google or with email and password, and the $0.50 trial is claimed with one click and needs no card.

How long does the trial credit last?

It is valid for 7 days from the claim, and each person can claim it once.

Which base URL and model name do I use?

Use https://api.gemmaapi.cc/v1 as the base URL and uncensored as the model ID, with an Authorization: Bearer header carrying your key.

Your key is one form away

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