openclaw - 💡(How to fix) Fix [Bug]: xAI TTS works with --gateway but times out in local execution

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…

xAI TTS local execution times out, but the same request succeeds when forced through the gateway.

This suggests that xAI TTS provider setup and OAuth are working, but the local execution path may have a timeout, event-loop, SSRF guard, or request execution issue.

Error Message

[fetch-timeout] fetch timeout after 30000ms (elapsed 51399ms) timer delayed 21399ms, likely event-loop starvation operation=fetchWithSsrFGuard url=https://api.x.ai/v1/tts Error: TTS conversion failed: xai: request timed out

Root Cause

xAI TTS local execution times out, but the same request succeeds when forced through the gateway.

This suggests that xAI TTS provider setup and OAuth are working, but the local execution path may have a timeout, event-loop, SSRF guard, or request execution issue.

Code Example

openclaw onboard --auth-choice xai-oauth

---

openclaw infer tts convert \
  --model xai/tts \
  --voice eve \
  --text "Hello." \
  --output hello.mp3

---

openclaw infer tts convert \
  --gateway \
  --model xai/tts \
  --voice eve \
  --text "Hello." \
  --output hello-gateway.mp3

---

curl -I https://api.x.ai/v1/tts

---

[fetch-timeout] fetch timeout after 30000ms (elapsed 51399ms) timer delayed 21399ms, likely event-loop starvation operation=fetchWithSsrFGuard url=https://api.x.ai/v1/tts
Error: TTS conversion failed: xai: request timed out

---

tts.convert via gateway
provider: xai
outputs: 1
/home/masakielastic/hello-gateway.mp3

---

HTTP/2 401
content-type: application/json
server: cloudflare
cf-ray: 9fdf45946facd555-NRT

---

openclaw onboard --auth-choice xai-oauth

---

eve

---

openclaw infer image generate \
  --model xai/grok-imagine-image-quality \
  --prompt "A retro Japanese travel poster of Ome Station" \
  --aspect-ratio 3:4 \
  --resolution 1K \
  --count 1

---
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

xAI TTS local execution times out, but the same request succeeds when forced through the gateway.

This suggests that xAI TTS provider setup and OAuth are working, but the local execution path may have a timeout, event-loop, SSRF guard, or request execution issue.

Steps to reproduce

  1. Complete xAI OAuth onboarding:
openclaw onboard --auth-choice xai-oauth
  1. Try xAI TTS with local execution:
openclaw infer tts convert \
  --model xai/tts \
  --voice eve \
  --text "Hello." \
  --output hello.mp3
  1. Try the same request with gateway execution:
openclaw infer tts convert \
  --gateway \
  --model xai/tts \
  --voice eve \
  --text "Hello." \
  --output hello-gateway.mp3
  1. Confirm basic network reachability:
curl -I https://api.x.ai/v1/tts

Expected behavior

Local execution should either:

  • successfully generate an audio file, like gateway execution does, or
  • fail quickly with a clear diagnostic explaining why local execution cannot be used.

Actual behavior

Local execution times out:

[fetch-timeout] fetch timeout after 30000ms (elapsed 51399ms) timer delayed 21399ms, likely event-loop starvation operation=fetchWithSsrFGuard url=https://api.x.ai/v1/tts
Error: TTS conversion failed: xai: request timed out

Gateway execution succeeds:

tts.convert via gateway
provider: xai
outputs: 1
/home/masakielastic/hello-gateway.mp3

Network reachability appears normal. curl -I https://api.x.ai/v1/tts returns HTTP 401, which is expected for an unauthenticated request:

HTTP/2 401
content-type: application/json
server: cloudflare
cf-ray: 9fdf45946facd555-NRT

OpenClaw version

OpenClaw 2026.5.18 (50a2481)

Operating system

Chromebook Crostini / Debian bookworm

Install method

npm / Node environment managed with mise

Model

xai/tts

Provider / routing chain

openclaw infer tts convert -> local execution times out

Additional provider/model setup details

xAI OAuth onboarding was completed using:

openclaw onboard --auth-choice xai-oauth

TTS voice used:

eve

The same xAI OAuth setup is also able to generate images through:

openclaw infer image generate \
  --model xai/grok-imagine-image-quality \
  --prompt "A retro Japanese travel poster of Ome Station" \
  --aspect-ratio 3:4 \
  --resolution 1K \
  --count 1

This suggests the issue is specific to the local xAI TTS execution path rather than xAI OAuth setup in general.

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No 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

Local execution should either:

  • successfully generate an audio file, like gateway execution does, or
  • fail quickly with a clear diagnostic explaining why local execution cannot be used.

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]: xAI TTS works with --gateway but times out in local execution