Tutorial
gemini-4-carbon in Practice: 5 High-Value Application Scenarios for Text Models and Key Integration Points
On this page
Why evaluate text models by scenario rather than by leaderboard
The most common mistake in model selection is to treat a leaderboard as the conclusion. The composite score on a leaderboard reflects average performance on an evaluation set, while your business cares about only one task shape: extracting customer service emails into structured fields, or classifying user feedback into five categories. These two things place completely different requirements on the model—the former requires strict adherence to the output format with no missing fields, while the latter requires stable label decisions that do not waver on boundary samples. A model with a very high composite score may well be worse than a mid-tier model on your specific task.
A more practical approach is to first break down the task shape, then judge whether the model matches. Text requirements can broadly be grouped into several categories: structured extraction (pulling fields from free text), classification and routing (assigning labels, deciding destinations), long-form generation and compression (summaries and key points), question answering and rewriting based on reference materials, and review/quality inspection (judging whether something passes and giving reasons). Each category has a different input/output contract, different sensitivity to prompts, and different repair costs after errors.
So the evaluation process should be: first determine which shape the task belongs to, write 20 to 50 real samples, define clearly what counts as "done right", then run the candidate model once and compare the results manually. gemini-4-carbon is the strongest model in the Gemini 4 series, aimed at the most complex multi-step, long-horizon tasks, and it is equally suitable for validation in this way rather than believing its promotional description out of hand.
The following sections expand on 5 high-value scenarios, each giving input/output conventions, prompt design points, and cost control ideas, so you can directly pick the ones that match your needs.

Scenario 1: Unstructured text to structured data
This is the category of task where text models most easily produce direct business value: the input is ticket body text, customer emails, contract fragments, meeting notes, and the output is JSON with fixed fields. Typical fields include issue type, product involved, urgency level, key entities, and a summary of user requests.
Define the input/output contract first
Before implementation, write the schema clearly, for example field names, types, allowed value enums, and whether null is allowed. Once the schema is fixed, make the model strictly follow it at the output layer. The way to do this is to give the field definitions and one complete example directly in the prompt, rather than only describing "please extract key information". Examples are more effective than descriptions, especially when field semantics are prone to ambiguity.
Three layers of means to constrain the output format
The first layer is the prompt: explicitly state "output only JSON, no explanations, no text outside the markdown code block markers". The second layer is structural validation: immediately parse and validate fields after receiving the response; enum values outside the range, missing required fields, and type mismatches are all judged as failures. The third layer is retry: when validation fails, resend the request with the validation error message as an additional instruction, which usually has a much higher success rate than retrying as-is.
Do not expect perfection in one shot. For long text, the model may miss information in later sections; for schemas with many fields, it may swap two similar fields. These all need to be caught at the validation layer, rather than repeatedly adding exclamation marks in the prompt.
Cost control
Extraction tasks often have long inputs and short outputs, with cost concentrated on the input side. Historical conversations, email signatures, and legal disclaimer paragraphs that can be trimmed should all be removed before sending to the model. Keep only the paragraphs relevant to the fields, which both saves money and improves accuracy.

Scenario 2: Content classification and routing
The shape of a classification task is: a piece of text goes in, one or several labels come out, and the label determines which process follows—which team it is assigned to, which queue it enters, which automatic reply is triggered.
Label design matters more than model selection
First confirm whether the label set is mutually exclusive and whether it is exhaustive. If there is a catch-all category such as "other", define its decision criteria clearly. The number of labels should not be too large at the start; with more than ten categories, model confusion on boundary samples rises noticeably, so it is recommended to merge similar categories first and split them finely after the pipeline works. Each label is best paired with a one-sentence decision description and a positive example, written into the prompt.
Confidence and fallback
You can ask the model in the prompt to give a brief decision rationale, and use it as a routing basis: those with clear and self-consistent rationales are routed directly, while those with vague or self-contradictory rationales enter the manual queue. But note that the confidence reported by the model is not always well calibrated; be sure to verify on real samples whether it can truly distinguish "easy" from "hard" samples. A more reliable approach is to look at the distribution of multiple candidate labels, or have a rule layer judge whether the rationale given by the model is sufficient.
At the same time, there must be a fallback branch: parsing failures, labels outside the enum, and multi-label conflicts all go to manual or default queues. Routing is a high-impact link; better to route more to manual than to make a wrong automatic assignment.
Cost control
Classification tasks have medium input length and extremely short output, and token consumption mainly depends on the input. You can send only the title, opening paragraph, and key sentences to the model rather than the whole document; for very long content, truncate first and then classify, and in most scenarios the loss in effectiveness is limited.

Scenario 3: Long-document summarization and key point extraction
The difficulty of long-document summarization is not "writing a summary paragraph", but "not losing key information, not repeating the summary, and not fabricating". When a single call handles very long text, the model easily loses mid-section content and also easily rewrites the opening repeatedly.
Summarize in segments, then merge
A common approach is to split the long document into chunks by paragraph or section, generate key points chunk by chunk, and then merge the key points into the final summary. When chunking, try to split along semantic boundaries rather than hard-cutting by a fixed number of characters; otherwise a sentence cut in half introduces noise. In the merge stage, have the model compress only based on the key points already produced rather than going back to the original text, which can significantly reduce repetition and divergence.
Specify the target audience and granularity of the summary
The prompt should clearly state: who the summary is for, how long it should be, and which elements must be retained (numbers, conclusions, to-dos). If unspecified, the model will give averaged generic talk. Another effective constraint is "output as bullet items", one sentence each, avoiding redundant transitional phrases stuffed into coherent long paragraphs.
Quality validation
Summary output has no single correct answer, but several cheap checks can be done: whether the length is within range, whether the required key elements are included, and whether numbers or entities appear that are not in the original text. The last item is especially important; during compression the model occasionally "completes" a plausible-looking number, which is a serious flaw in business documents.
Cost control
This is the scenario with the largest input token consumption. Segmented summarization means the same document is read multiple times, and cost grows approximately linearly with length. It is recommended to set a length limit for very long documents and define an explicit degradation strategy, for example only finely summarizing the first several chapters and roughly summarizing the rest.
Scenario 4: Question answering and rewriting based on your own materials
The shape of this scenario is: the user asks a question, the system first retrieves candidate paragraphs from your own materials, splices them into the context, and lets the model answer or rewrite based on these paragraphs. Its difference from general question answering is that the answer must stay within the given materials.
Context assembly
Retrieved paragraphs should be sorted before truncation, with the most relevant placed close to the instructions. Give each piece of material a source identifier, making it easier for the model to cite in the answer and for you to troubleshoot errors. If retrieved results contradict each other, the prompt should explicitly require the model to point out the conflict rather than choosing one on its own.
Refusing to answer is more valuable than forcing an answer
The prompt must state: if the materials are insufficient to answer, directly state that there is no relevant information in the materials, and do not supplement from common sense. This constraint can significantly reduce the hallucination rate, but the premise is that you must specifically prepare a batch of questions in the evaluation set whose answers are genuinely absent from the materials; otherwise it cannot be tested.
Additional constraints for rewriting scenarios
For requirements such as "rewrite the material into a paragraph users can understand", in addition to content accuracy, style must also be constrained: length, tone, whether lists are allowed, and whether original terms must be retained. The readability of rewritten output depends heavily on these items; missing one leads to style drift.
Cost control
Cost is almost entirely determined by the length of materials spliced into the context. Recalling more during retrieval and then truncating is often cheaper than increasing Top-K; repeated questions within the same session can have their answers cached; for rewriting tasks, explicitly limiting output length can both reduce cost and improve style consistency.
Scenario 5: Review and quality inspection assistance
The shape of review tasks is: given a piece of content (copy, code comments, customer service replies, product descriptions) and a set of standards, output pass or fail, along with the reason for failure. It does not pursue creativity; it pursues consistent judgment.
Write review standards as decidable items
Standards like "whether the tone is friendly" cannot be executed stably. Break them into decidable items: whether forbidden words are included, whether promissory statements appear, whether the length is within the interval, and whether necessary information items are included. Each standard corresponds to a boolean judgment and a brief reason, with the output structure fixed as item-by-item results plus an overall conclusion.
Distinguish hard validation from soft suggestions
Checks that can be done by rule code (regex, length, vocabulary) should not be handed to the model, as it is both slow and unstable. The model is suitable for parts that rules cannot cover: whether the semantics are self-contradictory, whether the wording may cause misunderstanding, and whether it deviates from the given standards. Outputting these two types of results separately will greatly reduce the cost of manual review.
Output design
Have the model output three states for each standard: "pass / fail / unable to judge", rather than two states. Adding "unable to judge" can significantly reduce forced judgments when information is insufficient, and also gives you a clear queue for manual handling. Limit the reason field to one sentence, which both saves tokens and facilitates aggregate statistics.
Cost control
Quality inspection is often a batch task, with low per-item cost but large total volume. Control means include standardized prompt templates, compressing content to be reviewed (send only the parts that need checking), and using rules to pre-filter obviously qualified samples so that only suspicious ones are sent to the model.
Integration implementation: API, parameters, and output constraints
The 5 scenarios above share a great deal at the integration level and can be abstracted into a common pipeline: prompt template → model call → output validation → failure retry. Model calls uniformly go through the Chat Completions-compatible API https://api.hiapi.ai/v1/chat/completions, the SDK base_url is https://api.hiapi.ai/v1, and streaming output is supported.
Model names and routing
The same model provides two routes: the standard route uses the model name without a suffix, and the Vertex route appends @vertex to the model name, for example gemini-4-carbon@vertex. Switching routes changes only the model field, with the rest of the request unchanged; the two routes have the same model capabilities but different prices, see the price table below.
Input and length limits
Input supports only text and images, not audio, video, or PDF. The context length is 1,048,576 tokens, and the maximum output per call is 65,536 tokens, leaving considerable room for scenarios such as long-document summarization, but segmented processing remains an effective means of controlling cost and stability.
Reasoning effort
Reasoning effort is specified via reasoning_effort, with options low, medium, and high. How to choose the level should be determined by evaluation on the actual task: run each level once on real samples, compare accuracy, latency, and token usage, and then set the default. The higher the reasoning effort, the more latency and output tokens, so it needs to be weighed against the scenario.
Currently unsupported capabilities
This API currently does not support tool calling / function calling, web search, computer use, or structured output / JSON mode. Therefore, output format constraints must fall on the prompt and code validation layers: the prompt gives field definitions and complete examples, and the code parses the response and validates item by item, without relying on API-side schema enforcement.
Request example
curl https://api.hiapi.ai/v1/chat/completions \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-4-carbon",
"reasoning_effort": "medium",
"stream": true,
"messages": [
{"role": "user", "content": "Extract the following ticket into JSON with fixed fields: ..."}
]
}'
Structure of the prompt template
It is recommended to fix it as four sections: role and task description, input data, output format definition and examples, and boundaries and prohibitions. Wrap the input data with explicit delimiters to avoid confusion with instructions. Examples must be complete and parseable; do not write "JSON like this" and then give a fragment.
Output validation is a necessity, not an option
After receiving the response, parse first: whether the JSON can be parsed, whether required fields are complete, whether enum values are legal, and whether numbers are within a reasonable range. Do not silently degrade to an empty result on validation failure; record it, because the failure rate itself is an important model quality metric.
Retry strategy
It is recommended to retry at most once or twice, and when retrying, tell the model the validation error as additional information, for example pointing out which field is missing or which enum value is illegal. Retrying as-is usually has very low payoff. Also set timeouts and concurrency limits to prevent a single exception from dragging down the entire batch.
Logging and observability
Each call should record at least: scenario identifier, input token and output token usage, validation result, and latency. These data are used both for cost analysis and as a comparison baseline when switching models or changing prompts later. Without this layer of logging, any optimization can only rely on feeling.
Token-priced cost control and launch recommendations
gemini-4-carbon is priced by token, which means cost is determined jointly by input length and output length, and the cost structure differs greatly across scenarios. Extraction and question answering scenarios are dominated by input, summarization scenarios are heavy on both input and output, and classification and quality inspection are heavy on input with extremely light output. First figure out which side your scenario spends money on, and then optimization has direction.
Pricing and selection baseline
The table below is in USD per million tokens, with the three columns being input, cached input, and output.
| Model | Route | Input | Cached input | Output |
|---|---|---|---|---|
| gemini-4-carbon | Standard | 1.00 | 0.05 | 5.00 |
| gemini-4-carbon | @vertex | 1.64 | 0.09 | 8.20 |
| gemini-4-argon | Standard | 1.00 | 0.05 | 5.00 |
| gemini-4-argon | @vertex | 1.64 | 0.09 | 8.20 |
| gemini-3.8-flash | Standard | 0.19 | 0.02 | 0.92 |
| gemini-3.8-flash | @vertex | 0.62 | 0.07 | 3.08 |
The three models have different positioning: gemini-4-carbon is the strongest model in the Gemini 4 series, aimed at the most complex multi-step, long-horizon tasks; gemini-4-argon is suitable for most software engineering and knowledge work, with balanced capability and cost; gemini-3.8-flash is fast and low-priced, suitable for high-concurrency, low-latency tasks. For the same task, you can first get it working with Argon or Flash, then judge whether it is worth upgrading to Carbon.
Route and reasoning effort are also cost variables: the standard route has a lower unit price than the @vertex route. Choose the reasoning effort level based on evaluation on the actual task, and set the default after comparing accuracy and token usage across levels on real samples.
Compress input
The most common waste is sending the entire document to the model as-is. What you can do: remove templated headers, footers, and disclaimers, trim historical conversations to only the most recent turns, truncate retrieval results by relevance, and send only the needed chapters of long documents. These changes usually do not sacrifice accuracy but directly reduce input tokens.
Limit output
Output-side control is simpler: specify a maximum length, require itemized output rather than long paragraphs, and prohibit restating the input. Many prompts say "please explain in detail", which under token-based billing is a cost amplifier unless the business truly needs detail.
Evaluate at small scale before scaling up
Do not substitute official descriptions for your own validation. The recommended approach is: prepare several dozen real samples for each scenario, define decidable pass criteria, run one round to see accuracy and failure modes, and then decide whether to expand the scope. The evaluation set should be retained as a regression baseline.
Establish a reusable evaluation and regression process
Changing models, modifying prompts, and adjusting context length all affect results. Only with a fixed set of evaluation scripts and metrics can you judge within minutes after a change whether it got better or worse. This is the infrastructure for using text models over the long term, more important than any single tuning effort.
Start with one scenario, several dozen samples, and a clear set of pass criteria; talk about expansion only after it works. You can view the API documentation and billing basis for gemini-4-carbon on the HiAPI.ai model page, and budgeting based on actual input and output token usage is more accurate.
Related articles
View all articles →-
Tutorial
How to Call kimi-k3.1-pro via the HiAPI API: curl, Python, and a Working Request
A hands-on integration guide covering endpoints, request parameters, streaming, tool calls, and error triage
18 min read -
Tutorial
ElevenLabs Music API on HiAPI: Generate Music with curl, Python, and Prompt Recipes
A hands-on tutorial for calling elevenlabs/music-v2.5 through HiAPI, plus copy-paste prompt recipes for style, mood, and duration
12 min read -
Tutorial
How to Use gpt-image-2.5-sunburst/image-to-image via the HiAPI API: curl and Python
A working request, reference-image upload flow, and error triage for developers
10 min read