Mistral API access, OpenAI-compatible — and its reasoning_effort

Mistral's models normally sit behind api.mistral.ai with their own key. Through DaoXE they ride the same OpenAI-compatible base URL as GPT, Claude and DeepSeek — one key spanning hundreds of models across roughly 25 providers.

Updated 2026-09-15

Mistral's families — the generalist Mistral line, the Codestral code models and more — normally want their own api.mistral.ai key. Through DaoXE they sit behind the same key as GPT, Claude and DeepSeek: one key across hundreds of models from roughly 25 providers. Call /v1/chat/completions with a Mistral-family ID from GET /v1/models — which exact Mistral IDs your account carries is a live-list question, not a given. Cost routing: cheapest APIs guide.

Call Mistral through DaoXE#

Chat path: /v1/chat/completions with Authorization: Bearer. Reasoning is a request parameter, not a separate model: send extra_body={"reasoning_effort": "high"} and the answer arrives as typed chunks instead of a plain string. Native-side, max_tokens shares the context window with the prompt — budget for thinking plus answer.

bash
curl --fail-with-body --show-error --silent \
  https://daoxe.com/v1/chat/completions \
  -H "Authorization: Bearer ${DAOXE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_EXACT_MODEL_ID",
    "max_tokens": 64,
    "messages": [{"role": "user", "content": "Say hello in one sentence."}]
  }'
python
# Mistral reasoning is a REQUEST PARAM (reasoning_effort), not a model switch.
# With effort set, message.content becomes a LIST of typed chunks
# ({"type": "thinking"}... then {"type": "text"}) instead of a plain string -
# parse both shapes, and replay the thinking chunks in multi-turn history.
from openai import OpenAI

client = OpenAI(base_url="https://daoxe.com/v1", api_key="YOUR_DAOXE_KEY")
r = client.chat.completions.create(
    model="YOUR_EXACT_MODEL_ID",   # a mistral-family id from GET /v1/models
    messages=[{"role": "user", "content": "2+2? Think briefly, then answer."}],
    max_tokens=2048,               # prompt + max_tokens must fit the context window
    extra_body={"reasoning_effort": "high"},   # non-standard: send via extra_body
)
msg = r.choices[0].message
content = msg.content
if isinstance(content, list):      # thinking chunks + text chunks
    for part in content:
        if getattr(part, "type", None) == "text":
            print(part.text)       # final answer
else:
    print(content)                 # plain string when effort is "none"

How Mistral exposes reasoning#

Mistral's current mechanism is the reasoning_effort parameter (none, minimal, low, medium, high, xhigh); the older native Magistral reasoning IDs are deprecated. With high, message.content becomes a list: {"type": "thinking"} chunks first, then the {"type": "text"} answer — with none it stays a plain string. Streaming splits the same way, so delta.content changes shape mid-stream. Two rules follow: parse content as either shape, and replay the thinking chunks in multi-turn history — Mistral warns that stripping them degrades the next answer. Whether a given relay path carries the parameter and preserves the list shape is exactly the kind of thing to verify — one test call before you commit a client.

Mistral-specific notes#

  • message.content changes shape. With reasoning_effort set high, content is a list of typed chunks (thinking first, then text); without it, a plain string. A client that assumes str breaks the moment thinking is enabled — parse both shapes.
  • Thinking tokens sit inside max_tokens. Mistral documents that prompt plus max_tokens must fit the model's context window — a reasoning request needs headroom for the thinking, not just the answer, or the reply comes back short.
  • Non-standard extras ride in extra_body. reasoning_effort, safe_prompt (injects a safety prompt before the conversation; default false), random_seed (Mistral's name for what OpenAI calls seed) and guardrails go beyond the OpenAI spec — send them through your SDK's extra-body escape hatch, and test that a relay forwards them instead of silently dropping unknown fields.
  • Aliases move; Magistral is deprecated. Native IDs come as -latest aliases plus dated snapshots, and Mistral publishes deprecation and retirement dates with named successors — the dedicated Magistral reasoning models are already deprecated, with reasoning folded into the main family via reasoning_effort. Copy IDs from GET /v1/models, not from old posts.

What it costs#

One balance, one top-up rate

Top-up runs at a flat 1 RMB = $1 of credit on every payment method, and each model then bills at its own USD rate — live per-model rates are on the live pricing page. That rate is the same on Alipay, WeChat Pay, USDT, bank card (Visa · Mastercard), Apple Pay and Google Pay — one balance, shared by every model in the catalog, with no plan to choose and no monthly minimum. Rates are account-scoped and do change, so confirm with one small top-up rather than trusting a number in a guide.

Verify you actually get the model#

Prove the endpoint works before blaming the client — if this fails, no setting will fix it:

bash
export DAOXE_API_KEY="your_api_key"

# List the exact model IDs your account can call
curl --fail-with-body --show-error --silent \
  https://daoxe.com/v1/models \
  -H "Authorization: Bearer ${DAOXE_API_KEY}"

Confirm connectivity, then diff a fixed prompt at temperature 0 against the official Mistral API to make sure the tier matches:

Verify us — don't trust us

Point the open benchmark at DaoXE and at the official API and compare at temperature 0. Then learn to detect model swapping so a cheaper endpoint can't quietly swap you to a smaller model.

Frequently asked questions#

How do I turn Mistral reasoning on or off?

Send reasoning_effort in the request body — none for a plain-string answer, high for a thinking chunk followed by the answer. It's a non-standard field, so use your SDK's extra-body option if there's no native slot.

Why is content sometimes a string and sometimes a list?

That's Mistral's reasoning shape: typed thinking/text chunks when effort is set, a plain string when it isn't. Parse for both, and replay the thinking chunks in your history.

Does Codestral's fill-in-the-middle endpoint work?

Native Mistral exposes POST /v1/fim/completions with prompt/suffix for Codestral — a specialty surface, not a standard OpenAI path. Whether a given relay carries it is a one-test-call question; check before wiring it into an IDE completion plugin.

How much does Mistral cost here?

Per-model, account-scoped — see live pricing. Top-up is a flat 1 RMB = $1 of credit on every payment method.

Try DaoXE — and benchmark it yourself

One key for GPT, Claude, Gemini, DeepSeek and more. Point the open benchmark at us and compare — don't take our word for it.