Gemini 3.1 Pro Preview Custom Tools API

Gemini 3.1 Pro Preview Custom Tools on AIMLAPI.

Modalities
Image, TextText
In / Out price
$2.12/$12.7per 1M
Context window
1.05M tokens
Released
Feb 25, 2026

Gemini 3.1 Pro Preview Custom Tools overview

Gemini 3.1 Pro Preview Custom Tools specs

Model ID
google/gemini-3.1-pro-preview-customtools
Developer
Google
Context window
1,048,756 tokens
Max output
65,536 tokens
Input
Image, Text
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

What is Gemini 3.1 Pro Preview Custom Tools API?

Where to Use Gemini 3.1 Pro Preview Custom Tools

Coding and code review
Generate, debug, and review code across languages, reading whole files or repos in a single prompt.

Agentic and multi-step workflows
Reliable tool-calling and instruction-following suit agent loops that plan, call tools, and iterate.

Use cases

Gemini 3.1 Pro Preview Custom Tools is suited to agentic workflows that use custom tools and bash, especially when the model should prioritize registered custom tools like file or code-search tools.

It is documented as a good fit for AI coding assistants that rely on structured tools such as file viewing and editing, rather than defaulting to bash.

It is also suited to DevOps agents that need to call CI/CD systems through tools, as well as MCP workflows that orchestrate multi-step tool-based processes.

Another documented use case is agent applications that require permission-controlled tools and structured logging for auditing or compliance.

Capabilities

  • Function calling
  • Reasoning
  • Streaming
  • Structured outputs
  • Web search

Gemini 3.1 Pro Preview Custom Tools API pricing

Gemini 3.1 Pro Preview Custom Tools pricing in US dollars
UsagePriceUnit
Input$2.121M tokens
Output$12.71M tokens
Cached input$0.21161M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

Gemini 3.1 Pro Preview Custom Tools vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
Gemini 3.1 Pro Preview Custom Tools$2.12$12.7
Gemini 3.5 Flash Lite$0.3$2.5
Gemini 3.8 Flash$0.75$3.75
Gemini 3.7 Flash$0.75$3.75
Gemini 4 Argon$2$10

How to use the Gemini 3.1 Pro Preview Custom Tools API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "google/gemini-3.1-pro-preview-customtools",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

Gemini 3.1 Pro Preview Custom Tools FAQ

What is the context window of Gemini 3.1 Pro Preview Custom Tools?

Gemini 3.1 Pro Preview Custom Tools has a 1,048,756 tokens context window and can return up to 65,536 tokens.

What inputs and outputs does Gemini 3.1 Pro Preview Custom Tools support?

Gemini 3.1 Pro Preview Custom Tools takes image, text as input and returns text.

What is the model ID for Gemini 3.1 Pro Preview Custom Tools?

Use google/gemini-3.1-pro-preview-customtools as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

How much does Gemini 3.1 Pro Preview Custom Tools cost?

Gemini 3.1 Pro Preview Custom Tools costs $2.12 input and $12.7 output per 1M tokens on AI/ML API, billed as you go with no subscription.

Does Gemini 3.1 Pro Preview Custom Tools support streaming?

Yes, Gemini 3.1 Pro Preview Custom Tools can stream responses as they are generated.

Can Gemini 3.1 Pro Preview Custom Tools read images?

Yes, Gemini 3.1 Pro Preview Custom Tools accepts image input alongside text.

Who created Gemini 3.1 Pro Preview Custom Tools?

Gemini 3.1 Pro Preview Custom Tools was built by Google.

What kinds of tasks is Gemini 3.1 Pro Preview Custom Tools suited for?

It supports function calling, reasoning, structured outputs, web search, and parallel tool calls, making it suited for tasks that combine multi-step reasoning with tool use.

Start building with Gemini 3.1 Pro Preview Custom Tools

Gemini 3.1 Pro Preview Custom Tools API

google/gemini-3.1-pro-preview-customtools

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "google/gemini-3.1-pro-preview-customtools",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'