# Google Gemini 2.0 Flash > Build real-time apps with Gemini 2 Flash. Get a 1 million token context window, native audio-video processing, and low-latency API access at GPTProto.com now. ## Overview - **Base URL**: `https://gptproto.com/v1` - **Model ID**: `gemini-2.0-flash` - **Vendor**: Google - **Category**: text-to-text - **Capabilities**: text-to-text, image-to-text, file-analysis - **Supported endpoints**: Chat Completions, Gemini - **Model page**: https://gptproto.com/model/google/gemini-2.0-flash - **API documentation**: https://docs.gptproto.com ## Authentication Every request needs a GPTProto API key in the `Authorization` header. Create one at https://gptproto.com/dashboard/api-key, then export it: ```bash export GPTPROTO_API_KEY="your-api-key" ``` Header: `Authorization: Bearer $GPTPROTO_API_KEY`. Use `base_url` `https://gptproto.com/v1` with any OpenAI-compatible SDK. ## Pricing Platform price by tier (USD, already includes the GPTProto discount): - **Output** — $0.0002 per 1K tokens - **Input** — $0.0001 per 1K tokens Price range: $0 – $0 per generation. Prices may change. The model page always shows the live price: https://gptproto.com/model/google/gemini-2.0-flash ## Endpoints ### Chat Completions Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes. `POST https://gptproto.com/v1/chat/completions` - **Authorization**: `Bearer $GPTPROTO_API_KEY` - **Content-Type**: `application/json` ### Gemini Creates a response using the Gemini generateContent API format. `POST https://gptproto.com/v1beta/models/gemini-2.0-flash:generateContent` - **x-goog-api-key**: `$GPTPROTO_API_KEY` - **Content-Type**: `application/json` ## Parameters Common request body fields for this model: - **`max_tokens`** (`integer`): max output - **`reasoning`** (`object`): {effort: minimal/low/medium/high} - **`reasoning_effort`** (`string`): minimal/low/medium/high - **`response_format`** (`object`): output format - **`seed`** (`integer`): random seed - **`stop`** (`string`): stop sequences - **`temperature`** (`float`): 0-2 - **`tool_choice`** (`string`): default: auto - **`tools`** (`array`): function calling - **`top_p`** (`float`): 0-1 ## Usage Examples ### 1. First request The snippets below call **Chat Completions**. Swap the path if you prefer another supported endpoint. ```bash curl --request POST "https://gptproto.com/v1/chat/completions" \ --header "Authorization: Bearer $GPTPROTO_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "model": "gemini-2.0-flash", "messages": [ { "role": "user", "content": "Hello" } ] }' ``` ```python import os import requests url = "https://gptproto.com/v1/chat/completions" headers = { "Authorization": f"Bearer {os.environ['GPTPROTO_API_KEY']}", "Content-Type": "application/json" } payload = { "model": "gemini-2.0-flash", "messages": [ { "role": "user", "content": "Hello" } ] } response = requests.request("POST", url, headers=headers, json=payload) print(response.json()) ``` ```typescript const response = await fetch("https://gptproto.com/v1/chat/completions", { method: "POST", headers: { "Authorization": `Bearer ${process.env.GPTPROTO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ model: "gemini-2.0-flash", messages: [ { role: "user", content: "Hello", }, ], }), }); const data = await response.json(); console.log(data); ``` ```python from openai import OpenAI import os client = OpenAI( base_url="https://gptproto.com/v1", api_key=os.environ["GPTPROTO_API_KEY"], ) completion = client.chat.completions.create( model="gemini-2.0-flash", messages=[ { "role": "user", "content": "Hello" } ] ) print(completion.choices[0].message.content) ``` ```typescript import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://gptproto.com/v1", apiKey: process.env.GPTPROTO_API_KEY, }); const completion = await client.chat.completions.create({ model: "gemini-2.0-flash", messages: [ { role: "user", content: "Hello", }, ], }); console.log(completion.choices[0].message.content); ``` ### 2. Enable streaming Add `"stream": true` to the request body to receive tokens as server-sent events: ```bash curl -N --request POST "https://gptproto.com/v1/chat/completions" \ --header "Authorization: Bearer $GPTPROTO_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "stream": true, "model": "gemini-2.0-flash", "messages": [ { "role": "user", "content": "Hello" } ] }' ``` ## HTTP Status Codes - `400` — malformed body, a parameter or value this model does not accept, or input blocked by the provider's content moderation - `401` — missing or invalid API key - `403` — insufficient credits - `413` — request body too large - `429` — rate limited; retry with backoff - `500` — An internal server error occurred - `502` — An internal server error occurred - `504` — Gateway timeout — upstream service did not respond in time; retry later ## Additional Resources - [Model page](https://gptproto.com/model/google/gemini-2.0-flash) - [API documentation](https://docs.gptproto.com) - [All models](https://gptproto.com/model) - [API keys](https://gptproto.com/dashboard/api-key) - [Platform overview for LLMs](https://gptproto.com/llm-full.txt) - Any other model: `https://gptproto.com/model/{vendor}/{model}/{scene}/llms.txt`