> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hicap.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate speech

> 

Use a compatible Hicap model ID in the request body. Azure deployment IDs and api-version are not part of this route. Supported optional parameters depend on the model.

> [!NOTE]
>
> Choose an exact compatible ID from [the model list](https://docs.hicap.ai/api-reference/models.md). Supported parameters and output formats vary by model and connection; this schema does not guarantee every upstream feature. See [endpoint availability](https://docs.hicap.ai/api-reference/introduction.md#endpoint-availability).


## OpenAPI

````yaml post /audio/speech
openapi: 3.1.0
info:
  title: Hicap API
  description: >-
    OpenAI-compatible request reference. Authenticate using the api-key header.
    Listed paths and request shapes do not guarantee support for every model,
    connection, backend, or parameter; see
    https://docs.hicap.ai/api-reference/introduction.
  version: 1.0.0
  contact:
    name: Hicap Support
    email: support@hicap.ai
servers:
  - url: https://api.hicap.ai/v1
security:
  - apiKeyAuth: []
paths:
  /audio/speech:
    post:
      summary: Generates audio from the input text.
      description: >-


        Use a compatible Hicap model ID in the request body. Azure deployment
        IDs and api-version are not part of this route. Supported optional
        parameters depend on the model.
      operationId: Speech_Create
      parameters:
        - name: x-hicap-tags
          in: header
          required: false
          description: >-
            One JSON object mapping dimension keys to short string values. Never
            include secrets or direct personal identifiers. Opaque identity
            references require approved policy and verified destination
            handling; see the identity attribution guide.
          schema:
            type: string
          example: '{"feature":"support","env":"production"}'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createSpeechRequest'
      responses:
        '200':
          description: OK
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        default:
          description: >-
            Gateway or backend error. Body shape varies; inspect HTTP status
            before parsing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  message:
                    type: string
                  error:
                    type: object
                    additionalProperties: true
                additionalProperties: true
components:
  schemas:
    createSpeechRequest:
      type: object
      description: Speech request.
      properties:
        input:
          type: string
          minLength: 1
          description: Text to synthesize. Length limits depend on the selected model.
        voice:
          type: string
          description: >-
            A voice identifier supported by the selected model. Voice
            identifiers and availability are model-specific.
        response_format:
          type: string
          description: >-
            A supported audio output format; available formats depend on the
            model.
        speed:
          description: >-
            The speed of the synthesize audio. Select a value from `0.25` to
            `4.0`. `1.0` is the default.
          type: number
          default: 1
          minimum: 0.25
          maximum: 4
        model:
          type: string
          minLength: 1
          description: Exact compatible Hicap model ID from GET /v1/models.
      required:
        - input
        - voice
        - model
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: api-key
      description: Your Hicap API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.