Chat GPT 4o search preview API

openai/gpt-4o-search-preview
GPT-4o Search Preview blends OpenAI's GPT-4o capabilities with live web search results, allowing users to get up-to-date answers grounded in real-time data.
Context
128K tokens
Input
$3.25 / 1M
Output
$13 / 1M
Released
Aug 7, 2025

How to use Chat GPT 4o search preview API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to openai/gpt-4o-search-preview.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "openai/gpt-4o-search-preview",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "openai/gpt-4o-search-preview",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/chat/completions \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-4o-search-preview","messages":[{"role":"user","content":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Chat GPT 4o search preview API Pricing

TypePrice
Input
$3.25 / 1M
Output
$13 / 1M

Chat GPT 4o search preview vs other models

ModelInputOutputContextBest for
$3.25 / 1M
$13 / 1M
128K tokens
Chat + assistants
$6.5 / 1M tokens
$39 / 1M tokens
1.05M tokens
Reasoning + agents
$2.6 / 1M tokens
$13 / 1M tokens
1M tokens
Balanced coding + agents
$3.9 / 1M tokens
$19.5 / 1M tokens
1M tokens
Long-context, multimodal & agentic workflows
$0.65 / 1M tokens
$3.9 / 1M tokens
1.05M tokens
Reasoning + agents

Frequently asked questions

Chat GPT 4o search preview has a 128,000 tokens context window.

Chat GPT 4o search preview takes text as input and returns text.

Use openai/gpt-4o-search-preview as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

Chat GPT 4o search preview became available on August 7, 2025.

Chat GPT 4o search preview is priced at input $3.25 / 1M, output $13 / 1M.

Yes, Chat GPT 4o search preview can stream responses as they are generated.

Chat GPT 4o search preview was built by OpenAI.

No. It only supports text input and text output, with no other modalities listed.

It is accessed via https://api.aimlapi.com/v1/chat/completions.

Start building with Chat GPT 4o search preview

Get API Key
1000+ models, one API.