# Gemini format

`POST /v1beta/models/{model}:generateContent`

Gemini audio generation endpoint.
Models such as `gemini-2.5-flash-preview-tts` can be used

## Authorizations

Bearer authentication — send `Authorization: Bearer <token>`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `model` | path | string | yes | Model name |

## Request Body (application/json)

```json
{
  "type": "object",
  "properties": {
    "contents": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "parts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "generationConfig": {
      "type": "object",
      "properties": {
        "responseModalities": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "speechConfig": {
          "type": "object",
          "properties": {
            "voiceConfig": {
              "type": "object",
              "properties": {
                "prebuiltVoiceConfig": {
                  "type": "object",
                  "properties": {
                    "voiceName": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "voiceName"
                  ]
                }
              },
              "required": [
                "prebuiltVoiceConfig"
              ]
            }
          },
          "required": [
            "voiceConfig"
          ]
        }
      },
      "required": [
        "responseModalities",
        "speechConfig"
      ]
    }
  },
  "required": [
    "contents",
    "generationConfig"
  ]
}
```

## Responses

### 200 — Success

```json
{
  "type": "object",
  "properties": {
    "candidates": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "content": {
            "type": "object",
            "properties": {
              "role": {
                "type": "string"
              },
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "finishReason": {
            "type": "string"
          },
          "safetyRatings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {}
            }
          }
        }
      }
    },
    "usageMetadata": {
      "type": "object",
      "properties": {
        "promptTokenCount": {
          "type": "integer"
        },
        "candidatesTokenCount": {
          "type": "integer"
        },
        "totalTokenCount": {
          "type": "integer"
        }
      }
    }
  }
}
```
