Skip to main content
google avatar

Gemini 3.7 Flash API

google/gemini-3.7-flash

Reasoning-first flagship text model for coding and agentic work, with tunable thinking levels, tool calling and streaming over an OpenAI-compatible endpoint.

reasoningtool callingjson mode
$2.1 in · $10.5 out per 1M tokens

Chat with this model

Chat

Try this model — replies stream in live.
You need to be logged in to run this model and view results.
Log in

Model Pricing

Pricing

This model is billed per token, at separate rates for what you send and what it produces.

Input tokens
$2.1
per 1M tokens
Cached input tokens
$0.21
per 1M tokens
Output tokens
$10.5
per 1M tokens

Every request rounds up to the nearest $0.01.

If a run reports no token usage, it bills a flat $0.02.

Gemini 3.7 Flash API

Gemini 3.7 Flash is a text-to-text AI model by google. On ModelRunner it runs through a REST API or via MCP from any AI assistant with pay-per-use pricing.

POST https://queue.modelrunner.run/google/gemini-3.7-flash

cURL

# Submit a request to the queue. Input fields go at the top level of the
# body. The optional reserved "metadata" object holds your own flat string
# tags — stored on the request, never sent to the model; filter later with
# GET https://queue.modelrunner.run/requests?metadata=<url-encoded JSON>.
curl -X POST https://queue.modelrunner.run/google/gemini-3.7-flash \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "A function is supposed to return the k-th largest element of an unsorted list. This implementation is subtly wrong: def kth(nums, k): return sorted(nums)[k]. Find every bug, explain why each is wrong, and give a corrected version with its time complexity."
      }
    ],
    "max_tokens": 8000,
    "reasoning_effort": "high",
    "metadata": {
      "project": "my-project"
    }
  }'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }

# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/google/gemini-3.7-flash/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/google/gemini-3.7-flash/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("google/gemini-3.7-flash", {
  input: {
    "messages": [
      {
        "role": "user",
        "content": "A function is supposed to return the k-th largest element of an unsorted list. This implementation is subtly wrong: def kth(nums, k): return sorted(nums)[k]. Find every bug, explain why each is wrong, and give a corrected version with its time complexity."
      }
    ],
    "max_tokens": 8000,
    "reasoning_effort": "high"
  },
});
console.log(result);

Python

import os
import requests

headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}

submitted = requests.post(
    "https://queue.modelrunner.run/google/gemini-3.7-flash",
    headers=headers,
    json={
      "messages": [
        {
          "role": "user",
          "content": "A function is supposed to return the k-th largest element of an unsorted list. This implementation is subtly wrong: def kth(nums, k): return sorted(nums)[k]. Find every bug, explain why each is wrong, and give a corrected version with its time complexity."
        }
      ],
      "max_tokens": 8000,
      "reasoning_effort": "high"
    },
).json()

# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()

Input parameters

NameTypeRequiredDescription
messagesarrayyesOpenAI-style conversation history. Each item is an object with a `role` (`system`, `user`, `assistant` or `tool`) and `content`.
streambooleannoReturn the reply as a Server-Sent Events stream of deltas terminated by `data: [DONE]`. Default: false.
reasoning_effortenumnoHow much the model thinks before answering. Thinking tokens bill as output tokens. Default: "medium".
max_tokensintegernoUpper bound on generated tokens. Thinking consumes this budget, so allow generous headroom.
toolsarraynoOpenAI-format tool definitions the model may call.
tool_choiceno`auto`, `none`, `required`, or a specific tool.
response_formatobjectnoSet `{"type":"json_object"}` for JSON mode.
stopnoUp to 4 stop sequences.
seedintegernoBest-effort determinism hint.

Machine-readable: OpenAPI schema · llms.txt

Use Gemini 3.7 Flash from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and Gemini 3.7 Flash becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint google/gemini-3.7-flash.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp

Then ask your assistant, for example: “Run google/gemini-3.7-flash on ModelRunner to generate text”. MCP setup guide.

Model Details

Model Details

Gemini 3.7 Flash is a **thinking model**: it reasons internally before answering, which makes it markedly stronger on complex coding, multi-step agentic workflows and reliable tool use than a single-pass model of similar cost.

Thinking is on by default at a `medium` level and is tunable (`low`, `medium`, `high`) — more thinking generally means better answers on hard problems and higher cost, since **thinking tokens are billed as output tokens**. It supports a 1M-token context window and up to 64k output tokens.

Served through the **OpenAI-compatible chat completions API**:

``` POST https://queue.modelrunner.run/google/gemini-3.7-flash/chat/completions ```

Point any OpenAI SDK or OpenAI-compatible tool at `base_url = https://queue.modelrunner.run/google/gemini-3.7-flash` with your ModelRunner API key. Streaming, tool calling and JSON mode all work.

⚠️ This generation **no longer accepts the `temperature`, `top_p` and `top_k` sampling parameters**. Tools that send them by default may need them disabled.

Billing is per token from the model's own reported usage, thinking tokens included. Cached input is billed at a reduced rate.

The request body follows OpenAI's chat completions shape: a `messages` array of `system`/`user`/`assistant`/`tool` turns, `reasoning_effort` (`low`/`medium`/`high`, default `medium`) to trade thinking depth for cost, a `max_tokens` cap (thinking consumes this budget, so leave generous headroom), a `seed` for best-effort determinism, and up to four `stop` sequences. Pass an OpenAI-format `tools` array with `tool_choice` for function calling, and set `response_format` to `{"type": "json_object"}` for guaranteed-valid JSON. Responses come back as a standard ChatCompletion object; `usage.completion_tokens_details.reasoning_tokens` reports how many tokens went to thinking versus the visible reply.

Pricing is $2.10 per 1M input tokens, $0.21 per 1M cached input tokens, and $10.50 per 1M output tokens (thinking tokens bill at the output rate). Reach for this tier over Gemini 3.5 Flash when a task genuinely benefits from multi-step reasoning — non-trivial coding, agentic tool-use loops with several dependent steps, or problems where a single-pass answer is often wrong — and drop `reasoning_effort` to `low` when speed matters more than depth.