Developer Dashboard

New Model Added: Gemini 3.8 Flash

Date: 2026-09-03 / (1405-06-12)

Summary

Google's gemini-3.8-flash is now available through AvalAI for long-horizon coding, autonomous agents, multi-step reasoning, and tool-driven workflows. It supports the native Gemini v1beta/, v1/chat/completions, and v1/messages, with partial support for v1/responses. The gemini-flash-latest alias now points to gemini-3.8-flash.


Details

Google Gemini 3.8 Flash

gemini-3.8-flash is Google's latest Flash model for demanding reasoning, coding, and agentic workloads. Compared with Gemini 3.7 Flash, Google reports improvements in software engineering, autonomous task completion, critical multi-step reasoning, and specialized professional domains while retaining Flash-class speed.

Key Features:

  • Long-Horizon Coding: Designed for multi-stage software engineering, debugging, implementation, and codebase tasks
  • Autonomous Agents: Improved planning, tool selection, iterative tool use, and completion of extended workflows
  • Complex Reasoning: Stronger performance on critical multi-step problems and knowledge-intensive professional tasks
  • Configurable Effort: Higher reasoning effort can improve difficult-task performance, while lower effort can reduce token use and latency
  • Developer Workflows: Suitable for coding agents, research pipelines, document analysis, and tool-driven automation
  • Endpoint Choice: Available through native Gemini, OpenAI-compatible Chat Completions, and Anthropic-compatible Messages APIs

Benchmark Highlight Reported by Google

Google reports a score of 54.9% on HLE-Verified and stronger performance on DeepSWE v1.1 for Gemini 3.8 Flash. These results indicate progress in advanced reasoning and software engineering, but benchmark scores are directional evidence rather than a substitute for testing with your own prompts, tools, and acceptance criteria.

The model may use more output tokens at higher reasoning-effort settings because it can perform additional reasoning and iterative tool calls. Evaluate quality, latency, and token consumption together when selecting an effort level.

Endpoint Availability

EndpointSupportNotes
v1beta/SupportedNative Gemini request and response schema
v1/chat/completionsSupportedOpenAI-compatible Chat Completions
v1/messagesSupportedAnthropic-compatible Messages API
v1/responsesPartial supportVerify required parameters and tools before production use

Latest Alias

The gemini-flash-latest alias now resolves to gemini-3.8-flash. Use the explicit gemini-3.8-flash model ID when you need a pinned version, reproducible evaluations, or controlled production rollouts. Use the alias only when your application is prepared to adopt future Flash updates automatically.


Promotional Pricing

Prices are in USD per 1 million tokens. Introductory pricing applies through December 31, 2026.

PeriodInputCached InputOutput
Through December 31, 2026$0.75$0.075$3.75
After December 31, 2026$1.50$0.15$7.50

The promotional rates are half the standard rates. Review the pricing page before deploying long-running workloads whose traffic may continue beyond the promotional period.


API Request and Response Example

Request

bash
curl https://api.avalai.ir/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -d '{
    "model": "gemini-3.8-flash",
    "messages": [
      {
        "role": "user",
        "content": "Review this distributed job processor, identify its three highest reliability risks, and propose an implementation plan with rollback criteria."
      }
    ]
  }'

Response

The following shortened response illustrates the standard Chat Completions structure. Token counts and cost vary with the request and generated output.

json
{
  "id": "chatcmpl-gemini38-example",
  "created": 1788422400,
  "model": "gemini-3.8-flash",
  "object": "chat.completion",
  "system_fingerprint": null,
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "The highest risks are duplicate execution, unbounded retry storms, and loss of in-flight state during failover. Introduce idempotency keys and durable leases first, then add bounded exponential backoff with a dead-letter queue, and finally persist checkpoint state. Roll back each phase if duplicate-job rate, queue age, or recovery time exceeds its pre-deployment threshold.",
        "role": "assistant",
        "thinking_blocks": [],
        "annotations": []
      }
    }
  ],
  "usage": {
    "completion_tokens": 75,
    "prompt_tokens": 28,
    "total_tokens": 103
  }
}

SDK Usage Examples

bash
curl https://api.avalai.ir/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -d '{
    "model": "gemini-3.8-flash",
    "messages": [
      {
        "role": "user",
        "content": "Plan a safe migration from scheduled workers to an event-driven processing pipeline."
      }
    ]
  }'
python
from openai import OpenAI

client = OpenAI(
    api_key="your-avalai-api-key",
    base_url="https://api.avalai.ir/v1",
)

response = client.chat.completions.create(
    model="gemini-3.8-flash",
    messages=[
        {
            "role": "user",
            "content": "Plan a safe migration from scheduled workers to an event-driven processing pipeline.",
        }
    ],
)

print(response.choices[0].message.content)
javascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.AVALAI_API_KEY,
  baseURL: "https://api.avalai.ir/v1",
});

const response = await client.chat.completions.create({
  model: "gemini-3.8-flash",
  messages: [
    {
      role: "user",
      content: "Plan a safe migration from scheduled workers to an event-driven processing pipeline.",
    },
  ],
});

console.log(response.choices[0].message.content);

Native Gemini API Example

Use the native Gemini endpoint when your application needs Gemini-specific request fields or tools:

bash
curl https://api.avalai.ir/v1beta/models/gemini-3.8-flash:generateContent \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "Design a tool-using coding agent that diagnoses a failing deployment and prepares a human-reviewable remediation plan."
          }
        ]
      }
    ]
  }'

Migration Guidance

  • Use the exact model ID gemini-3.8-flash when you need a pinned production version.
  • The gemini-flash-latest alias now points to gemini-3.8-flash; aliases may move again as newer Flash models become available.
  • Existing Gemini Flash applications can generally retain their endpoint and request structure while changing the model ID.
  • Evaluate representative coding, reasoning, and tool-use workloads before shifting production traffic.
  • Monitor token consumption and latency when increasing reasoning effort or allowing extended tool loops.
  • Confirm support for every required parameter and tool before using the partially supported v1/responses endpoint.
  • Account for the standard rates that take effect after December 31, 2026 when forecasting long-term cost.