summaryrefslogtreecommitdiff
path: root/makima/src/server/openapi.rs
blob: 363d348ed2ee04ed938b20d47a086abf35674561 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;