API Quickstart: Connect Your Client to Our Uncensored Model
This quickstart shows how to point an OpenAI-compatible client at our uncensored text model. You need one base URL, one model id and your key.
Authentication and Base URL
Every request goes to https://doesgrokhaveanapi.com/v1 and carries your key in the Authorization header as a bearer token. Copy the key from the Get API key page; it is shown once you sign up, and you can replace it at any time.
Short and direct: the base URL and the key are the only two values that change when you move an existing client over.
curl https://api.doesgrokhaveanapi.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "What is the current API endpoint for the model?"}]
}'
The Chat Completions Endpoint
Send POST /v1/chat/completions with a list of messages. The response has the same shape as the OpenAI chat completions response, so existing parsers keep working.
- Use the role
userfor your prompt andsystemfor instructions. - Read the answer from
choices[0].message.content. - Token counts come back in
usage, and that is what your credit is charged for.
from openai import OpenAI
client = OpenAI(base_url="https://api.doesgrokhaveanapi.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)
Supported Model: 'uncensored'
Set the model field to uncensored. This is the only model id on the service, so there is nothing to choose. GET /v1/models returns it, which is a quick way to confirm that the key works.
The model is an open-weight model that runs on our own servers. It does not refuse lawful adult, fictional or controversial requests. The only hard limit is sexual content involving minors.
Streaming and Function Calling
Add stream: true to receive tokens as server-sent events. The final chunk carries the usage numbers, so you can log cost per request without a second call.
Function calling works through the standard tools and tool_choice fields. Define each function with a JSON schema and read the tool_calls array of the reply.
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)
Parameters: Temperature, Top P, and Stop
The supported sampling parameters are temperature, top_p, stop, seed, presence_penalty and frequency_penalty. Use a low temperature for code and extraction, and a higher one for fiction.
If you do not set max_tokens, the default output limit is 2,048 tokens. The hard maximum per request is 16,000 tokens.
JSON Mode and Response Formats
Set response_format to { 'type': 'json_object' } when you need machine-readable output. Ask for JSON in the prompt as well, because the model follows the instruction and the format together.
- Describe the fields you need in the system message.
- Keep the example short, two or three keys.
- Validate the result in your code before you store it.
Rate Limits and Error Handling
Each key may send 300 requests per minute and 8 requests at the same time. Requests with a body above 8 MB are rejected. A 401 means the key is wrong, a 402 means the credit has run out, and a 429 means you hit the rate limit: wait and retry with backoff.
Errors and refusals are not charged. Keep the context window of 100,000 tokens in mind for long threads: prompt and completion count together.
Node.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.doesgrokhaveanapi.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);Frequently asked questions
What base URL should I use?
Use https://doesgrokhaveanapi.com/v1 as the base URL. Any OpenAI-compatible SDK accepts it when you change the base URL and the key, and nothing else in your code needs to change.
Which model id do I send?
Send uncensored. It is the only model on the service. Call GET /v1/models to confirm the id and that your key is active before you run larger jobs.
Why does my request return 402?
A 402 response means the prepaid credit on the account is used up. Top up with USDT on TRC20 or USDC on Base from $20, and the next request goes through. Failed requests are not charged.
Your API key is one step away
Register, copy your token, update the endpoint. That’s the entire process.