Skip to content

Add baseUrl support to messages.tts.openai for custom/local TTS endpoints #34314

@Joakim-Emanuelson

Description

@Joakim-Emanuelson

Feature request

Problem:
messages.tts.openai accepts apiKey, model, and voice, but does not support a baseUrl (or baseURL) field to override the OpenAI TTS endpoint.

This prevents using OpenAI-compatible local TTS servers (e.g., Kokoro, Piper, or other self-hosted TTS behind an OpenAI-compatible API wrapper) through OpenClaw's built-in tts tool.

The ElevenLabs TTS config already supports baseUrl — the OpenAI TTS section does not.

Proposed solution:
Add an optional baseUrl field to messages.tts.openai:

{
  messages: {
    tts: {
      provider: "openai",
      openai: {
        apiKey: "local",
        baseUrl: "http://127.0.0.1:8190/v1",  // <-- new field
        model: "kokoro",
        voice: "onyx"
      }
    }
  }
}

Use case:
Running a local FastAPI server that implements POST /v1/audio/speech (matching OpenAI's TTS API) to serve locally-hosted TTS models (Kokoro, F5-TTS voice cloning, etc.) at zero cost and zero latency.

Current workaround:
Calling the local TTS server via exec/curl and sending the audio file manually, bypassing the built-in tts tool entirely.

Environment:

  • OpenClaw 2026.3.2
  • Config validation rejects baseUrl under messages.tts.openai as an unrecognized key

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions