EN ▾
Get API key

First request in five minutes

Connect your client to the uncensored endpoint in five minutes using standard OpenAI-compatible code. This guide covers authentication, chat completions, streaming, and function calling for the gemma api alternative.

Authentication Setup

Begin by visiting the Get API key page on this site. You can sign in using Google or create an account with an email and password. No phone number is required. Once registered, your API key is displayed immediately. There is no card to attach, and you receive $0.50 of trial credit valid for 7 days to test the endpoint. Claim this credit with one click on your API key page.

All requests must include your key in the Authorization header. The base URL for this service is https://api.gemmaapi.top/v1. Update your client configuration to point to this URL and set the model ID to uncensored. This is an independent service, not an official vendor page, and it runs a single open-weight model tuned for uncensored outputs.

Basic Chat Completion

Send a standard chat completion request to the /v1/chat/completions endpoint. The model responds with text input and text output. You can control the response style using parameters like temperature, top_p, stop, and seed. The context window supports 100,000 tokens total for prompt and completion. If you do not specify a maximum, the response can run to the end of the window.

curl https://api.gemmaapi.top/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
  }'

Ensure your request body matches the OpenAI format. The server processes the text and returns the generated completion. This works with any OpenAI-compatible SDK by simply changing the base URL and API key.

Streaming Responses

Enable streaming by setting stream: true in your request. The server sends Server-Sent Events (SSE) for each token generated. This allows your application to render text in real-time as it is produced. The final chunk in the stream contains the total token usage statistics for the request.

stream = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Tell the story in second person."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Streaming is useful for long responses or when latency matters. Each chunk contains partial text data. You must accumulate these chunks to reconstruct the full response. The billing is based on the total tokens used, not the number of chunks sent.

Function Calling

Define tools in your request using the tools parameter. The model can return structured arguments for these tools instead of plain text. Use tool_choice to force the model to call a specific function or to choose automatically. This feature allows your application to execute code or fetch data based on the model's output.

import OpenAI from "openai";

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

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);

Pass the tool definitions in the message history or as a separate parameter. The model will respond with a function call object. Your code should interpret this object and execute the corresponding action. The response format remains compatible with standard OpenAI SDKs.

JSON Mode

Force the model to output valid JSON by setting response_format to {"type": "json_object"}. This is useful when you need structured data for downstream processing. The model will attempt to format the response as a single JSON object. Errors may occur if the generated text does not parse correctly.

from openai import OpenAI

client = OpenAI(base_url="https://api.gemmaapi.top/v1", api_key="YOUR_KEY")

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)

Use JSON mode for tasks like data extraction, configuration generation, or API payloads. Combine it with function calling for robust structured outputs. The model is uncensored, so it will generate JSON even for complex or unusual topics without refusal.

Limits, Errors, and Context

Each API key is limited to 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB. If you exceed these limits, you will receive a 429 rate limit error. You can create a new key to replace the old one if needed, but only one active key is allowed per account.

Billing is prepaid by token usage. Errors and refusals are free. If you run out of credit, requests fail with a 402 error. The API key does not expire, but the trial credit expires after 7 days. Content refusals only apply to sexual content involving minors. All other lawful adult content is allowed.

Questions and answers

Does the API key expire?

The API key itself does not expire. However, the $0.50 trial credit provided to new accounts is valid for only 7 days. Claim this credit with one click on your API key page. Paid credit never expires.

What happens if I get a 401 error?

A 401 error indicates that the API key provided in the request is invalid or missing. Ensure you are using the key displayed immediately after signup.

Is this an official Gemma API?

No, this is an independent service. We are not an official vendor or partner. We host an uncensored model accessible via an OpenAI-compatible endpoint.

Your key is one form away

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

Technical reference

One table with every limit, feature and price that applies to your key.

ParameterDetails
ProtocolOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
Base URLhttps://api.gemmaapi.top/v1
Model IDuncensored
EndpointsPOST /v1/chat/completions · GET /v1/models
AuthenticationBearer token in the Authorization header
SSE streamingSupported (stream: true), usage included at the end
Structured outputresponse_format: {"type": "json_object"}
Sampling parameterstemperature, top_p, stop, seed and the two penalties are passed through
Function callingSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
Completion lengthup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
Context window100,000 tokens, input and output combined
Rate limit300 requests per minute per key
Concurrencyup to 8 in parallel per key
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Max bodyup to 8 MB per request
Token prices$0.15 per 1M input tokens · $0.50 per 1M output tokens
PaymentUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
How you paypay as you go from prepaid credit; nothing is charged for failed or refused requests
Subscriptionpaid credit never expires, no subscription
Trial credit$0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Bonus credit+5% from $50, +10% from $100, +15% from $200
Sign-inGoogle or e-mail and password
Key managementone active key per account; a new key replaces the old one
Contentadult content allowed; sexual content involving minors is refused

HTTP errors

The type field is stable, the message is for humans. Errors cost nothing.

HTTPTypeWhat to do
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedcheck the Authorization header or use your current key
402no_creditout of credit; add credit and retry
403content_blockedrefused by the content policy
404not_foundunknown endpoint
413request_too_largebody over 8 MB
429rate_limited · concurrencyover 300/min or 8 parallel — back off and retry
503upstream_busytemporary overload, retry shortly