---
title: "Gemini Text API"
method: POST
path: "/v1beta/models/{model}:{function}"
---

# Gemini Text API

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

## Path parameters

- `model` string, required
- `function` string, required

## Request body

- object — Use this field according to the endpoint schema.
  - `contents` object[], required — Use this field according to the endpoint schema.
    - `role` 'user' | 'model' — Use this field according to the endpoint schema.
    - `parts` object[] — Use this field according to the endpoint schema.
      - `text` string — Use this field according to the endpoint schema.
      - `inlineData` object — Use this field according to the endpoint schema.
      - `fileData` object — Use this field according to the endpoint schema.
      - `functionCall` object — Use this field according to the endpoint schema.
      - `functionResponse` object — Use this field according to the endpoint schema.
  - `systemInstruction` object — Use this field according to the endpoint schema.
    - `role` string — Use this field according to the endpoint schema.
    - `parts` object[]
      - `text` string
  - `tools` object[] — Use this field according to the endpoint schema.
  - `toolConfig` object — Use this field according to the endpoint schema.
  - `safetySettings` object[] — Use this field according to the endpoint schema.
    - `category` 'HARM_CATEGORY_HARASSMENT' | 'HARM_CATEGORY_HATE_SPEECH' | 'HARM_CATEGORY_SEXUALLY_EXPLICIT' | 'HARM_CATEGORY_DANGEROUS_CONTENT' | 'HARM_CATEGORY_CIVIC_INTEGRITY' — Use this field according to the endpoint schema.
    - `threshold` 'OFF' | 'BLOCK_NONE' | 'BLOCK_ONLY_HIGH' | 'BLOCK_MEDIUM_AND_ABOVE' | 'BLOCK_LOW_AND_ABOVE' — Use this field according to the endpoint schema.
  - `cachedContent` string — Use this field according to the endpoint schema.
  - `store` boolean — Use this field according to the endpoint schema.
  - `generationConfig` object — Use this field according to the endpoint schema.
    - `responseModalities` string[] — Use this field according to the endpoint schema.
    - `temperature` number — Use this field according to the endpoint schema.
    - `maxOutputTokens` integer — Use this field according to the endpoint schema.
    - `topP` number — Use this field according to the endpoint schema.
    - `topK` integer — Use this field according to the endpoint schema.
    - `stopSequences` string[] — Use this field according to the endpoint schema.
    - `seed` integer — Use this field according to the endpoint schema.
    - `presencePenalty` number — Use this field according to the endpoint schema.
    - `frequencyPenalty` number — Use this field according to the endpoint schema.
    - `responseMimeType` string — Use this field according to the endpoint schema.
    - `responseSchema` object — Use this field according to the endpoint schema.
    - `responseJsonSchema` unknown
    - `candidateCount` integer — Use this field according to the endpoint schema.
    - `thinkingConfig` object — Use this field according to the endpoint schema.
      - `includeThoughts` boolean — Use this field according to the endpoint schema.
      - `thinkingBudget` integer — Use this field according to the endpoint schema.
      - `thinkingLevel` 'MINIMAL' | 'LOW' | 'MEDIUM' | 'HIGH' — Use this field according to the endpoint schema.
    - `responseLogprobs` boolean — Use this field according to the endpoint schema.
    - `logprobs` integer — Use this field according to the endpoint schema.
    - `speechConfig` object — Use this field according to the endpoint schema.
    - `imageConfig` object — Use this field according to the endpoint schema.
      - `aspectRatio` string — Use this field according to the endpoint schema.
      - `imageSize` string — Use this field according to the endpoint schema.
    - `mediaResolution` 'MEDIA_RESOLUTION_LOW' | 'MEDIA_RESOLUTION_MEDIUM' | 'MEDIA_RESOLUTION_HIGH' — Use this field according to the endpoint schema.

## Response `200`

Use this field according to the endpoint schema.

- object
  - `candidates` object[] — Use this field according to the endpoint schema.
    - `content` object
      - `role` string — Use this field according to the endpoint schema.
      - `parts` object[] — Use this field according to the endpoint schema.
        - `text` string — Use this field according to the endpoint schema.
        - `thought` boolean — Use this field according to the endpoint schema.
    - `finishReason` 'STOP' | 'MAX_TOKENS' | 'SAFETY' | 'RECITATION' | 'LANGUAGE' | 'OTHER' | 'BLOCKLIST' | 'PROHIBITED_CONTENT' | 'SPII' | 'MALFORMED_FUNCTION_CALL' — Use this field according to the endpoint schema.
    - `tokenCount` integer — Use this field according to the endpoint schema.
    - `avgLogprobs` number — Use this field according to the endpoint schema.
    - `groundingMetadata` object — Use this field according to the endpoint schema.
    - `urlContextMetadata` object — Use this field according to the endpoint schema.
    - `citationMetadata` object — Use this field according to the endpoint schema.
    - `finishMessage` string — Use this field according to the endpoint schema.
    - `index` integer — Use this field according to the endpoint schema.
    - `safetyRatings` object[] — Use this field according to the endpoint schema.
      - `category` string
      - `probability` string
  - `usageMetadata` object — Use this field according to the endpoint schema.
    - `promptTokenCount` integer — Use this field according to the endpoint schema.
    - `cachedContentTokenCount` integer — Use this field according to the endpoint schema.
    - `candidatesTokenCount` integer — Use this field according to the endpoint schema.
    - `toolUsePromptTokenCount` integer — Use this field according to the endpoint schema.
    - `thoughtsTokenCount` integer — Use this field according to the endpoint schema.
    - `totalTokenCount` integer — Use this field according to the endpoint schema.
    - `promptTokensDetails` object[] — Use this field according to the endpoint schema.
      - `modality` string
      - `tokenCount` integer
    - `candidatesTokensDetails` object[] — Use this field according to the endpoint schema.
      - `modality` string
      - `tokenCount` integer
  - `modelVersion` string — Use this field according to the endpoint schema.
  - `responseId` string — Use this field according to the endpoint schema.
  - `modelStatus` object — Use this field according to the endpoint schema.
    - `modelStage` string — Use this field according to the endpoint schema.
    - `retirementTime` string — Use this field according to the endpoint schema.
    - `message` string — Use this field according to the endpoint schema.

---

[API](https://skmtc.net/deerapi/apis/text-to-audio-api.md) · [All operations](https://skmtc.net/deerapi/apis/text-to-audio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deerapi/text-to-audio-api/versions/b6265ced74a1/schema)
