AIREITER
API 문서가격
템플릿
GoogleText Chat

Gemini 3.8 Flash API — Long-Context Coding and Agents

Try Gemini 3.8 Flash online for long-context coding, autonomous agents, enterprise workflows, streaming output, and OpenAI-compatible API access.

입력공식 $0.75 100만 토큰당AIReiter $0.23 100만 토큰당출력공식 $3.75 100만 토큰당AIReiter $1.13 100만 토큰당캐시 읽기공식 $0.07 100만 토큰당AIReiter $0.02 100만 토큰당
API로 실행
플레이그라운드READMEAPI

입력

1
2
3
4
5
6
7
8
9
10

Install the official OpenAI client — AIReiter speaks the same protocol, so only the base URL changes:

npm install openai

Set the AIREITER_API_KEY environment variable:

export AIREITER_API_KEY=<paste-your-key-here>

Point the client at AIReiter:

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.AIREITER_API_KEY,
  baseURL: "https://aireiter.com/api/v1",
});

Run gemini-3.8-flash:

const response = await client.chat.completions.create({
    "model": "gemini-3.8-flash",
    "messages": [
      {
        "role": "user",
        "content": "Review this code change and identify the highest-risk issue before suggesting a fix."
      }
    ],
    "max_tokens": 4096
  });

console.log(response);

Stream the response instead:

const stream = await client.chat.completions.create({
  ...{
    "model": "gemini-3.8-flash",
    "messages": [
      {
        "role": "user",
        "content": "Review this code change and identify the highest-risk issue before suggesting a fix."
      }
    ],
    "max_tokens": 4096
  },
  stream: true,
});

for await (const event of stream) {
  console.log(event);
}

Install the official OpenAI client — AIReiter speaks the same protocol, so only the base URL changes:

pip install openai

Set the AIREITER_API_KEY environment variable:

export AIREITER_API_KEY=<paste-your-key-here>

Point the client at AIReiter:

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AIREITER_API_KEY"],
    base_url="https://aireiter.com/api/v1",
)

Run gemini-3.8-flash:

response = client.chat.completions.create(
      model = "gemini-3.8-flash",
      messages = [
        {
          role = "user",
          content = "Review this code change and identify the highest-risk issue before suggesting a fix."
        }
      ],
      max_tokens = 4096
)

print(response)

Stream the response instead:

stream = client.chat.completions.create(
      model = "gemini-3.8-flash",
      messages = [
        {
          role = "user",
          content = "Review this code change and identify the highest-risk issue before suggesting a fix."
        }
      ],
      max_tokens = 4096,
    stream=True,
)

for event in stream:
    print(event)

Set the AIREITER_API_KEY environment variable:

export AIREITER_API_KEY=<paste-your-key-here>

Run gemini-3.8-flash against AIReiter's API:

curl -s -X POST \
  -H "Authorization: Bearer $AIREITER_API_KEY" \
  -H "Content-Type: application/json" \
  "https://aireiter.com/api/v1/chat/completions" \
  -d '{
  "model": "gemini-3.8-flash",
  "messages": [
    {
      "role": "user",
      "content": "Review this code change and identify the highest-risk issue before suggesting a fix."
    }
  ],
  "max_tokens": 4096
}'

Add "stream": true to the body to receive the response as server-sent events.

출력

Example

A codebase you don't know is a risk, not a hurdle. The plan should burn down that risk in order: understand, run, trace, spike, then make the change small enough that "production-ready" is a property you can demonstrate, not a hope.

Here are the first five steps, with the evidence you collect at each.

Step 1 — Get it building and the baseline green (half day) Read the README, the manifest(s), the CI config, and any architecture docs. Boot the app locally, run the full test suite, run the linter/typechecker. Evidence: The exact commands that reproduce a clean build and a passing test suite from a fresh checkout (recorded output, not memory of it). A one-page map you wrote yourself: where the entry points are, the layers, the build/test toolchain, and the main risks to your feature (e.g. "this touches cron jobs and payments").

Step 2 — Trace the smallest end-to-end slice that resembles your feature (half day) Don't start with your feature. Pick a neighboring one that already works and follow it from entry to persistence. Note the conventions along the way: how errors surface, how config is injected, how logging is done, how tests are written. Evidence: An annotated trace — file → function → what it does — for that slice. A written list of "conventions I must follow" (not intuitions; things you observed in real code). A named shortlist of the 3–5 files you will actually touch. If you can't produce this trace, you're not ready to write code.

Step 3 — Spike the core path (day 2) Build the ugly version: hardcoded values, no error handling, no tests. The purpose is to confirm the path you traced in step 2 is real and to surface what you didn't know you didn't know. Evidence: A working spike demonstrating the feature's central data path, alongside a list of every assumption the spike broke and what you corrected. That correction list is the most valuable document in this whole plan.

Step 4 — Write the contract before the code (half of day 2 / day 3) Once the spike proves the path, pin down what production needs: the inputs/outputs, the error cases, where it sits in the conventions from step 2. Then write the tests — they'll be red, but they're the specification. Evidence: A one-to-two-page design doc, an agreed interface/API shape (with the team if there is one), and a red test suite that encodes intended behavior. If you can't write the contract without consulting the code, you haven't finished step 2.

Step 5 — Implement in small, verified increments (days 3–4) Replace the spike with the real thing in small commits, each one keeping the suite green, leaning on the existing patterns. Run lint/tests/typecheck per commit — CI, not just locally — and exercise the actual path against a real instance (staging or a local environment that isn't stubbed). Evidence: A branch with progressive commits, each green in CI; coverage on the new code; something that proves it works against reality (a test result, a log trace, a screenshot); and a review by at least one person who knows the codebase. The review counts as evidence — an unfamiliar codebase has tribal knowledge you cannot extract from the files alone.

Steps 6+ would be the things that actually make it "shipped": a migration plan and its rollback, feature flagging, observability, the release and post-release verification. But the first five get you to a reviewed, green, working slice in staging — which is the point at which you can say "this will work in production" with evidence behind it, instead of a guess.

{
  "model": "gemini-3.8-flash",
  "input": {
    "model": "gemini-3.8-flash",
    "messages": [
      {
        "role": "user",
        "content": "Review this code change and identify the highest-risk issue before suggesting a fix."
      }
    ],
    "max_tokens": 4096
  },
  "output": "A codebase you don't know is a risk, not a hurdle. The plan should burn down that risk in order: understand, run, trace, spike, then make the change small enough that \"production-ready\" is a property you can demonstrate, not a hope.\n\nHere are the first five steps, with the evidence you collect at each.\n\n**Step 1 — Get it building and the baseline green (half day)**\nRead the README, the manifest(s), the CI config, and any architecture docs. Boot the app locally, run the full test suite, run the linter/typechecker.\n*Evidence:* The exact commands that reproduce a clean build and a passing test suite from a fresh checkout (recorded output, not memory of it). A one-page map you wrote yourself: where the entry points are, the layers, the build/test toolchain, and the main risks to your feature (e.g. \"this touches cron jobs and payments\").\n\n**Step 2 — Trace the smallest end-to-end slice that resembles your feature (half day)**\nDon't start with your feature. Pick a neighboring one that already works and follow it from entry to persistence. Note the conventions along the way: how errors surface, how config is injected, how logging is done, how tests are written.\n*Evidence:* An annotated trace — file → function → what it does — for that slice. A written list of \"conventions I must follow\" (not intuitions; things you observed in real code). A named shortlist of the 3–5 files you will actually touch. If you can't produce this trace, you're not ready to write code.\n\n**Step 3 — Spike the core path (day 2)**\nBuild the ugly version: hardcoded values, no error handling, no tests. The purpose is to confirm the path you traced in step 2 is real and to surface what you didn't know you didn't know.\n*Evidence:* A working spike demonstrating the feature's central data path, alongside a list of every assumption the spike broke and what you corrected. That correction list is the most valuable document in this whole plan.\n\n**Step 4 — Write the contract before the code (half of day 2 / day 3)**\nOnce the spike proves the path, pin down what production needs: the inputs/outputs, the error cases, where it sits in the conventions from step 2. Then write the tests — they'll be red, but they're the specification.\n*Evidence:* A one-to-two-page design doc, an agreed interface/API shape (with the team if there is one), and a red test suite that encodes intended behavior. If you can't write the contract without consulting the code, you haven't finished step 2.\n\n**Step 5 — Implement in small, verified increments (days 3–4)**\nReplace the spike with the real thing in small commits, each one keeping the suite green, leaning on the existing patterns. Run lint/tests/typecheck per commit — CI, not just locally — and exercise the actual path against a real instance (staging or a local environment that isn't stubbed).\n*Evidence:* A branch with progressive commits, each green in CI; coverage on the new code; something that proves it works against reality (a test result, a log trace, a screenshot); and a review by at least one person who knows the codebase. The review counts as evidence — an unfamiliar codebase has tribal knowledge you cannot extract from the files alone.\n\nSteps 6+ would be the things that actually make it \"shipped\": a migration plan and its rollback, feature flagging, observability, the release and post-release verification. But the first five get you to a reviewed, green, working slice in staging — which is the point at which you can say \"this will work in production\" with evidence behind it, instead of a guess.",
  "metrics": {
    "input_tokens": 134,
    "output_tokens": 2354,
    "generated_in_seconds": 42.7
  },
  "example": true
}
Generated in
42.7 seconds
입력 Token
134
출력 Token
2354
Tokens per second
55.13 tokens / second
Time to first token
-

모델 세부정보

플레이그라운드, API 요청, 내부 워크플로에서 동일한 모델 키를 사용하세요.

모델 ID
gemini-3.8-flash
공급자
Google
프로토콜
OpenAI Chat Completions
컨텍스트 창
1,048,576 토큰
최대 출력
65,536 토큰
입력 Token
22.5 credits / 100만 토큰
출력 Token
112.5 credits / 100만 토큰
캐시 읽기
2.25 credits / 100만 토큰
캐시 쓰기
-

What You Can Do with Gemini 3.8 Flash

A fast Flash model with a million-token context window, adjustable thinking, and enough reasoning depth for real engineering work.

Long-context coding

Review large repositories, trace changes across files, and keep the working context in one request instead of stitching together many short prompts.

Autonomous agent steps

Use low, medium, or high thinking effort to balance speed and accuracy across planning, tool orchestration, verification, and recovery.

Enterprise document work

Process long specifications, policy collections, and operational records while preserving the relationships between sections and decisions.

Streaming answers

Stream partial output through the OpenAI-compatible Chat Completions endpoint and inspect input, output, and reasoning usage after each call.

Gemini 3.8 Flash Use Cases

Choose it when the task is too broad for a small chat model but does not need a slower flagship route.
01

Multi-file refactoring

Map dependencies, propose a safe edit sequence, and explain the resulting code changes across a large project.

02

Research and synthesis

Combine long notes, reports, and structured evidence into a concise brief with explicit assumptions and next steps.

03

Agent orchestration

Handle the frequent planning and verification turns in an agent loop, then reserve premium models for the hardest decisions.

04

High-volume knowledge work

Run classification, extraction, drafting, and review workflows with a configurable thinking level and predictable token accounting.

Gemini 3.8 Flash Pricing

Google introductory standard pricing through December 31, 2026 is $0.75 input, $3.75 output, and $0.075 cached input per million tokens. AIReiter currently charges 30% of those rates; the live price is shown above the playground.
01

Output includes thinking

Google bills thinking tokens as output tokens. A difficult task can therefore cost more than its visible answer suggests.

02

Cache reads have their own rate

Repeated stable prefixes can use context caching. Confirm a hit in the response usage details before estimating the lower cached-input rate.

03

One million-token context

The context window is large enough for repository-scale prompts and long document sets, while the maximum output is 64K tokens.

04

Introductory period matters

The listed introductory rates run through December 31, 2026; Google documents higher standard rates from January 1, 2027.

Gemini 3.8 Flash vs Gemini 3.7 Flash

Both Flash generations share the same introductory price and million-token context. Choose based on the workflow you need to run, not the version number alone.

Same price, newer generation

Google lists the same introductory standard rates for Gemini 3.8 Flash and Gemini 3.7 Flash through December 31, 2026: $0.75 input, $3.75 output, and $0.075 cached input per million tokens.

3.8 is aimed at longer jobs

Gemini 3.8 Flash is positioned for long-horizon software engineering, autonomous agents, and complex enterprise workflows. Use it when the model must plan, verify, and continue across many steps.

3.7 remains a practical fallback

Keep Gemini 3.7 Flash for an existing production route with a stable evaluation set. Switching to 3.8 is a model-ID change, but your accepted-answer and latency metrics should decide the rollout.

Compare total output, not sticker price

Both models count thinking tokens as output. A route that needs fewer retries or completes a task in one pass can be cheaper even when its visible answer is longer.

Call the Gemini 3.8 Flash API

Use the same public model ID in the playground and in your OpenAI-compatible client.

01

Choose a thinking level

Gemini 3.8 Flash supports low, medium, and high thinking. Minimal thinking is not supported.

02

Leave room for reasoning

Set max_tokens high enough for thinking plus the visible answer. A small limit can be consumed before text appears.

03

POST the Chat Completions request

Call POST https://aireiter.com/api/v1/chat/completions with model "gemini-3.8-flash" and stream=true when incremental output is useful.

04

Inspect usage

Read prompt_tokens, completion_tokens, completion_tokens_details.reasoning_tokens, and prompt_tokens_details.cached_tokens when returned.

Gemini 3.8 Flash API Questions

The practical details to confirm before routing production traffic.

/ 01

What is the Gemini 3.8 Flash model ID?

Use gemini-3.8-flash. The AIReiter internal model key is chat-gemini-3.8-flash.

/ 02

Which endpoint should I use?

Use POST https://aireiter.com/api/v1/chat/completions with an AIReiter API key and the OpenAI-compatible request body.

/ 03

Does Gemini 3.8 Flash support streaming?

Yes. Set stream to true to receive incremental Chat Completions SSE events.

/ 04

How large is the context window?

The documented context window is 1,048,576 tokens, with up to 65,536 output tokens.

/ 05

Why is output-token usage higher than visible text?

Thinking tokens are included in output billing. Lower the thinking level for latency-sensitive or routine requests.

/ 06

How do I confirm a cache hit?

Check usage.prompt_tokens_details.cached_tokens. A repeated prompt alone does not prove that the prefix was reused.

/ 07

Can I use temperature and top_p?

The Gemini 3.8 Flash migration guidance recommends removing temperature, top_p, and top_k. Use the thinking-level control instead.

/ 08

What are the current official rates?

The introductory standard rates are $0.75 input, $3.75 output, and $0.075 cached input per million tokens through December 31, 2026.

AIREITER

문의가 있으신가요? 연락처
[email protected]

新速率有限公司NEWRATE LIMITED香港九龍花園街 2-16 號好景商業中心 2304 室Room 2304, Haojing Commercial Center, 2-16 Garden Street, Kowloon, Hong Kong

LLM

Gemini 3.8 FlashClaude Fable 5.1GLM-5.3 FlashGemini 3.6 FlashGemini 3.1 Pro

AI 비디오

Gemini Omni 1.1 Flash ExtMiniMax H3Kling 3.0 Motion ControlKling 3.0 TurboKling 3.0

AI 이미지

Grok Imagine Image 2.0Midjourney V8.1Midjourney V7Z-Image TurboKrea 2 Turbo

블로그

모두 보기 →

회사

개인정보 처리방침서비스 약관환불 정책

© 2026 AIReiter. All rights reserved.