Gemini 3.1 Pro (Google) · Cloudflare AI docs · Cloudflare AI docs
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. Gemini 3.1 Pro Text Generation • Google Model ID Use with the Workers AI binding , the AI Gateway REST API , or the Unified API . Calling the provider directly? Use the provider's model name instead, including with provider-native endpoints or the provider's own SDK.
For example, Anthropic's name for anthropic/claude-opus-4.8 is claude-opus-4-8 . Third-party Zero data retention Google's most intelligent Gemini model with improved reasoning, a medium thinking level, and a 1M token context window. Model Info Context Window ↗ 1,000,000 tokens Terms and License link ↗ More information link ↗ Zero data retention Yes Request formats Chat Completions Pricing Input <=200k (per 1M) $2.00 Cached input <=200k (per 1M) $0.20 Output <=200k (per 1M) $12.00 Input >200k (per 1M) $4.00 Cached input >200k (per 1M) $0.40 Output >200k (per 1M) $18.00 Usage const response = await env.
AI . run ( 'google/gemini-3.1-pro' , { contents: [{ parts: [{ text: 'What are the three laws of thermodynamics?' }], role: 'user' }] }, ) 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.1-pro", "input": { "contents": [ { "parts": [ { "text": "What are the three laws of thermodynamics?" } ], "role": "user" } ] } }' The laws of thermodynamics describe how energy moves and changes form within physical systems.
While the prompt asks for the "three" laws, there are actually four (scientists realized later that they needed a foundational law, which they named the "Zeroth" law). Here are the three main laws of thermodynamics, explained simply: ### **1. The First Law: The Law of Conservation of Energy** * **The Concept:** Energy cannot be created or destroyed; it can only change forms or be transferred from one object to another. * **What it means:** The total amount of energy in the universe is constant.
For example, a car engine doesn't "create" energy to move the car; it converts the chemical energy stored in gasoline into mechanical energy (motion) and thermal energy (heat). * **The famous summary:** *"You can't get something for nothing."* (You cannot create energy out of thin air). ### **2. The Second Law: The Law of Entropy** * **The Concept:** In any isolated system, the total **entropy** (disorder or randomness) will always increase over time. * **What it means:** Energy naturally disperses.
This is why a hot cup of coffee will always cool down in a room, but a cold cup of coffee will never spontaneously absorb heat from the room to boil. Furthermore, because energy disperses, no energy transfer is 100% efficient. Whenever you convert energy from one form to another, some of it is always "lost" as unusable waste heat. * **The famous summary:** *"You can't even break even."* (Because of entropy, you will always lose some usable energy in any process). ### **3.
The Third Law: Absolute Zero** * **The Concept:** As the temperature of a system approaches **absolute zero** (0 Kelvin, or -273.15°C), the entropy of the system approaches a constant, minimum value. * **What it means:** Absolute zero is the theoretical point where all thermal energy is gone and the atoms stop moving entirely. The third law dictates that while we can get extremely close to absolute zero, it is physically impossible to actually reach it. * **The famous summary:** *"You can't get out of the game."* (You can never reach absolute zero, so there will always be *some* heat and entropy). *** ### **Bonus: The "Zeroth" Law** Formulated after the first three laws were already established, scientists realized they needed a law to define temperature itself.
Since it was the most fundamental, they called it the "Zeroth" Law. * **The Concept:** If System A is in thermal equilibrium (the same temperature) with System B, and System B is in thermal equilibrium with System C, then System A and System C must also be the same temperature. * **What it means:** This seems obvious, but it is the foundational rule that allows thermometers to work! { "candidates" : [ { "content" : { "role" : "model" , "parts" : [ { "text" : "The laws of thermodynamics describe how energy moves and changes form within physical systems.
While the prompt asks for the \" three \" laws, there are actually four (scientists realized later that they needed a foundational law, which they named the \" Zeroth \" law). \n\n Here are the three main laws of thermodynamics, explained simply: \n\n ### **1. The First Law: The Law of Conservation of Energy** \n * **The Concept:** Energy cannot be created or destroyed; it can only change forms or be transferred from one object to another. \n * **What it means:** The total amount of energy in the universe is constant.
For example, a car engine doesn't \" create \" energy to move the car; it converts the chemical energy stored in gasoline into mechanical energy (motion) and thermal energy (heat). \n * **The famous summary:** * \" You can't get something for nothing. \" * (You cannot create energy out of thin air). \n\n ### **2. The Second Law: The Law of Entropy** \n * **The Concept:** In any isolated system, the total **entropy** (disorder or randomness) will always increase over time. \n * **What it means:** Energy naturally disperses.
This is why a hot cup of coffee will always cool down in a room, but a cold cup of coffee will never spontaneously absorb heat from the room to boil. Furthermore, because energy disperses, no energy transfer is 100% efficient. Whenever you convert energy from one form to another, some of it is always \" lost \" as unusable waste heat. \n * **The famous summary:** * \" You can't even break even. \" * (Because of entropy, you will always lose some usable energy in any process). \n\n ### **3.
The Third Law: Absolute Zero** \n * **The Concept:** As the temperature of a system approaches **absolute zero** (0 Kelvin, or -273.15°C), the entropy of the system approaches a constant, minimum value. \n * **What it means:** Absolute zero is the theoretical point where all thermal energy is gone and the atoms stop moving entirely. The third law dictates that while we can get extremely close to absolute zero, it is physically impossible to actually reach it. \n * **The famous summary:** * \" You can't get out of the game. \" * (You can never reach absolute zero, so there will always be *some* heat and entropy). \n\n *** \n\n ### **Bonus: The \" Zeroth \" Law** \n Formulated after the first three laws were already established, scientists realized they needed a law to define temperature itself.
Since it was the most fundamental, they called it the \" Zeroth \" Law. \n * **The Concept:** If System A is in thermal equilibrium (the same temperature) with System B, and System B is in thermal equilibrium with System C, then System A and System C must also be the same temperature. \n * **What it means:** This seems obvious, but it is the foundational rule that allows thermometers to work!" , "thoughtSignature" : "AY89a197GECnMwUlM7wtji6/asWPmDOw31IcboL2qXHjETlhZBJfD5iMStj+z9+vySalZtJ1NQYfQF8JpOU7SnXTCMwSHOnVB4Ldz/M2rubkfi11yR+XetAYveyWbs12yboQ4Q2IuojZuBWhHcv5oW3XWzaw/d4xiCdrnmDaqN2BY3xHEaaXQuhVvGqsMJZcQoHGBmoOMupngIq1CGjIrpqVcDXKQ5d2ib99wWnr6zbkcuO9MlSnZQ5N9/9h5lXX62se9hIAiN9dXB5XAjbTfpudRIHsZick+tsJ19B3QF6opQQzTtVxwmuJviFAQMe3QA4CIfqQUhBkCdqs/dYMQ9TeYCUnpFOVDEh6a9qeXhmnPt1YspA3Uur942oQ6EB1uvFAoOMTjKFn/JvsP0+4Ip0/MuULcgfIGPLYo5pgtVa3eS4B9yBaaIq/RAUK2g8lgvjSZI7h7bshhHbIjL5IVExxGegnhy1dqOf/X1tWaRVydvAEQCNrF1wqDfxcUut0xPNVBtFOFMvDUOjiWbrxecTjLDfHe6XiLBQpzaSsAxIqiQFs1qobbqPwaghCHzkdFM5A8CMlG68d1R4P6uxgo7rQzwik1D4Yy4iwCDS9IX5gXQWRCD5qgHGRdftnW9B15l/Cg9Ssgk14+lSUX1VuSNRm34s+wDV5mYwd6NwBe9Q3r13BOXynglWFjKkWKcTaYXeWuyrtdkzZB+Dh4
The rest of this page is on the live site.