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

# Gemini basic chat example

> Basic Gemini chat example using `generateContent`.

## Recommended endpoint

* [Gemini /v1beta/models/{model}:generateContent](/en/api-reference/endpoints/gemini/text)

## Minimal request

```json theme={null}
{
  "model": "gemini-2.5-flash",
  "systemInstruction": {
    "parts": [{ "text": "You are a concise assistant." }]
  },
  "contents": [
    {
      "role": "user",
      "parts": [{ "text": "Summarize ApiGo in three sentences." }]
    }
  ]
}
```

## cURL example

```bash theme={null}
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "systemInstruction": {
      "parts": [{ "text": "You are a concise assistant." }]
    },
    "contents": [
      {
        "role": "user",
        "parts": [{ "text": "Summarize ApiGo in three sentences." }]
      }
    ]
  }'
```

## Python example

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

client = genai.Client(api_key="<GEMINI_API_KEY>")

response = client.models.generate_content(
    model="gemini-2.5-flash",
    contents="Summarize ApiGo in three sentences.",
    config=types.GenerateContentConfig(
        system_instruction="You are a concise assistant."
    ),
)

print(response.text)
```

## Node.js example

```js theme={null}
import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const response = await ai.models.generateContent({
  model: "gemini-2.5-flash",
  contents: "Summarize ApiGo in three sentences.",
  config: {
    systemInstruction: "You are a concise assistant."
  }
});

console.log(response.text);
```

## Best practices

* Start with a Flash model for lower-latency chat
* Keep the `parts` model intact so media can be added later without redesign
* If you do not need extra reasoning cost, set `thinkingBudget` to `0` on Gemini 2.5 Flash
