# gemini-3.5-flash · API guide

Use the exact API model ID `gemini-3.5-flash`. This guide describes the platform contract; check the live catalog before calling the model.

## Request example

The platform origin is filled in at build time. Set API_KEY to your server-side key before running.

```bash
curl "https://astralgames.ai/v1beta/models/gemini-3.5-flash:generateContent" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $API_KEY" \
  --data '{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Explain how an HTTP request works in three concise steps."
        }
      ]
    }
  ],
  "generationConfig": {
    "maxOutputTokens": 1024
  }
}'
```

## Protocol and response

This model uses the gemini protocol. Read its native response and usage fields; do not wrap the request in the media task input envelope.

Supported endpoint templates：

- `POST /v1beta/models/{model}:generateContent`
- `POST /v1beta/models/{model}:streamGenerateContent`
- `POST /v1/interactions`
- `POST /v1beta/interactions`

| Limit | Catalog value |
| --- | --- |
| Context tokens | 128000 |
| Maximum output tokens | 16384 |

For streaming, use the native protocol streaming option and parse its events; check supported capabilities in the live catalog.








<!-- official-reference:start -->
## Official sources and identity

Checked: 2026-09-27 · Platform model: `gemini-3.5-flash` · Official reference: `gemini-3.5-flash`

- [gemini-3.5-flash official reference](https://ai.google.dev/gemini-api/docs/models/gemini-3.5-flash)
- [Google GenerateContent API](https://ai.google.dev/api/generate-content)
<!-- official-reference:end -->

## Pricing and troubleshooting

Check current availability, contract and account pricing before integration. Keep request IDs and usage receipts when diagnosing errors. [Complete API reference](/docs/api)
