MiniMax API Setup: Key, Base URL and First Request
This is a step-by-step setup for the OpenAI-compatible API on minimaxapikey.com: account, key, base URL, first request. It is an independent service, not the official API of any model vendor.
Updated

Key points
- Sign up with Google or email, then claim $0.50 of trial credit on the key page. No card is required.
- Base URL is https://api.minimaxapikey.com/v1, model ID is uncensored, auth is a Bearer key.
- Two methods exist: POST /v1/chat/completions and GET /v1/models.
- A 401 means a bad key, and a 429 means a limit was hit, so check the error code in the body.
What you are setting up
People search for minimax api setup expecting one of two things: the official MiniMax developer platform, or a drop-in OpenAI-style endpoint. This page covers the second. The service behind minimaxapikey.com is a hosted, OpenAI-compatible text API running a single open-weight model, operated by an independent provider. It is not the official API of MiniMax or of any other model vendor, and it does not route requests across vendors. If you need the vendor's own platform, use their site.
What you get is simple. Any OpenAI SDK or client works once you change the base URL and the key. There are two methods, POST /v1/chat/completions and GET /v1/models, one model ID, uncensored, and a 100,000-token context window shared by prompt and completion. It handles text only, so there is no image, audio or video generation, no embeddings and no fine-tuning. Streaming, tool calling and JSON mode are supported.
The whole setup takes a few minutes. The steps below go in order, and each one ends with a check so you know it worked before moving on.
Step 1 and 2: create an account and claim the trial
- Open the key page. Go to the API key page and sign up. You can use Google, or an email address and password.
- Claim the trial credit. After sign-up, the key page has a button for $0.50 of trial credit. It is one click, needs no card, is valid for 7 days, and is limited to one per person.
The trial is small on purpose. At $0.15 per 1M input tokens and $0.50 per 1M output tokens, $0.50 covers a good number of test requests. A prompt of 1,000 tokens with a 500-token answer costs $0.00015 for input plus $0.00025 for output, which is $0.0004. Dividing $0.50 by that gives 1,250 such requests, so you have plenty of room to experiment.
Note the trial key limits: 2 concurrent requests and 60 requests per minute. A full key, which you get once you have topped up, allows 8 concurrent requests and 300 per minute. If your test loop runs in parallel and you see 429 errors, this is the first thing to check.
Step 3: create the key and store it safely
On the same page, create an API key and copy it. Treat it like a password. Put it in an environment variable or a secrets manager, never in a repository, a front-end bundle or a screenshot. If a key leaks, remove it and create a new one.
# macOS / Linux
export UNCENSORED_KEY="paste-your-key-here"
# Windows PowerShell
$env:UNCENSORED_KEY = "paste-your-key-here"
Server-side code should read the variable at runtime. Browser code should never hold the key at all: send requests from your backend instead, because anything shipped to a browser is visible to every visitor.
Step 4: list models to confirm the key
The cheapest possible test is the models endpoint. It generates no text, so it is a clean check of the key, the URL and your network.
curl -s https://api.minimaxapikey.com/v1/models \
-H "Authorization: Bearer $UNCENSORED_KEY"
You should get a JSON list that includes uncensored. If you get a 401, the key is wrong or has a stray space or quote around it. If the connection fails, check that the URL ends in /v1 and that you used https.
Step 5: send the first chat request
Now a real completion. The body is the standard chat completions shape.
curl -s https://api.minimaxapikey.com/v1/chat/completions \
-H "Authorization: Bearer $UNCENSORED_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [
{"role": "user", "content": "Explain what an API key is in two sentences."}
],
"temperature": 0.7
}'
The reply contains choices[0].message.content and a usage block with prompt and completion token counts. Look at the response headers too, with curl -i. You will see X-Request-Id, which support can use to find your request, X-Balance-USD, your remaining credit, and the rate limit headers X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency.
Parameters such as temperature, top_p, stop, seed and the penalties are passed through. max_tokens is optional. If you leave it out, the completion can use whatever remains of the window.
Step 6: the same call from an SDK
Once curl works, move to the language you will actually use. Only two arguments change from a stock OpenAI setup.
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.minimaxapikey.com/v1",
api_key=os.environ["UNCENSORED_KEY"],
)
reply = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Give me three names for a hiking app."}],
)
print(reply.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.minimaxapikey.com/v1",
apiKey: process.env.UNCENSORED_KEY,
});
const reply = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Give me three names for a hiking app." }],
});
console.log(reply.choices[0].message.content);
For streaming, add stream: true and read the server-sent events. Usage numbers arrive at the end of the stream. The docs page covers streaming, tool calling and JSON mode with response_format: {"type":"json_object"}.
Moving an existing OpenAI project over
Most of the time the project you want to connect already works with OpenAI's client library. In that case you rarely edit code at all. The official SDKs read the environment variables OPENAI_API_KEY and OPENAI_BASE_URL when you do not pass arguments, so a deployment change can be enough.
export OPENAI_BASE_URL="https://api.minimaxapikey.com/v1"
export OPENAI_API_KEY="paste-your-key-here"
# then in your code, request model "uncensored"
The one edit left is the model name. A string such as an OpenAI model ID will not exist here, so replace it with uncensored, ideally through a config value so you can switch back. Then read through the code for features the service does not offer. Image generation, audio, embeddings and fine-tuning are not available, because this is a text-only chat API. If your app calls embeddings for search, you will need another provider for that part and can keep chat on this one.
It also helps to know what the model is. It is a single open-weight model, tuned to answer without content refusals for lawful adult use, and one hard limit applies regardless of settings: no sexual content involving minors. Prompts written for another model may need small adjustments, since each model reacts differently to the same system prompt. Run your own test prompts side by side before you switch real traffic.
Settings worth choosing on day one
A few decisions are easier to make at setup time than after launch. None of them is difficult, but each one avoids a surprise later.
- A system prompt. Put your instructions about tone, format and role in a
systemmessage. Keep it short and specific, because every request repeats it as input tokens. - A token cap.
max_tokensis optional, but a cap is a cheap safeguard. Without one a single answer may use the remainder of the 100,000-token window. - Streaming for interactive use. Set
stream: trueif a person is waiting on the reply. For batch jobs, plain requests are simpler. - A retry rule for 429. Treat 429 as a signal to wait, not as a failure. When the response includes
Retry-After: 5, sleeping that long and retrying is the right move. - Request size. The body limit is 8 MB. That is far more than a normal prompt needs, but pasted logs or documents can reach it.
Prompts are not used for training, which matters if you plan to send internal documents or user messages. You are still the one responsible for what you send, so avoid putting secrets that the model does not need into a prompt.
Topping up after the trial
The trial is for checking that everything works. When you are ready to build, add prepaid credit. There is no subscription: you pay for tokens used, at $0.15 per 1M input tokens and $0.50 per 1M output tokens, and credit never expires, so an unused balance does not vanish at the end of a month.
Any whole amount from $20 to $500 works. A $50 top-up adds a 5% bonus, $100 adds 10%, and $200 adds 15%. As a quick example, a $100 top-up with its 10% bonus gives $110 of credit. At the 1,000-token prompt and 500-token answer from step two, each request costs $0.0004, so $110 covers 275,000 requests. Real prompts are usually longer, so scale that figure to your own average.
Fixing common setup errors
| Symptom | Likely cause | Fix |
|---|---|---|
| 401 on every call | Missing, mistyped or revoked key | Send Authorization: Bearer <key>, with no extra quotes |
| 404 or HTML response | Wrong path, usually a missing /v1 | Use the full base URL ending in /v1 |
| Model not found | A model name copied from another provider | Use uncensored |
429 with rate_limited | Over the requests-per-minute cap | Slow down, or top up to move from trial limits to full limits |
429 with concurrency | Too many requests at once | Cap parallel calls at 8 (2 on a trial key) |
429 with Retry-After: 5 | Temporary overload | Wait 5 seconds and retry |
| 413 or body rejected | Request over 8 MB | Trim the prompt or split the job |
When you are ready for more than the trial, the pricing page lists the top-up options: any whole amount from $20 to $500, paid by crypto (USDT on TRC20, USDC on Base), with a 5% bonus from $50, 10% from $100 and 15% from $200. Failed or refused requests are not charged, and prompts are not used for training.
More guides
Questions and answers
Is this the official MiniMax API?
No. It is an independent, hosted, OpenAI-compatible API that serves one open-weight model, tuned to answer without content refusals for lawful adult use. It is not the official API of any model vendor and not a router across vendors.
Do I need a credit card to try it?
No. After sign-up you can claim $0.50 of trial credit with one click on the API key page. It is valid for 7 days and is limited to one per person.
What is the model name to use in requests?
Use uncensored. The service exposes this single model ID, and GET /v1/models will show it.
How do I add more credit later?
Top up any whole amount from $20 to $500. Bonuses apply from $50 (+5%), $100 (+10%) and $200 (+15%), and credit never expires.
Can I use the OpenAI SDK?
Yes. Set base_url to https://api.minimaxapikey.com/v1, use your key, and send model uncensored. Nothing else in your code has to change.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.