Skip to main content
google avatar

Gemini 3.5 Flash API

google/gemini-3.5-flash

Fast, general-purpose text model served over an OpenAI-compatible chat completions endpoint, with tool calling, JSON mode and streaming.

reasoningtool callingjson mode
$2.1 in · $12.6 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
$12.6
per 1M tokens

Every request rounds up to the nearest $0.01.

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

Gemini 3.5 Flash API

Gemini 3.5 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.5-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.5-flash \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "Think carefully and thoroughly, then answer: design a rate limiter for a multi-tenant API. Compare token bucket, leaky bucket, sliding window log and sliding window counter across accuracy, memory, burst behaviour and distributed coordination. Then recommend one and justify it in about 400 words."
      }
    ],
    "max_tokens": 8000,
    "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.5-flash/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/google/gemini-3.5-flash/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

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

const result = await modelrunner.subscribe("google/gemini-3.5-flash", {
  input: {
    "messages": [
      {
        "role": "user",
        "content": "Think carefully and thoroughly, then answer: design a rate limiter for a multi-tenant API. Compare token bucket, leaky bucket, sliding window log and sliding window counter across accuracy, memory, burst behaviour and distributed coordination. Then recommend one and justify it in about 400 words."
      }
    ],
    "max_tokens": 8000
  },
});
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.5-flash",
    headers=headers,
    json={
      "messages": [
        {
          "role": "user",
          "content": "Think carefully and thoroughly, then answer: design a rate limiter for a multi-tenant API. Compare token bucket, leaky bucket, sliding window log and sliding window counter across accuracy, memory, burst behaviour and distributed coordination. Then recommend one and justify it in about 400 words."
        }
      ],
      "max_tokens": 8000
    },
).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.
temperaturenumbernoSampling temperature. Lower is more deterministic.
max_tokensintegernoUpper bound on generated tokens.
top_pnumbernoNucleus sampling probability mass.
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.5 Flash from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and Gemini 3.5 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.5-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.5-flash on ModelRunner to generate text”. MCP setup guide.

Model Details

Model Details

Gemini 3.5 Flash is a fast, general-purpose large language model for everyday text work: summarisation, extraction, classification, rewriting, code assistance and multi-turn conversation.

It is served through the **OpenAI-compatible chat completions API** rather than the queue submit/poll contract:

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

Point any OpenAI SDK or OpenAI-compatible tool at `base_url = https://queue.modelrunner.run/google/gemini-3.5-flash` with your ModelRunner API key. Streaming (`"stream": true`), tool calling, JSON mode and multi-turn `messages` all work; parameters the platform does not interpret are forwarded to the model verbatim.

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

The request body mirrors OpenAI's chat completions shape: a `messages` array of `system`/`user`/`assistant`/`tool` turns, plus optional `temperature` and `top_p` for sampling control, `max_tokens` to cap generation length, a `seed` for best-effort determinism, and up to four `stop` sequences. Pass an OpenAI-format `tools` array together with `tool_choice` (`auto`, `none`, `required`, or a specific tool) to let the model call functions, and set `response_format` to `{"type": "json_object"}` to force valid JSON output. The response comes back as a standard ChatCompletion object — `id`, `model`, `choices[]` and a `usage` block.

Pricing is $2.10 per 1M input tokens, $0.21 per 1M cached input tokens, and $12.60 per 1M output tokens, so repeated system prompts or long shared context cut cost sharply once cached. It's a solid default for chat-style product features, agent tool loops, and everyday summarisation, extraction and rewriting work — reach for Flash-Lite when volume matters more than quality, or Gemini 3.7 Flash when a task needs deeper multi-step reasoning.