chenhg5/cc-connect · error

mimo tts API %d: %s

Error message

mimo tts API %d: %s

What it means

The MiMo TTS HTTP API returned a non-200 status during Synthesize. The error embeds the status code and a snippet of the response body so callers can distinguish auth failures, quota errors, and server-side faults.

Source

Thrown at core/tts.go:493

	if err != nil {
		return nil, "", fmt.Errorf("mimo tts: create request: %w", err)
	}
	// MiMo authenticates via "api-key" header, not "Authorization: Bearer".
	req.Header.Set("api-key", m.APIKey)
	req.Header.Set("Content-Type", "application/json")

	resp, err := m.Client.Do(req)
	if err != nil {
		return nil, "", fmt.Errorf("mimo tts: request: %w", err)
	}
	defer resp.Body.Close()

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		return nil, "", fmt.Errorf("mimo tts: read response: %w", err)
	}
	if resp.StatusCode != http.StatusOK {
		return nil, "", fmt.Errorf("mimo tts API %d: %s", resp.StatusCode, body)
	}

	var result struct {
		Choices []struct {
			Message struct {
				Audio struct {
					Data string `json:"data"`
				} `json:"audio"`
			} `json:"message"`
		} `json:"choices"`
		Error *struct {
			Message string `json:"message"`
			Type    string `json:"type"`
			Code    any    `json:"code"`
		} `json:"error"`
	}
	if err := json.Unmarshal(body, &result); err != nil {
		return nil, "", fmt.Errorf("mimo tts: parse response: %w", err)

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Check API key/quota on 401/403/429
  2. Inspect the embedded body; retry on transient 5xx
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at core/tts.go:493 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/42d41c95d6064fe5. Report an issue: GitHub.