summaryrefslogtreecommitdiff
path: root/makima/src/server/openapi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/server/openapi.rs')
-rw-r--r--makima/src/server/openapi.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/makima/src/server/openapi.rs b/makima/src/server/openapi.rs
new file mode 100644
index 0000000..363d348
--- /dev/null
+++ b/makima/src/server/openapi.rs
@@ -0,0 +1,34 @@
+//! OpenAPI documentation configuration using utoipa.
+
+use utoipa::OpenApi;
+
+use crate::server::handlers::{listen, tts};
+use crate::server::messages::{ApiError, AudioEncoding, StartMessage, StopMessage, TranscriptMessage};
+
+#[derive(OpenApi)]
+#[openapi(
+ info(
+ title = "Makima Audio API",
+ version = "1.0.0",
+ description = "Streaming audio APIs for speech-to-text and text-to-speech with voice cloning.",
+ license(name = "MIT"),
+ ),
+ paths(
+ listen::websocket_handler,
+ tts::synthesize_handler,
+ ),
+ components(
+ schemas(
+ ApiError,
+ AudioEncoding,
+ StartMessage,
+ StopMessage,
+ TranscriptMessage,
+ )
+ ),
+ tags(
+ (name = "STT", description = "Speech-to-text streaming endpoints"),
+ (name = "TTS", description = "Text-to-speech synthesis endpoints"),
+ )
+)]
+pub struct ApiDoc;