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

# Gemini Native Format

> Use the Gemini native interface (generateContent / streamGenerateContent) for conversation and multimodal interaction.

## Endpoints

| Purpose | Path |
| - | - |
| Text / multimodal generation | `POST /v1beta/models/{model}:generateContent` |
| Streaming output | `POST /v1beta/models/{model}:streamGenerateContent?alt=sse` |

The native interface supports `Authorization: Bearer <TOKEN>`, and also `x-goog-api-key: <TOKEN>`.

## Quick start

```bash theme={null}
curl -X POST "https://api.gregapi.com/v1beta/models/gemini-2.5-flash:generateContent" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [{"text": "Hello"}]}]
  }'
```

## Streaming output

```bash theme={null}
curl -N "https://api.gregapi.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [{"text": "Write a poem"}]}]
  }'
```

## Multimodal input

The native interface carries multimodal content through `contents[].parts[]`: text uses `text`, and media uses `inline_data` (`mime_type` + Base64 `data`).

### Audio understanding

```bash theme={null}
curl -X POST "https://api.gregapi.com/v1beta/models/gemini-2.5-flash:generateContent" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{
      "parts": [
        {"text": "Transcribe this audio"},
        {"inline_data": {"mime_type": "audio/mp3", "data": "<BASE64>"}}
      ]
    }]
  }'
```

Images similarly use `inline_data` with a `mime_type` of `image/png`, `image/jpeg`, and so on. The `gemini-3-pro-preview-file` model can analyze video files directly via URL; see the video analysis documentation for details.

## Reasoning

The Gemini 2.5 and 3 series support reasoning, configured through `generationConfig.thinkingConfig`.

The Gemini 3 series uses `thinkingLevel`:

```json theme={null}
{
  "generationConfig": {
    "thinkingConfig": {"thinkingLevel": "high"}
  }
}
```

The Gemini 2.5 series uses `thinkingBudget`:

```json theme={null}
{
  "generationConfig": {
    "thinkingConfig": {"thinkingBudget": 8192}
  }
}
```

## Generation parameters

| Parameter | Description | Default |
| - | - | - |
| `temperature` | Randomness, 0-2 | 1.0 |
| `max_tokens` | Maximum output tokens | Model default |
| `top_p` | Nucleus sampling probability | 0.95 |
| `stop` | Stop sequences | - |

Gemini 3 recommends keeping `temperature` at 1.0; too low a value may degrade reasoning.

## SDK example (Python · Google SDK)

```python theme={null}
from google import genai

client = genai.Client(
    api_key="your-token",
    http_options={"base_url": "https://api.gregapi.com"},
)

response = client.models.generate_content(
    model="gemini-2.5-flash",
    contents="Hello",
)
print(response.text)
```


## OpenAPI

````yaml openapi/llm-en.yaml POST /v1beta/models/{model}:generateContent
openapi: 3.0.3
info:
  title: GregAPI Large Language Models
  version: 1.0.0
  description: >-
    Large language model (LLM) endpoints behind the GregAPI unified gateway,
    covering general chat completion, multi-modal responses, and native
    message/generation protocols.
servers:
  - url: https://api.gregapi.com
security:
  - bearerAuth: []
paths:
  /v1beta/models/{model}:generateContent:
    post:
      summary: Gemini Native Format
      description: >-
        Use the Gemini native interface (generateContent) for conversation and
        multi-modal interaction, supporting text and multi-modal content
        generation.
      parameters:
        - name: model
          in: path
          required: true
          schema:
            type: string
            example: gemini-2.5-flash
          description: Model name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contents
              properties:
                contents:
                  type: array
                  description: Conversation content
                  items:
                    type: object
                    properties:
                      parts:
                        type: array
                        items:
                          type: object
                generationConfig:
                  type: object
                  description: Generation configuration, e.g. temperature, thinkingConfig
            example:
              contents:
                - parts:
                    - text: Hello
      responses:
        '200':
          description: Successful generation response
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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