# Google Gemini 4 Carbon > Gemini 4 Carbon on GPTProto — text API access through the interfaces documented below. ## Overview - **Guide status: available** - **Catalog model ID**: `gemini-4-carbon` - **Lifecycle**: listed (source: model-scene.releaseStatus/preRelease/isShow; not an inference availability test) - **max_input_tokens**: 1048576 - **platform_max_input_tokens**: 1048576 - **provider_context_tokens**: 1048576 (source: Data API models.context_length, uniquely matched provider SKU; separate from platform input limits) - **Context source**: model-scene.maxInTokenNumber, tokens; platform-published input limit, not an independently verified provider maximum - **Editorial facts**: marketing summaries are excluded; use the structured context, pricing and request fields below - **API availability**: not tested; available means a model-specific request is documented - **Base URL**: `https://gptproto.com/v1beta` - **Endpoint**: `POST https://gptproto.com/v1beta/models/gemini-4-carbon:generateContent` - **Model ID**: `gemini-4-carbon` - **Request model value**: `gemini-4-carbon` (in the endpoint path; follow the native request body below) - **Vendor**: Google - **Category**: text-to-text - **Supported endpoints**: Gemini - **Model page**: https://gptproto.com/model/google/gemini-4-carbon/web-search Send API requests to the absolute Endpoint URL in this guide. The website address used to read documentation, including localhost, is not an inference base URL. ## Authentication Use the authentication headers listed for your selected endpoint below. Create a GPTProto API key at https://gptproto.com/dashboard/api-key, then export it: ```bash export GPTPROTO_API_KEY="your-api-key" ``` Primary endpoint header: `x-goog-api-key: $GPTPROTO_API_KEY`. ## Pricing Billing shape: `per_token_text`. Platform USD quotes already include the discount. Run rows are complete request totals for their listed parameters. Second/token rows are unit rates. Pricing controls describe billing, not the server's accepted API parameters. ### Token rates (2 published rows) - **Input** — $3.2 per 1M tokens; USD; unit rate - **Output** — $16 per 1M tokens; USD; unit rate Prices may change. The model page always shows the live price: https://gptproto.com/model/google/gemini-4-carbon/web-search ## Endpoints ### Gemini Creates a response using the Gemini generateContent API format. `POST https://gptproto.com/v1beta/models/gemini-4-carbon:generateContent` - **x-goog-api-key**: `$GPTPROTO_API_KEY` - **Content-Type**: `application/json` ## Response handling Use your selected endpoint's response format; do not assume Chat Completions `choices` fields for Responses, Messages or Gemini. Consult the API documentation linked below for the full response schema. HTTP success alone does not establish a usable output. Inspect the response body and handle API errors. Token usage, when present, describes usage; it does not prove billing or model routing. Check account Usage History for the account record. ## Usage Examples ### 1. First request The snippets below call **Gemini**. Other endpoints use different request bodies and response formats; changing only the URL is not sufficient. ```bash curl --request POST "https://gptproto.com/v1beta/models/gemini-4-carbon:generateContent" \ --header "x-goog-api-key: $GPTPROTO_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Find a recent official update about WebMCP and cite the source." } ] } ], "tools": [ { "googleSearch": {} } ] }' ``` ```python import os import requests url = "https://gptproto.com/v1beta/models/gemini-4-carbon:generateContent" headers = { "x-goog-api-key": os.environ["GPTPROTO_API_KEY"], "Content-Type": "application/json" } payload = { "contents": [ { "role": "user", "parts": [ { "text": "Find a recent official update about WebMCP and cite the source." } ] } ], "tools": [ { "googleSearch": {} } ] } response = requests.request("POST", url, headers=headers, json=payload) print(response.json()) ``` ```typescript const response = await fetch("https://gptproto.com/v1beta/models/gemini-4-carbon:generateContent", { method: "POST", headers: { "x-goog-api-key": process.env.GPTPROTO_API_KEY ?? "", "Content-Type": "application/json", }, body: JSON.stringify({ contents: [ { role: "user", parts: [ { text: "Find a recent official update about WebMCP and cite the source.", }, ], }, ], tools: [ { googleSearch: {}, }, ], }), }); const data = await response.json(); console.log(data); ``` ### 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/v1beta/models/gemini-4-carbon:generateContent" \ --header "x-goog-api-key: $GPTPROTO_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "stream": true, "contents": [ { "role": "user", "parts": [ { "text": "Find a recent official update about WebMCP and cite the source." } ] } ], "tools": [ { "googleSearch": {} } ] }' ``` ## 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-4-carbon/web-search) - [All models](https://gptproto.com/model) - [API keys](https://gptproto.com/dashboard/api-key) - [Platform overview for LLMs](https://gptproto.com/llms-full.txt) - Any other model: `https://gptproto.com/model/{vendor}/{model}/{scene}/llms.txt`