GPT-4o mini

Models

Model details

Model
gpt-4o-mini
Provider
cloudflare-ai-gateway
API
openai-responses
Base URL
https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai
Input
text, image
Reasoning
No
Context window
128,000
Max tokens
16,384
Show configuration
{
  "providers": {
    "cloudflare-ai-gateway": {
      "apiKey": "YOUR_API_KEY",
      "models": [
        {
          "id": "gpt-4o-mini",
          "name": "GPT-4o mini",
          "reasoning": false,
          "input": [
            "text",
            "image"
          ],
          "contextWindow": 128000,
          "maxTokens": 16384,
          "cost": {
            "input": 0.075,
            "output": 0.3,
            "cacheRead": 0.0375,
            "cacheWrite": 0
          },
          "compat": {
            "supportsStrictMode": true
          }
        }
      ],
      "api": "openai-responses",
      "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai"
    }
  }
}

Pricing

USD per million tokens. A tier is selected from the total input tokens in each request and applies to that entire request.

Pricing rates for GPT-4o mini
Request inputInputOutputCache readCache write
All requests$0.075$0.3$0.0375$0

Session cost calculator

Estimate the requests made during an agent session. A user turn can make several model calls while using tools, so costs are calculated per model request.

Session shape
Rounded median shapes from recent Pi agent sessions.
Warm-request cache reuse
Effective token reuse combines partial hits and occasional complete misses.
Estimated session$0.00
Uncached input
—
Cache reads
—
Uncached prefixes
—
Cache writes
—
Output
—
Without caching
—

The first request starts cold unless marked otherwise. Output is billed separately from context growth because reasoning tokens are not always retained. This remains a directional estimate: providers differ in eligibility, rounding, and retention.

Compatibility flags

Effective values after applying Pi's API defaults and model overrides.

Effective compatibility flags for GPT-4o mini
FeatureValue
supportsDeveloperRoleYes
sendSessionIdHeaderYes
supportsLongCacheRetentionYes
supportsStrictModeYes