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.
| Parameter | Details |
|---|---|
| Protocol | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Base URL | https://api.gemmaapi.top/v1 |
| Model ID | uncensored |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Authentication | Bearer token in the Authorization header |
| SSE streaming | Supported (stream: true), usage included at the end |
| Structured output | response_format: {"type": "json_object"} |
| Sampling parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Function calling | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| Completion length | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| Context window | 100,000 tokens, input and output combined |
| Rate limit | 300 requests per minute per key |
| Concurrency | up to 8 in parallel per key |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Max body | up to 8 MB per request |
| Token prices | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Payment | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| How you pay | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Subscription | paid 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-in | Google or e-mail and password |
| Key management | one active key per account; a new key replaces the old one |
| Content | adult content allowed; sexual content involving minors is refused |
HTTP errors
The type field is stable, the message is for humans. Errors cost nothing.
| HTTP | Type | What to do |
|---|---|---|
400 | bad_request | invalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | out of credit; add credit and retry |
403 | content_blocked | refused by the content policy |
404 | not_found | unknown endpoint |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | over 300/min or 8 parallel — back off and retry |
503 | upstream_busy | temporary overload, retry shortly |