Now 'data' is a Python dictionary or lis·续

</details>

<details>

<summary>Creative Writing — Higher temperature for creative output</summary>

const response = await env.AI.run(
  'google/gemini-3-flash',
  {
    contents: [
      {
        parts: [{ text: 'Write a short story opening about a detective finding an unusual clue.' }],
        role: 'user',
      },
    ],
    generationConfig: { maxOutputTokens: 4096, temperature: 0.8 },
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "google/gemini-3-flash",
  "input": {
    "contents": [
      {
        "parts": [
          {
            "text": "Write a short story opening about a detective finding an unusual clue."
          }
        ],
        "role": "user"
      }
    ],
    "generationConfig": {
      "maxOutputTokens": 4096,
      "temperature": 0.8
    }
  }
}'
The humidity in the room was wrong. That was the first thing Detective Elias Thorne noticed. It wasn’t the metallic tang of blood or the heavy stillness of a man who had stopped breathing three hours ago. It was the smell of a thunderstorm in a room with no open windows.

Julian Vane, a man who had made millions selling security software, sat slumped in his designer leather chair. His throat had been opened with surgical precision, but Thorne’s eyes didn't linger on the gore. They were drawn to the mahogany desk, where a small, silver saucer sat perfectly centered.

In the middle of the saucer was a single, glowing sugar cube.

Thorne leaned in, his shadow stretching long across the Persian rug. He didn’t reach for his tweezers yet. The cube wasn't just white; it pulsed with a soft, rhythmic violet light, timed exactly to the pace of a resting human heartbeat.

"Miller," Thorne called out without looking back at his partner. "Tell me the victim had a penchant for bioluminescent snacks."

"He was a hedge fund manager, Elias," Miller replied, snapping photos of the entryway. "The most exotic thing he consumed was unpasteurized goat cheese."

Thorne pulled a magnifying loupe from his coat pocket. As he peered through the glass, his breath hitched. Inside the crystalline structure of the sugar, frozen like a prehistoric insect in amber, was a microscopic set of brass gears. They were no larger than a grain of dust, and they were turning slowly in reverse.

It wasn't just a clue. It was a piece of machinery that shouldn't exist, ticking away inside a condiment.

"Get the lead-lined evidence bag," Thorne whispered, the hair on his arms standing up as the violet pulse of the cube suddenly skipped a beat, matching his own racing heart. "I don't think we're looking for a murderer anymore. I think we're looking for a clockmaker."
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {
            "text": "The humidity in the room was wrong. That was the first thing Detective Elias Thorne noticed. It wasn’t the metallic tang of blood or the heavy stillness of a man who had stopped breathing three hours ago. It was the smell of a thunderstorm in a room with no open windows.\n\nJulian Vane, a man who had made millions selling security software, sat slumped in his designer leather chair. His throat had been opened with surgical precision, but Thorne’s eyes didn't linger on the gore. They were drawn to the mahogany desk, where a small, silver saucer sat perfectly centered.\n\nIn the middle of the saucer was a single, glowing sugar cube.\n\nThorne leaned in, his shadow stretching long across the Persian rug. He didn’t reach for his tweezers yet. The cube wasn't just white; it pulsed with a soft, rhythmic violet light, timed exactly to the pace of a resting human heartbeat. \n\n\"Miller,\" Thorne called out without looking back at his partner. \"Tell me the victim had a penchant for bioluminescent snacks.\"\n\n\"He was a hedge fund manager, Elias,\" Miller replied, snapping photos of the entryway. \"The most exotic thing he consumed was unpasteurized goat cheese.\"\n\nThorne pulled a magnifying loupe from his coat pocket. As he peered through the glass, his breath hitched. Inside the crystalline structure of the sugar, frozen like a prehistoric insect in amber, was a microscopic set of brass gears. They were no larger than a grain of dust, and they were turning slowly in reverse.\n\nIt wasn't just a clue. It was a piece of machinery that shouldn't exist, ticking away inside a condiment. \n\n\"Get the lead-lined evidence bag,\" Thorne whispered, the hair on his arms standing up as the violet pulse of the cube suddenly skipped a beat, matching his own racing heart. \"I don't think we're looking for a murderer anymore. I think we're looking for a clockmaker.\"",
            "thoughtSignature": "AY89a18uipJRkTss/UkZqyfwi6x82MixOXaO/uk3eCy64EV7aK4ttUgHP/GuCy87VIrRh2pBSFfaCIIgvg2Z0XXmG5k/oDbEIPlNbZjr7vrmMXRAeRatL+26MGjPoTkScvjCzzPACLHFVI4yuFtPLJgA6wKc+VnbldWtibzoIYW8pnja28iaIsV45zyQdP4OVlcG2zM79rLT5gdijGgyvXax6o4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2g/t4ooreVF+sSPhfyOsLyfr61YG+DUYf5uIPtUBf5WSA8eUu0zJTPTRILNFaqMnhxOMA7limeCZPG+Yzwww=="
          }
        ]
      },
      "finishReason": "STOP"
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 13,
    "candidatesTokenCount": 409,
    "totalTokenCount": 1275,
    "trafficType": "ON_DEMAND",
    "promptTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 13
      }
    ],
    "candidatesTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 409
      }
    ],
    "thoughtsTokenCount": 853
  },
  "modelVersion": "gemini-3-flash-preview",
  "createTime": "2026-07-24T23:10:39.662413Z",
  "responseId": "7_Bjao23KPaH3dAP_vWlwAY",
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

</details>

Parameters

Schema variant

Generate ContentChat Completions

▶contents[]

arrayrequired

▶systemInstruction{}

object

▶generationConfig{}

object

▶safetySettings[]

array

▶tools[]

array

toolConfig

▶messages[]

arrayrequired

temperature

numberminimum: 0maximum: 2

max_tokens

numberexclusiveMinimum: 0

max_completion_tokens

numberexclusiveMinimum: 0

top_p

numberminimum: 0maximum: 1

frequency_penalty

numberminimum: -2maximum: 2

presence_penalty

numberminimum: -2maximum: 2

stream

boolean

▶stream_options{}

object

▶tools[]

array

tool_choice

response_format

▶modalities[]

array

▶audio{}

object

reasoning_effort

stringOptional reasoning control; availability and accepted values are model-dependent.

▶candidates[]

array

▶usageMetadata{}

object

modelVersion

string

id

string

object

string

created

number

model

string

▶choices[]

array

▶usage{}

object

API Schemas (Raw)

Input Open Download

Output Open Download

Was this helpful?

YesNo

On this page

Now 'data' is a Python dictionary or lis·续 - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ai/models/google/gemini-3-flash/#page","headline":"Gemini 3 Flash","description":"Gemini 3 Flash is Google's fast multimodal model with frontier intelligence, superior search, and grounding capabilities.","url":"https://developers.cloudflare.com/ai/models/google/gemini-3-flash/","inLanguage":"en","image":"https://developers.cloudflare.com/og-docs.png","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Google's lightest and most cost-efficient Gemini model for high-throughput tasks. title: Gemini 3.1 Flash Lite image: https://developers.cloudflare.com/og-docs.png


Skip to content

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

Google logo