EN ▾
Get API key

Mistral API Key: Get, Store and Use One Safely

Updated

A key for this service comes from a short sign-up on this site, not from the vendor whose name is in the search. Here is how to get it, keep it safe and check that it works.

Key points

  • Sign up with Google or email, then open the API key page to create your key.
  • The one-click $0.50 trial lasts 7 days, needs no card and is limited to one per person.
  • Keep the key in an environment variable, never in code or a public repository.
  • Every response carries X-Balance-USD, so you can watch your credit from the client.
Brass key beside a glowing vault door with floating tokens, illustrating API key setup and security

Which key are we talking about

People who type mistral api key into a search box usually want one of two things: the key for the vendor's own platform, or a key for any endpoint that accepts Mistral-style chat calls. This site covers the second case. It is an independent host of one open-weight model, run by an independent provider and tuned to answer without content refusals for lawful adult use. It is not the official API of Mistral or of any other company, and a key from one will not work on the other.

That separation is useful to know before you paste anything anywhere. A key issued here authenticates only against https://api.mistraluncensored.top/v1. If you already hold a key from another service, keep it where it is and treat the new one as a separate credential with its own balance.

Get your key in five steps

  1. Open the API key page and choose sign-up. You can register with Google, or with an email address and a password.
  2. Confirm your account and sign in. The key page shows your account state and your balance.
  3. Create the key and copy it once into a password manager or a secrets file. Do not paste it into a chat, a ticket or a screenshot.
  4. Optionally claim the trial credit with the one-click button on the same page.
  5. Run the curl test in the section below to confirm that it authenticates.

The whole flow takes a few minutes. There is no waiting list and no sales call. If something on the page does not behave as described, the support page lists how to reach the operators.

Trial credit versus a funded key

New users can claim $0.50 of trial credit with one click on the key page after sign-up. It is one claim per person, it is valid for 7 days, and it needs no card. That is enough to test integration code, try a few prompts and see how the output reads before you spend anything.

The trial key is also slower by design. The table shows the difference.

ItemTrial keyFull key
Concurrent requests28
Requests per minute60300
Credit$0.50, valid 7 daysPrepaid, never expires
Card neededNoOnly if you top up

To move to a full key, top up with any whole amount from $20 to $500. A bonus applies at three levels: +5% from $50, +10% from $100 and +15% from $200. So a $100 top-up gives you $110 of credit, and $200 gives you $230. You can pay with crypto (USDT on TRC20 or USDC on Base). Billing is pay as you go at $0.15 per 1M input tokens and $0.50 per 1M output tokens, with no subscription, and the credit does not expire. Failed or refused requests are not charged. See the pricing page for examples.

Store the key where code cannot leak it

Most leaked keys come from the same three mistakes: a hard-coded string committed to Git, a key pasted into a front-end script that every visitor can read, and a key shared in a screenshot. None of them need clever attackers. Scrapers watch public repositories for key-shaped strings all day.

Local development

Put the key in a file named .env, add .env to .gitignore before your first commit, and load it at startup. In a shell, export API_KEY=... does the same for a single session.

import os
from openai import OpenAI

# the key comes from the environment, never from the source file
client = OpenAI(
    base_url="https://api.mistraluncensored.top/v1",
    api_key=os.environ["API_KEY"],
)

r = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Say hello in five words."}],
)
print(r.choices[0].message.content)

Servers and apps

On a server, use your host's secret store or environment settings. For a web or mobile product, never call the API from the browser or the app binary. Put a small backend in between, authenticate your own users there, and let only that backend hold the key. This also lets you add your own per-user limits so one heavy user cannot drain the balance.

If a key leaks

Stop using it, move to a fresh credential and contact the operators through the support page with the approximate time of exposure. Check your balance afterward. Because credit is prepaid, the worst case is bounded by what you have loaded, which is one more reason not to top up far beyond what you will use.

Test the key with curl

Authentication is a standard bearer header: Authorization: Bearer <key>. The simplest check lists the models, which costs nothing.

# list models: the ID to use in requests is "uncensored"
curl -s https://api.mistraluncensored.top/v1/models \
  -H "Authorization: Bearer $API_KEY"

A valid key returns a JSON list that includes the model ID uncensored. Now send a real chat request and print the headers, so you can see the balance.

curl -i https://api.mistraluncensored.top/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Reply with the word ready."}],
    "max_tokens": 10
  }' 

Look at the response headers. X-Balance-USD shows your remaining credit, X-Request-Id identifies the call (quote it if you contact support), and the two X-RateLimit-Limit-* headers show the request and concurrency limits attached to your key. They are a quick way to confirm if the key is a trial or a full one.

Using the key in other tools

Anything that accepts an OpenAI-style configuration takes the same three values: base URL, key and model. In SillyTavern you add a custom OpenAI-compatible chat source. In LangChain or LlamaIndex you set the base URL and key on the OpenAI client class. In a plain Node script it looks like this.

import OpenAI from "openai";

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

const r = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Name three harbor towns." }],
});
console.log(r.choices[0].message.content);

Keep one key per project when you can. If a hobby bot misbehaves, you will know which deployment is responsible for the spend, and you can remove its access without breaking your main application. For endpoint details and a SillyTavern walkthrough, see the docs.

Common key problems and fixes

  • The call is rejected as unauthorized. Check for a trailing newline or space copied with the key, a missing Bearer prefix, or a key from a different service.
  • The call fails in the browser but works in curl. Browsers block cross-origin calls to many APIs and expose your key. Move the call to a backend.
  • HTTP 429. The code rate_limited means too many requests per minute, and concurrency means too many at once. A trial key allows 2 at once, so a script that fires four calls together will trip it. On temporary overload the reply carries Retry-After: 5.
  • The balance drops faster than expected. Long chat histories are sent as input on every turn. Trim old messages and set max_tokens. A call with 20,000 input tokens and 1,000 output tokens costs $0.003 + $0.0005 = $0.0035.
  • The trial credit vanished. It is valid for 7 days from the claim. After that, top up from $20.

One boundary to remember: the service refuses sexual content involving minors, and no key or plan changes that. Prompts are not used for training. For how the model compares with what you may have expected from the vendor, read the Mistral API explainer.

01

Questions and answers

Does a key from the vendor's own platform work here?

No. This is an independent service with its own accounts and balance. Keys do not transfer in either direction.

Do I need a card to get a key?

No. Sign-up is with Google or with email and password, and the $0.50 trial credit needs no card. A card is not accepted for top-ups; only crypto (USDT on TRC20, USDC on Base) is available.

How many keys can I have?

The key page is the authority on that, so check it after sign-up. The trial credit itself is limited to one per person.

What should I send in the Authorization header?

Send Authorization: Bearer followed by your key, on every request to the chat completions and models routes.

Your key is one form away

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

Get API key