HTTPTextToSpeech.swift Swarm Framework OpenAI-compatible /audio/speech adapter.
// Source: https://github.com/christopherkarani/Swarm | License: MIT | Copyright 2025 Christopher Karani
// Provided via justclaw.it.com; keep this notice with the code.
// HTTPTextToSpeech.swift
// Swarm Framework
//
// OpenAI-compatible /audio/speech adapter.
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
/// Configuration for ``HTTPTextToSpeech``.
public struct HTTPSpeechSynthesisConfiguration: Sendable {
/// Full speech URL, including `/audio/speech`.
public var endpoint: URL
public var apiKey: String?
public var model: String
public var voice: String
public var session: URLSession
/// Creates an HTTP speech-synthesis configuration.
public init(
endpoint: URL,
apiKey: String? = nil,
mod
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key