The cost of using the GPT-4o search API (called gpt-4o-search-preview) has multiple pricing components that you need to consider.
Base Model Token Pricing
The gpt-4o-search-preview model has the following base pricing for token usage:
- Input tokens: $2.50 per 1 million tokens
- Output tokens: $10.00 per 1 million tokens[2][7]
This is the same base pricing as the standard GPT-4o model. These costs apply to the text processing aspects of your API calls.
Web Search Tool Pricing
In addition to the base token costs, when you use the web search functionality, there's a separate charge based on the search context size:
- Low search context: $30.00 per 1,000 calls
- Medium search context (default): $35.00 per 1,000 calls
- High search context: $50.00 per 1,000 calls[1][2]
The search context refers to how much web content is retrieved and processed for each search. Higher context sizes provide more comprehensive information but at a higher cost.
Alternative: GPT-4o-mini-search-preview
If you're looking for a more economical option, there's also a mini version available:
- Base token pricing: 0.15per1Minputtokensand0.60 per 1M output tokens
- Web search tool calls:
- Low search context: $25.00 per 1,000 calls
- Medium search context (default): $27.50 per 1,000 calls
- High search context: $30.00 per 1,000 calls[2][6]
Pricing Notes
Some important considerations about this pricing:
-
The web search tool pricing is inclusive of tokens used to synthesize information from the web[2].
-
Some services may charge slightly different rates when using third-party integrations. For example, when using GPT for Excel with your own API key, gpt-4o-search-preview may be charged at $5 per 1M tokens[6].
-
If you're using Azure OpenAI Service rather than direct OpenAI API access, pricing may vary. Azure has regional, global, and data zone deployment options that affect pricing[8].
-
When calculating your expected costs, remember that a typical page of content (about 900 words) would generate approximately 1,200 tokens, which would cost about $0.012 in output tokens using the GPT-4o model[3][9].
To optimize costs when using the search API, consider using cached inputs when possible (which can reduce input token costs by 50%), carefully selecting the appropriate search context size for your use case, and considering whether the mini version might suffice for your needs.