Gemma api Quickstart Guide
Migrate your OpenAI-compatible code to an uncensored LLM with one base URL change. Our prepaid token model charges only for real usage, keeping costs transparent and predictable.
Authentication and base URL
Start by generating your key on the dashboard. Use the provided base URL to route requests to our uncensored model. Authentication relies on a standard header.
Base URL: HTTPS://api.apigemma.com/v1
Header: Authorization: Bearer YOUR_API_KEY
Only one active key per account. Replacing it revokes the old one immediately. No phone number is required for signup.
Chat completions endpoint
Send text prompts to the chat completions endpoint. The model returns text without content refusals for lawful adult use.
Context window: 100,000 tokens. Max output: 16,000 tokens. Errors and refusals cost nothing.
Supports function calling, JSON mode, and streaming via SSE.
Streaming responses with SSE
Enable streaming by setting the stream flag to true. Receive tokens in real-time via Server-Sent Events.
Token usage is reported in the final chunk. This is ideal for chat interfaces and voice synthesis pipelines.
Stream events are reliable and follow standard OpenAI formats.
JSON mode and function calling
Force structured output by setting response_format to json_object. This ensures consistent parsing for downstream applications.
Use tools for function calling. The model handles tool execution seamlessly.
Parameters like temperature and top_p control creativity and randomness.
Parameters: temperature, top_p, and seed
Control output variation with temperature (0-2), top_p (0-1), and seed for reproducibility.
Use stop sequences to truncate responses. presence_penalty and frequency_penalty reduce repetition.
These parameters work exactly like the OpenAI SDK.
Limits, errors, and context window
Rate limit: 300 requests/minute, 8 concurrent requests. Max body size: 8 MB.
401: Invalid key. 402: No credit. 429: Rate limit exceeded.
Context window is 100,000 tokens. Output max is 16,000 tokens.
cURL
curl https://api.apigemma.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Show me the gemma model weights config file"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.apigemma.com/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)Node.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.apigemma.com/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);Streaming
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)Common questions
How does the prepaid billing work?
Credit is charged by real token usage. Errors and refusals are free. Top-up is crypto only: USDT (TRC20) or USDC (Base), from $20 to $500.
Is the model uncensored?
Yes, it does not refuse lawful adult, fictional, or controversial topics. A hard limit applies to sexual content involving minors.
What is the context window?
100,000 tokens for prompt + completion. Max output per request is 16,000 tokens. Errors do not consume credit.
Get your key now
Sign up, grab your key, update your base URL. Setup is instant.