openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/ai-text-to-speech-generator
info:
  title: Ultra-Natural Text-to-Speech API (Kokoro v1.0)
  description: Convert text to expressive, human-like speech in real time with
    Kokoro's advanced 82M parameter AIperfect for voice apps, content, and
    accessibility.
  version: f559560eb822dc509045f3921a1921234918b91739db4bf3daab2169b71c7a13
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            properties:
              loc:
                items:
                  anyOf:
                    - type: string
                    - type: integer
                title: Location
                type: array
              msg:
                title: Message
                type: string
              type:
                title: Error Type
                type: string
            required:
              - loc
              - msg
              - type
            title: ValidationError
            type: object
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    Input:
      properties:
        speed:
          default: 1
          description: Speech speed multiplier (0.5 = half speed, 2.0 = double speed)
          maximum: 5
          minimum: 0.1
          title: Speed
          type: number
          x-order: 2
          example: 1
        text:
          description: Text input (long text is automatically split)
          title: Text
          type: string
          x-order: 0
          example: Hi! I'm Kokoro, a text-to-speech voice crafted by hexgrad — based on
            StyleTTS2. You can also find me in Kuluko, an app that lets you
            create fully personalized audiobooks — from characters to storylines
            — all tailored to your preferences. Want to give it a go? Search for
            Kuluko on the Apple or Android app store and start crafting your own
            story today!
        voice:
          default: af_bella
          description: Voice to use for synthesis
          enum:
            - af_alloy
            - af_aoede
            - af_bella
            - af_jessica
            - af_kore
            - af_nicole
            - af_nova
            - af_river
            - af_sarah
            - af_sky
            - am_adam
            - am_echo
            - am_eric
            - am_fenrir
            - am_liam
            - am_michael
            - am_onyx
            - am_puck
            - bf_alice
            - bf_emma
            - bf_isabella
            - bf_lily
            - bm_daniel
            - bm_fable
            - bm_george
            - bm_lewis
            - ff_siwis
            - hf_alpha
            - hf_beta
            - hm_omega
            - hm_psi
            - if_sara
            - im_nicola
            - jf_alpha
            - jf_gongitsune
            - jf_nezumi
            - jf_tebukuro
            - jm_kumo
            - zf_xiaobei
            - zf_xiaoni
            - zf_xiaoxiao
            - zf_xiaoyi
            - zm_yunjian
            - zm_yunxi
            - zm_yunxia
            - zm_yunyang
          title: voice
          type: string
          x-order: 1
          example: af_nicole
      required:
        - text
      title: Input
      type: object
    Output:
      format: uri
      title: Output
      type: string
    PredictionRequest:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            speed:
              default: 1
              description: Speech speed multiplier (0.5 = half speed, 2.0 = double speed)
              maximum: 5
              minimum: 0.1
              title: Speed
              type: number
              x-order: 2
            text:
              description: Text input (long text is automatically split)
              title: Text
              type: string
              x-order: 0
            voice:
              default: af_bella
              description: Voice to use for synthesis
              enum:
                - af_alloy
                - af_aoede
                - af_bella
                - af_jessica
                - af_kore
                - af_nicole
                - af_nova
                - af_river
                - af_sarah
                - af_sky
                - am_adam
                - am_echo
                - am_eric
                - am_fenrir
                - am_liam
                - am_michael
                - am_onyx
                - am_puck
                - bf_alice
                - bf_emma
                - bf_isabella
                - bf_lily
                - bm_daniel
                - bm_fable
                - bm_george
                - bm_lewis
                - ff_siwis
                - hf_alpha
                - hf_beta
                - hm_omega
                - hm_psi
                - if_sara
                - im_nicola
                - jf_alpha
                - jf_gongitsune
                - jf_nezumi
                - jf_tebukuro
                - jm_kumo
                - zf_xiaobei
                - zf_xiaoni
                - zf_xiaoxiao
                - zf_xiaoyi
                - zm_yunjian
                - zm_yunxi
                - zm_yunxia
                - zm_yunyang
              title: voice
              type: string
              x-order: 1
          required:
            - text
          title: Input
          type: object
        output_file_prefix:
          title: Output File Prefix
          type: string
        webhook:
          format: uri
          maxLength: 65536
          minLength: 1
          title: Webhook
          type: string
        webhook_events_filter:
          default:
            - start
            - output
            - logs
            - completed
          items:
            description: An enumeration.
            enum:
              - start
              - output
              - logs
              - completed
            title: WebhookEvent
            type: string
          type: array
      title: PredictionRequest
      type: object
    PredictionResponse:
      properties:
        completed_at:
          format: date-time
          title: Completed At
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        error:
          title: Error
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            speed:
              default: 1
              description: Speech speed multiplier (0.5 = half speed, 2.0 = double speed)
              maximum: 5
              minimum: 0.1
              title: Speed
              type: number
              x-order: 2
            text:
              description: Text input (long text is automatically split)
              title: Text
              type: string
              x-order: 0
            voice:
              default: af_bella
              description: Voice to use for synthesis
              enum:
                - af_alloy
                - af_aoede
                - af_bella
                - af_jessica
                - af_kore
                - af_nicole
                - af_nova
                - af_river
                - af_sarah
                - af_sky
                - am_adam
                - am_echo
                - am_eric
                - am_fenrir
                - am_liam
                - am_michael
                - am_onyx
                - am_puck
                - bf_alice
                - bf_emma
                - bf_isabella
                - bf_lily
                - bm_daniel
                - bm_fable
                - bm_george
                - bm_lewis
                - ff_siwis
                - hf_alpha
                - hf_beta
                - hm_omega
                - hm_psi
                - if_sara
                - im_nicola
                - jf_alpha
                - jf_gongitsune
                - jf_nezumi
                - jf_tebukuro
                - jm_kumo
                - zf_xiaobei
                - zf_xiaoni
                - zf_xiaoxiao
                - zf_xiaoyi
                - zm_yunjian
                - zm_yunxi
                - zm_yunxia
                - zm_yunyang
              title: voice
              type: string
              x-order: 1
          required:
            - text
          title: Input
          type: object
        logs:
          default: ""
          title: Logs
          type: string
        metrics:
          title: Metrics
          type: object
        output:
          format: uri
          title: Output
          type: string
        started_at:
          format: date-time
          title: Started At
          type: string
        status:
          description: An enumeration.
          enum:
            - starting
            - processing
            - succeeded
            - canceled
            - failed
          title: Status
          type: string
        version:
          title: Version
          type: string
      title: PredictionResponse
      type: object
    Status:
      description: An enumeration.
      enum:
        - starting
        - processing
        - succeeded
        - canceled
        - failed
      title: Status
      type: string
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    WebhookEvent:
      description: An enumeration.
      enum:
        - start
        - output
        - logs
        - completed
      title: WebhookEvent
      type: string
    voice:
      description: An enumeration.
      enum:
        - af_alloy
        - af_aoede
        - af_bella
        - af_jessica
        - af_kore
        - af_nicole
        - af_nova
        - af_river
        - af_sarah
        - af_sky
        - am_adam
        - am_echo
        - am_eric
        - am_fenrir
        - am_liam
        - am_michael
        - am_onyx
        - am_puck
        - bf_alice
        - bf_emma
        - bf_isabella
        - bf_lily
        - bm_daniel
        - bm_fable
        - bm_george
        - bm_lewis
        - ff_siwis
        - hf_alpha
        - hf_beta
        - hm_omega
        - hm_psi
        - if_sara
        - im_nicola
        - jf_alpha
        - jf_gongitsune
        - jf_nezumi
        - jf_tebukuro
        - jm_kumo
        - zf_xiaobei
        - zf_xiaoni
        - zf_xiaoxiao
        - zf_xiaoyi
        - zm_yunjian
        - zm_yunxi
        - zm_yunxia
        - zm_yunyang
      title: voice
      type: string
  securitySchemes: {}
security: {}
paths:
  /predictions:
    post:
      summary: Create a prediction with jaaari/kokoro-82m
      description: Run inference with the jaaari/kokoro-82m model on API.market
      operationId: createKokoro_82mPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: f559560eb822dc509045f3921a1921234918b91739db4bf3daab2169b71c7a13
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: f559560eb822dc509045f3921a1921234918b91739db4bf3daab2169b71c7a13
                  input:
                    text: Hi! I'm Kokoro, a text-to-speech voice crafted by hexgrad — based on
                      StyleTTS2. You can also find me in Kuluko, an app that
                      lets you create fully personalized audiobooks — from
                      characters to storylines — all tailored to your
                      preferences. Want to give it a go? Search for Kuluko on
                      the Apple or Android app store and start crafting your own
                      story today!
                    speed: 1
                    voice: af_nicole
      responses:
        "201":
          description: Prediction created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the prediction
                  version:
                    type: string
                    description: Model version used for the prediction
                  status:
                    type: string
                    enum:
                      - starting
                      - processing
                      - succeeded
                      - failed
                      - canceled
                    description: Current status of the prediction
                  created_at:
                    type: string
                    format: date-time
                    description: When the prediction was created
              examples:
                success:
                  summary: Successful prediction creation
                  value:
                    id: ufawqhfynnddngldkgtslldrkq
                    version: f559560eb822dc509045f3921a1921234918b91739db4bf3daab2169b71c7a13
                    status: starting
                    created_at: 2025-05-18T08:04:46.184Z
        "400":
          description: Bad request, validation error
        "401":
          description: Unauthorized, invalid API token
    parameters:
      - &a1
        description: API.market API Key
        in: header
        name: x-api-market-key
        value: Please Login/Signup to get an API Key
        required: true
        schema:
          type: string
  /predictions/{id}:
    get:
      summary: Get prediction status and results
      description: Get the status and results of a jaaari/kokoro-82m prediction from
        API.market
      operationId: getKokoro_82mPrediction
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The prediction ID
      responses:
        "200":
          description: Prediction details
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the prediction
                  status:
                    type: string
                    enum:
                      - starting
                      - processing
                      - succeeded
                      - failed
                      - canceled
                    description: Current status of the prediction
                  output:
                    $ref: "#/components/schemas/Output"
                  error:
                    type: string
                    description: Error message if the prediction failed
                  created_at:
                    type: string
                    format: date-time
                    description: When the prediction was created
                  started_at:
                    type: string
                    format: date-time
                    description: When the prediction started processing
                  completed_at:
                    type: string
                    format: date-time
                    description: When the prediction completed
              examples:
                succeeded:
                  summary: Successful prediction result
                  value:
                    id: ufawqhfynnddngldkgtslldrkq
                    status: succeeded
                    output: https://replicate.delivery/czjl/ZpQ6y6VCoBZcDxuWJbp9rwXgTbUhgVUzwRn2iDiTXSxpZhCF/output.wav
                    created_at: 2023-01-01T12:00:00.000Z
                    started_at: 2023-01-01T12:00:05.000Z
                    completed_at: 2023-01-01T12:01:00.000Z
        "401":
          description: Unauthorized, invalid API token
        "404":
          description: Prediction not found
    parameters:
      - *a1
tags:
  - name: text-to-speech
    description: Operations related to text-to-speech
  - name: speech-to-text
    description: Operations related to speech-to-text
  - name: transcription
    description: Operations related to transcription
