OpenAI: GPT-5 Codex vs Google: Gemini 3.1 Pro Preview Custom Tools: Which AI Model Is Better?

Updated March 24, 2026· Based on independent benchmark data

Quick Verdict

Google: Gemini 3.1 Pro Preview Custom Tools leads in intelligence with a score of 57.2 vs 44.6. OpenAI: GPT-5 Codex is 1.6x cheaper at $1.25/1M tokens vs $2.00/1M. For speed, OpenAI: GPT-5 Codex wins at 170 tok/s vs 117 tok/s.

Head-to-Head Comparison

MetricOpenAI: GPT-5 CodexGoogle: Gemini 3.1 Pro Preview Custom Tools
Intelligence Score44.657.2
Coding Score38.955.5
Math Score98.7N/A
Speed (tok/s)170 tok/s117 tok/s
Latency (TTFT)4.79s21.91s
Input Price / 1M tokens$1.25$2.00
Output Price / 1M tokens$10$12
Context Window400K1.0M
Max Output Tokens128K66K
Input ModalitiesText + ImageText + Audio + Image + Video + File
Output ModalitiesTextText
Free TierNoNo

Detailed Analysis

Intelligence & Quality

Google: Gemini 3.1 Pro Preview Custom Tools outperforms OpenAI: GPT-5 Codex on the Artificial Analysis intelligence index with a score of 57.2 compared to 44.6. For coding tasks, Google: Gemini 3.1 Pro Preview Custom Tools has the edge with a coding score of 55.5 vs 38.9.

Speed & Latency

OpenAI: GPT-5 Codex generates output significantly faster at 170 tok/s compared to Google: Gemini 3.1 Pro Preview Custom Tools's 117 tok/s, making it 1.5x faster for streaming responses. Time to first token is 4.79s for OpenAI: GPT-5 Codex vs 21.91s for Google: Gemini 3.1 Pro Preview Custom Tools, which affects perceived responsiveness in interactive applications.

Pricing

OpenAI: GPT-5 Codex is more affordable at $1.25/1M input tokens ($10/1M output), while Google: Gemini 3.1 Pro Preview Custom Tools costs $2.00/1M input ($12/1M output). For a typical workload of 100 requests per day at 2,000 tokens each, OpenAI: GPT-5 Codex would cost approximately $7.50/month vs $12.00/month for Google: Gemini 3.1 Pro Preview Custom Tools in input costs alone.

Context Window

Google: Gemini 3.1 Pro Preview Custom Tools offers a larger context window at 1.0M tokens compared to OpenAI: GPT-5 Codex's 400K. This means Google: Gemini 3.1 Pro Preview Custom Tools can process roughly 524 pages of text in a single request vs 200 pages for OpenAI: GPT-5 Codex. For output length, OpenAI: GPT-5 Codex can generate up to 128K tokens per response vs 66K for Google: Gemini 3.1 Pro Preview Custom Tools.

Best Use Cases

Choose OpenAI: GPT-5 Codex when you need faster output (170 tok/s), lower cost. Choose Google: Gemini 3.1 Pro Preview Custom Tools when you need higher intelligence (57.2), stronger coding performance (55.5), larger context window (1.0M).

Choose OpenAI: GPT-5 Codex if:

  • You need faster throughput (170 tok/s vs 117 tok/s)
  • You want lower latency (4.79s vs 21.91s TTFT)
  • Budget is a concern ($1.25/1M vs $2.00/1M)

Choose Google: Gemini 3.1 Pro Preview Custom Tools if:

  • You need higher intelligence (score: 57.2 vs 44.6)
  • You prioritize coding performance (score: 55.5 vs 38.9)
  • You need a larger context window (1.0M vs 400K)

Frequently Asked Questions

Is OpenAI: GPT-5 Codex better than Google: Gemini 3.1 Pro Preview Custom Tools for coding?

Google: Gemini 3.1 Pro Preview Custom Tools scores higher on coding benchmarks (55.5 vs 38.9), making it the better choice for programming tasks.

Which is cheaper, OpenAI: GPT-5 Codex or Google: Gemini 3.1 Pro Preview Custom Tools?

OpenAI: GPT-5 Codex is cheaper at $1.25/1M input tokens vs $2.00/1M for Google: Gemini 3.1 Pro Preview Custom Tools.

Is OpenAI: GPT-5 Codex faster than Google: Gemini 3.1 Pro Preview Custom Tools?

OpenAI: GPT-5 Codex is faster, producing output at 170 tok/s compared to Google: Gemini 3.1 Pro Preview Custom Tools's 117 tok/s.

Can OpenAI: GPT-5 Codex process images?

Yes, OpenAI: GPT-5 Codex supports image input. Google: Gemini 3.1 Pro Preview Custom Tools also supports images.

Which has a larger context window, OpenAI: GPT-5 Codex or Google: Gemini 3.1 Pro Preview Custom Tools?

Google: Gemini 3.1 Pro Preview Custom Tools has a larger context window at 1.0M compared to OpenAI: GPT-5 Codex's 400K.

Should I use OpenAI: GPT-5 Codex or Google: Gemini 3.1 Pro Preview Custom Tools?

It depends on your priorities. Google: Gemini 3.1 Pro Preview Custom Tools scores higher on intelligence (57.2), but OpenAI: GPT-5 Codex may be better for specific use cases like budget-conscious projects or speed-critical applications.

Related Comparisons

Benchmark data by Artificial Analysis

Data last synced: March 24, 2026

OpenAI: GPT-5 Codex vs Google: Gemini 3.1 Pro Preview Custom Tools 2026: Benchmarks, Pricing & Speed Compared | AIToolRank