gemini-3.1-pro API

At provider list price streamingvisionreasoningfunction-callingweb-search

Gemini 3.1 Pro is Google's flagship reasoning model with a 1M-token context window, available on CaMeL Hub at $2.00 per 1M input tokens and $12.00 per 1M output tokens through one OpenAI-compatible endpoint β€” set base_url to https://api.camel-hub.com/v1 and call it with the SDK you already use. Prompts longer than 200K tokens bill at the long-context tier of $4.00 in / $18.00 out per 1M.

Pricing

per 1M input tokensper 1M output tokens
CaMeL Hub (≀ 200000 tokens)$2.00$12.00
CaMeL Hub (long context)$4.00$18.00
Provider list price$2.00$12.00

Prices are the public default-group rate in USD per 1M tokens; input and output are billed separately. Β· Provider list price Β· verified 2026-07-11

Specifications

Provider
Google
Context window
1048576 tokens
Max output
65536 tokens
Capabilities
streaming, vision, reasoning, function-calling, web-search
Endpoints
openai, gemini
Gemini 3.1 Pro is the top model of Google's Gemini 3.1 line, built for complex problem-solving, agentic workflows, and serious coding work. It is a thinking model: it reasons internally before producing an answer, which noticeably improves results on multi-step planning, math, and hard debugging compared with flash-class models β€” at the cost of some additional output tokens, since reasoning tokens are billed as output. It accepts images alongside text, calls functions reliably enough to drive multi-tool agents, and can ground answers with web search. Its defining spec is scale: a 1,048,576-token input window with up to 65,536 output tokens, both documented by Google. That is enough to hold an entire mid-sized codebase, a full legal document set, or hundreds of pages of research in a single request. Pricing is segmented by prompt size: requests up to 200K prompt tokens bill at $2.00 per 1M input and $12.00 per 1M output tokens, while anything above 200K moves to $4.00 / $18.00. In practice that puts Gemini 3.1 Pro in the value sweet spot for long-context work β€” flagship-grade reasoning without Opus-class prices, and one of the cheapest ways to run 500K+-token prompts at all. On CaMeL Hub the model is exposed on two endpoints: the OpenAI-compatible chat completions API (change base_url to https://api.camel-hub.com/v1, keep your existing OpenAI SDK code) and the native Gemini API format for tools that speak it directly. Streaming works on both. You top up with Alipay, WeChat Pay, or international cards, or pick a subscription plan β€” no Google Cloud project, billing account, or region workarounds required.

What it is good for

Quickstart

OpenAI-compatible: set base_url to https://api.camel-hub.com/v1 and use your CaMeL Hub API key. No SDK changes needed.

cURL

curl https://api.camel-hub.com/v1/chat/completions \
  -H "Authorization: Bearer $CAMEL_HUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.1-pro",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Python

from openai import OpenAI

client = OpenAI(
    api_key="$CAMEL_HUB_KEY",
    base_url="https://api.camel-hub.com/v1",  # <-- the only change vs. the OpenAI default
)

resp = client.chat.completions.create(
    model="gemini-3.1-pro",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

Node.js

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.CAMEL_HUB_KEY,
  baseURL: "https://api.camel-hub.com/v1", // <-- the only change vs. the OpenAI default
});

const resp = await client.chat.completions.create({
  model: "gemini-3.1-pro",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);

Get an API key Browse integration guides

Frequently asked questions

How is Gemini 3.1 Pro billed on CaMeL Hub?

Input and output tokens are billed separately. For prompts up to 200K tokens you pay $2.00 per 1M input tokens and $12.00 per 1M output tokens. Prompts above 200K tokens switch to the long-context tier: $4.00 per 1M input and $18.00 per 1M output. Note that internal reasoning (thinking) tokens are counted as output tokens.

Does it support streaming, function calling, and image input?

Yes. Streaming responses, OpenAI-style function/tool calling, and vision (image) input all work through CaMeL Hub, as does web-search grounding. Set stream: true for token-by-token output, and pass tools exactly as you would with the OpenAI SDK.

How large is the context window?

Google documents a 1,048,576-token input limit and a 65,536-token output limit for this model. Keep in mind that prompts beyond 200K tokens are billed at the higher long-context tier ($4.00 in / $18.00 out per 1M tokens).

How do I start using Gemini 3.1 Pro?

Create an account at https://api.camel-hub.com/console, generate an API key, and point your OpenAI SDK at base_url https://api.camel-hub.com/v1 with model "gemini-3.1-pro". A native Gemini-format endpoint is also available if your tooling speaks the Gemini API directly.

Is CaMeL Hub affiliated with Google?

No. CaMeL Hub is an independent API gateway operated by Nodexi Agentics, LLC. Gemini is a trademark of Google LLC; the model name is used only to identify the compatible model being served.

More from Google

Compare with other models