# Native Gemini Format

> Nano Series native Gemini format endpoint.

Canonical URL: https://docs.uniall.ai/models/image/nano-series/gemini-format
Locale: en

## Endpoint


```http
POST /v1beta/models/{modeName}:generateContent
```
## Header Parameters

| Name | Type | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `Authorization` | string | No | | Bearer &#123;your_token&#125; |
## Path Parameters

| Name | Type | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `modeName` | string | Yes | gemini-3-pro-image-preview-1k, gemini-3-pro-image-preview-2k, gemini-3-pro-image-preview-4k, gemini-3.1-flash-image-preview-512, gemini-3.1-flash-image-preview-1k, gemini-3.1-flash-image-preview-2k, gemini-3.1-flash-image-preview-4k | Model name: |
## Request Body Parameters

| Field | Type | Required | Title | Description |
| --- | --- | --- | --- | --- |
| `generationConfig.imageConfig.aspectRatio` | string | Yes | Ratio | Optional values:1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
| `generationConfig.imageConfig.outputFormat` | string | Yes | format | Optional values: jpeg, png |
| `contents` | array | No | Example field | Appears in a request example; no separate field description is provided. |
| `generationConfig` | object | No | Example field | Appears in a request example; no separate field description is provided. |

## Request Examples

### default

```json
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": " "
        }
      ]
    }
  ],
  "generationConfig": {
    "responseModalities": [
      "IMAGE"
    ]
  }
}
```

```bash
curl -X POST "{BASE_URL}/v1beta/models/{modeName}:generateContent" \
 -H "Authorization: Bearer sk-***" \
 -H "Content-Type: application/json" \
 -d '{"contents": [{"role": "user",
 "parts": [{"text": " "}]}],
 "generationConfig": {"responseModalities": ["IMAGE"]}}'
```
###

```json
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "[] HA[style], []and[]. [style]and[style].. "
        }
      ]
    }
  ],
  "generationConfig": {
    "responseModalities": [
      "IMAGE"
    ],
    "imageConfig": {
      "aspectRatio": "9:16",
      "imageSize": "1K"
    }
  }
}
```

```bash
curl -X POST "{BASE_URL}/v1beta/models/{modeName}:generateContent" \
 -H "Authorization: Bearer sk-***" \
 -H "Content-Type: application/json" \
 -d '{"contents": [{"role": "user",
 "parts": [{"text": "[] HA[style], []and[]. [style]and[style].. "}]}],
 "generationConfig": {"responseModalities": ["IMAGE"],
 "imageConfig": {"aspectRatio": "9:16",
 "imageSize": "1K"}}}'
```
### image editing

```json
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": " [] [] one[styledescription]. reserved [], [new /]"
        },
        {
          "inline_data": {
            "mime_type": "image/jpeg",
            "data": "image_base64"
          }
        }
      ]
    }
  ],
  "generationConfig": {
    "responseModalities": [
      "IMAGE"
    ],
    "imageConfig": {
      "aspectRatio": "9:16",
      "imageSize": "1K"
    }
  }
}
```

```bash
curl -X POST "{BASE_URL}/v1beta/models/{modeName}:generateContent" \
 -H "Authorization: Bearer sk-***" \
 -H "Content-Type: application/json" \
 -d '{"contents": [{"role": "user",
 "parts": [{"text": " [] [] one[styledescription]. reserved [], [new /]"},
 {"inline_data": {"mime_type": "image/jpeg",
 "data": "image_base64"}}]}],
 "generationConfig": {"responseModalities": ["IMAGE"],
 "imageConfig": {"aspectRatio": "9:16",
 "imageSize": "1K"}}}'
```
###

```json
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "useprovides image, [image2items in] [image1items in]. [image1items in]. [description]. "
        },
        {
          "inline_data": {
            "mime_type": "image/jpeg",
            "data": "image_base64_1"
          }
        },
        {
          "inline_data": {
            "mime_type": "image/jpeg",
            "data": "image_base64_2"
          }
        }
      ]
    }
  ],
  "generationConfig": {
    "responseModalities": [
      "IMAGE"
    ],
    "imageConfig": {
      "aspectRatio": "9:16",
      "imageSize": "1K"
    }
  }
}
```

```bash
curl -X POST "{BASE_URL}/v1beta/models/{modeName}:generateContent" \
 -H "Authorization: Bearer sk-***" \
 -H "Content-Type: application/json" \
 -d '{"contents": [{"role": "user",
 "parts": [{"text": "useprovides image, [image2items in] [image1items in]. [image1items in]. [description]. "},
 {"inline_data": {"mime_type": "image/jpeg",
 "data": "image_base64_1"}},
 {"inline_data": {"mime_type": "image/jpeg",
 "data": "image_base64_2"}}]}],
 "generationConfig": {"responseModalities": ["IMAGE"],
 "imageConfig": {"aspectRatio": "9:16",
 "imageSize": "1K"}}}'
```
## Response Fields

| Field | Type | Required | Title | Description |
| --- | --- | --- | --- | --- |


## Response Examples

### Success

```json
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {
            "inlineData": {
              "mimeType": "image/jpeg",
              "data": "image_base64"
            }
          }
        ]
      },
      "finishReason": "STOP",
      "safetyRatings": []
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 0,
    "candidatesTokenCount": 0,
    "totalTokenCount": 0
  }
}
```
