Blog · 2026-07-13

Free Mistral API: Call Mistral and Codestral for Free

If you want a free Mistral API without pasting in a billing card or waiting on approval, you can reach Mistral and Codestral through the DreamPrompting gateway. It is a single OpenAI-compatible endpoint that routes your request across many providers and fails over automatically when one is busy. You send a normal chat completion, and the gateway picks a working backend for you.

This post shows how to call Mistral models for general chat and Codestral for coding, with a curl example, a Python example, and a way to list the live model ids. Every request needs an API key, and it is free: sign in with Google at the account page, copy the key, and send it as Authorization: Bearer YOUR_API_KEY. No credit card, and it takes seconds.

What Mistral and Codestral are good at

Mistral is a family of open-weight and hosted models that punch well above their size for everyday work. Through this free Mistral API you get access to the ones providers expose on their free tiers:

A simple rule of thumb: reach for Mistral when you want general chat and reasoning, and reach for Codestral when the task is code. You can also skip the decision entirely and let the gateway route by passing "model": "auto".

Call the free Mistral API with curl

The base URL is https://dreamprompting.com/api/v1 and the chat endpoint is POST /api/v1/chat/completions. Here is a minimal call using automatic routing:

curl https://dreamprompting.com/api/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [
      {"role": "user", "content": "Explain what a race condition is in two sentences."}
    ]
  }'

To target a specific family, set the model to a provider/model id (for example a Mistral or Codestral id from the models list below). If that exact backend is unavailable, "auto" is the most reliable choice because the gateway falls back on your behalf.

Python example with the OpenAI SDK

Because this free Mistral API is OpenAI-compatible, you can reuse the official OpenAI SDK. Just point base_url at the gateway and pass your free key. Here is a Codestral-style coding request:

from openai import OpenAI

client = OpenAI(
    base_url="https://dreamprompting.com/api/v1",
    api_key="YOUR_API_KEY",
)

resp = client.chat.completions.create(
    model="auto",
    messages=[
        {"role": "system", "content": "You are a helpful coding assistant."},
        {"role": "user", "content": "Write a Python function that reverses a linked list."},
    ],
)

print(resp.choices[0].message.content)

Want tokens as they arrive? Add stream=True to the call (or "stream": true in raw JSON) and iterate over the chunks, exactly as you would with any OpenAI-compatible client.

List the live Mistral and Codestral models

Exact model availability shifts as providers rotate their free tiers, so the honest advice is to check what is live before you hardcode an id. Query the models endpoint:

curl https://dreamprompting.com/api/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY"

The response lists the currently reachable model ids. Filter for names containing "mistral" or "codestral" and use one of those as your model value. You can also browse the same catalog visually on the models page, and check your usage window at GET /api/v1/quota.

Limits and fair use

This is genuinely free, funded by pooling providers' free tiers, so treat it as fair-use rather than an unlimited commercial pipe. The gateway allows up to 100 requests per minute per IP, plus a rolling 24 hour account quota of 5,000 requests and 500,000 tokens, which is plenty for building, testing, and light production. If a specific model is saturated, keep "auto" on so failover can keep your app responsive. Full details live in the API docs, and you can try prompts with no code at all in the chat playground.

FAQ

Is this really a free Mistral API? Yes, and the API key is free too. There is no card and no billing. Sign in with Google, copy the key, and put it in the key field your client already has.

Can I use Codestral for coding tasks? Yes. Codestral is a coding-focused model available through the providers. Use it for completion, refactoring, and code explanation, or pass "auto" and let the gateway route your coding prompt to a suitable backend.

What if a specific Mistral model is not available? Availability shifts over time. Call /api/v1/models for live ids, and default to "auto" so automatic failover picks a working provider without changing your code.

Start building for free

Grab your free key on the account page, point your OpenAI client at the gateway, and ship. Browse what is live on the models page and read the request and streaming reference in the API docs to get started in minutes with a free Mistral API.