router-for-me/CLIProxyAPI · error · errUnsupportedSessionType

realtime_capability_not_supported

realtime_capability_not_supported

Error message

Realtime session type is not supported by the Codex OAuth upstream: %q

What it means

Error "Realtime session type is not supported by the Codex OAuth upstream: %q" thrown in router-for-me/CLIProxyAPI.

Source

Thrown at internal/client/codex/live/client_secret.go:338

	return time.Duration(expiresAfter.Seconds) * time.Second, nil
}

func normalizeClientSecretSession(session json.RawMessage) (json.RawMessage, json.RawMessage, error) {
	trimmedSession := strings.TrimSpace(string(session))
	if trimmedSession == "" || trimmedSession == "null" {
		session = json.RawMessage(`{"type":"realtime","model":"gpt-realtime"}`)
	}
	var clientSession map[string]any
	if errUnmarshal := json.Unmarshal(session, &clientSession); errUnmarshal != nil || clientSession == nil {
		return nil, nil, errors.New("session must be a valid JSON object")
	}
	sessionType, _ := clientSession["type"].(string)
	if strings.TrimSpace(sessionType) == "" {
		sessionType = "realtime"
		clientSession["type"] = sessionType
	}
	if sessionType != "realtime" {
		return nil, nil, fmt.Errorf("%w by the Codex OAuth upstream: %q", errUnsupportedSessionType, sessionType)
	}
	model, _ := clientSession["model"].(string)
	if strings.TrimSpace(model) == "" {
		model = "gpt-realtime"
		clientSession["model"] = model
	}
	clientEncoded, errMarshal := json.Marshal(clientSession)
	if errMarshal != nil {
		return nil, nil, fmt.Errorf("encode Realtime session: %w", errMarshal)
	}
	clientSession["model"] = codexRealtimeModel(model)
	upstreamEncoded, errMarshal := json.Marshal(clientSession)
	if errMarshal != nil {
		return nil, nil, fmt.Errorf("encode Codex Realtime session: %w", errMarshal)
	}
	return clientEncoded, upstreamEncoded, nil
}

View on GitHub (pinned to 78f0c4079e)

Solutions

  1. Use a Realtime session type supported by the Codex OAuth upstream.
  2. Remove or change the unsupported session type field in the request.

When it happens

Trigger: Thrown at internal/client/codex/live/client_secret.go:338 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of router-for-me/CLIProxyAPI@78f0c4079e (2026-08-15). Data as JSON: /api/errors/9377fe802742cd76. Report an issue: GitHub.