openclaw - 💡(How to fix) Fix [Bug]: Mistral direct API works, but OpenClaw chat runs fail with 400 status code (no body) and appear to hang [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#57301Fetched 2026-04-08 01:51:22
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
commented ×2labeled ×2closed ×1locked ×1

When using Mistral through OpenClaw, chat runs fail with:

400 status code (no body)

From the user perspective, the chat appears to hang or produce no usable reply.

The same Mistral API key and model work correctly when tested directly against Mistral's API, so this looks like an OpenClaw runtime/request compatibility issue rather than an authentication problem.

Error Message

{ "subsystem": "agent/embedded", "event": "embedded_run_agent_end", "isError": true, "error": "400 status code (no body)", "failoverReason": null, "model": "mistral-large-latest", "provider": "mistral", "rawErrorPreview": "400 status code (no body)", }

Steps to reproduce

Steps to reproduce

  1. Configure Mistral as a provider in OpenClaw with a valid API key.
  2. Set the active/default model to mistral/mistral-large-latest.
  3. Restart the OpenClaw gateway so the updated provider config is loaded.
  4. Send a normal user message in chat (for example in Telegram / direct chat).
  5. Observe that the chat appears to hang or does not return a proper reply.
  6. Check the OpenClaw logs.
  7. Observe entries like:
    • provider: "mistral"
    • model: "mistral-large-latest"
    • error: "400 status code (no body)"

Control test

  1. Use the same Mistral API key directly against: https://api.mistral.ai/v1/chat/completions
  2. Send a very simple prompt such as: Reply with exactly: MISTRAL_OK
  3. Observe that the direct API call succeeds.

This shows that the credential and model are valid, while the OpenClaw runtime path still fails.

Expected behavior

If the same Mistral model and API key work directly, OpenClaw should also be able to complete normal chat runs successfully.

If the provider rejects something in the request, OpenClaw should ideally:

surface a more specific error and not leave the user with what looks like a hanging chat

Actual behavior

API key is configured and valid direct call to Mistral works provider/model path in config is structurally correct OpenClaw runtime path fails with 400 status code (no body) This suggests a request-shape / adapter / runtime compatibility problem in the OpenClaw -> Mistral path.

OpenClaw version

v2026.3.28

Operating system

Linux

Install method

No response

Model

mistral-large-latest

Provider / routing chain

openclaw

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Root Cause

When using Mistral through OpenClaw, chat runs fail with:

400 status code (no body)

From the user perspective, the chat appears to hang or produce no usable reply.

The same Mistral API key and model work correctly when tested directly against Mistral's API, so this looks like an OpenClaw runtime/request compatibility issue rather than an authentication problem.

Code Example

{
  "subsystem": "agent/embedded",
  "event": "embedded_run_agent_end",
  "isError": true,
  "error": "400 status code (no body)",
  "failoverReason": null,
  "model": "mistral-large-latest",
  "provider": "mistral",
  "rawErrorPreview": "400 status code (no body)",
}

### Steps to reproduce

## Steps to reproduce

1. Configure Mistral as a provider in OpenClaw with a valid API key.
2. Set the active/default model to `mistral/mistral-large-latest`.
3. Restart the OpenClaw gateway so the updated provider config is loaded.
4. Send a normal user message in chat (for example in Telegram / direct chat).
5. Observe that the chat appears to hang or does not return a proper reply.
6. Check the OpenClaw logs.
7. Observe entries like:
   - `provider: "mistral"`
   - `model: "mistral-large-latest"`
   - `error: "400 status code (no body)"`

## Control test

1. Use the same Mistral API key directly against:
   `https://api.mistral.ai/v1/chat/completions`
2. Send a very simple prompt such as:
   `Reply with exactly: MISTRAL_OK`
3. Observe that the direct API call succeeds.

This shows that the credential and model are valid, while the OpenClaw runtime path still fails.

### Expected behavior

If the same Mistral model and API key work directly, OpenClaw should also be able to complete normal chat runs successfully.

If the provider rejects something in the request, OpenClaw should ideally:

surface a more specific error
and not leave the user with what looks like a hanging chat

### Actual behavior

API key is configured and valid
direct call to Mistral works
provider/model path in config is structurally correct
OpenClaw runtime path fails with 400 status code (no body)
This suggests a request-shape / adapter / runtime compatibility problem in the OpenClaw -> Mistral path.

### OpenClaw version

v2026.3.28

### Operating system

Linux

### Install method

_No response_

### Model

mistral-large-latest

### Provider / routing chain

openclaw

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Summary

When using Mistral through OpenClaw, chat runs fail with:

400 status code (no body)

From the user perspective, the chat appears to hang or produce no usable reply.

The same Mistral API key and model work correctly when tested directly against Mistral's API, so this looks like an OpenClaw runtime/request compatibility issue rather than an authentication problem.

Environment

  • OpenClaw: v2026.3.28
  • Provider: mistral
  • Model: mistral-large-latest
  • Base URL: https://api.mistral.ai/v1
  • API mode: openai-completions

What I tested

Direct Mistral API call

Direct test against Mistral succeeds with the same API key and model.

Example direct test behavior:

  • request sent to Mistral official endpoint
  • response returned successfully
  • provider auth is working

OpenClaw runtime path

OpenClaw chat runs still fail, and the user-facing effect is that the chat appears to hang / not respond properly.

Actual behavior

OpenClaw logs show:

{
  "subsystem": "agent/embedded",
  "event": "embedded_run_agent_end",
  "isError": true,
  "error": "400 status code (no body)",
  "failoverReason": null,
  "model": "mistral-large-latest",
  "provider": "mistral",
  "rawErrorPreview": "400 status code (no body)",
}

### Steps to reproduce

## Steps to reproduce

1. Configure Mistral as a provider in OpenClaw with a valid API key.
2. Set the active/default model to `mistral/mistral-large-latest`.
3. Restart the OpenClaw gateway so the updated provider config is loaded.
4. Send a normal user message in chat (for example in Telegram / direct chat).
5. Observe that the chat appears to hang or does not return a proper reply.
6. Check the OpenClaw logs.
7. Observe entries like:
   - `provider: "mistral"`
   - `model: "mistral-large-latest"`
   - `error: "400 status code (no body)"`

## Control test

1. Use the same Mistral API key directly against:
   `https://api.mistral.ai/v1/chat/completions`
2. Send a very simple prompt such as:
   `Reply with exactly: MISTRAL_OK`
3. Observe that the direct API call succeeds.

This shows that the credential and model are valid, while the OpenClaw runtime path still fails.

### Expected behavior

If the same Mistral model and API key work directly, OpenClaw should also be able to complete normal chat runs successfully.

If the provider rejects something in the request, OpenClaw should ideally:

surface a more specific error
and not leave the user with what looks like a hanging chat

### Actual behavior

API key is configured and valid
direct call to Mistral works
provider/model path in config is structurally correct
OpenClaw runtime path fails with 400 status code (no body)
This suggests a request-shape / adapter / runtime compatibility problem in the OpenClaw -> Mistral path.

### OpenClaw version

v2026.3.28

### Operating system

Linux

### Install method

_No response_

### Model

mistral-large-latest

### Provider / routing chain

openclaw

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence

```shell

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

The fix involves modifying the OpenClaw request to match the expected format of the Mistral API.

  • Update the OpenClaw configuration to include the necessary headers and parameters for the Mistral API.
  • Modify the OpenClaw request to use the openai-completions endpoint correctly.

Example code changes:

# Update the request headers to include the API key
headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}

# Update the request parameters to match the Mistral API expectations
params = {
    'model': 'mistral-large-latest',
    'prompt': user_message
}

# Send the request to the Mistral API
response = requests.post('https://api.mistral.ai/v1/chat/completions', headers=headers, json=params)
  • Verify that the api_key variable is set to the correct value and that the user_message variable contains the user's input.

Verification

To verify that the fix worked, send a test message through the OpenClaw chat interface and check the response. The chat should no longer hang, and a proper reply should be returned.

  • Check the OpenClaw logs for any error messages.
  • Verify that the Mistral API is returning a successful response (

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If the same Mistral model and API key work directly, OpenClaw should also be able to complete normal chat runs successfully.

If the provider rejects something in the request, OpenClaw should ideally:

surface a more specific error and not leave the user with what looks like a hanging chat

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Mistral direct API works, but OpenClaw chat runs fail with 400 status code (no body) and appear to hang [2 comments, 2 participants]