Web Search

Web Search - Real-time Information Access for AI Models

Enhance responses with up-to-date web data

LLMAPI.dev's web search integration allows you to augment any model with real-time information from the internet, ensuring responses are grounded in current data rather than limited to the model's training cutoff.

Real-time Information

Access the latest information from across the web, ensuring your AI responses are always current and relevant.

Enhanced Accuracy

Ground AI responses in factual, up-to-date information rather than relying solely on training data.

Current Events

Stay informed about breaking news, market changes, and recent developments in any field.

How Web Search Enhances AI Responses

User Query

Question submitted

Web Search

Real-time data retrieval

Enhanced Response

AI + current data

Enabling Web Search

You can incorporate web search capabilities in two simple ways:

1. Using the suffix shortcut
Append :online to any model slug for instant web search capabilities
{
  "model": "openai/gpt-4o:online",
  "messages": [
    {"role": "user", "content": "What are the latest developments in quantum computing?"}
  ]
}
2. Using the web plugin
For more customization options, use the explicit plugin configuration
{
  "model": "openai/gpt-4o",
  "plugins": [{ "id": "web" }],
  "messages": [
    {"role": "user", "content": "What are the latest developments in quantum computing?"}
  ]
}

Accessing Search Results

All web search results are standardized in the API response, regardless of which model you're using. Search annotations follow a consistent schema in the message object, making it easy to extract and utilize the retrieved information:

{
  "role": "assistant",
  "content": "According to recent developments, quantum computing has seen significant advances...",
  "tool_calls": [
    {
      "id": "call_abc123",
      "type": "function",
      "function": {
        "name": "web_search",
        "arguments": "{\"query\":\"latest developments quantum computing\"}"
      }
    }
  ]
}

Customizing Search Behavior

The web search plugin offers several customization options to tailor the search experience to your specific needs:

{
  "plugins": [{
    "id": "web",
    "settings": {
      "max_results": 8,
      "search_prompt": "Use these search results to provide current information about {query}. Today's date is {date}."
    }
  }]
}

Parameters you can adjust include:

  • max_results
    Control the number of search results returned (default: 5)
  • search_prompt
    Customize how search results are presented to the model

By default, the search prompt includes the current date to help the model understand the temporal context of the information.

Pricing Structure

LLMAPI.dev's web search feature is priced based on usage:

Plugin-based Search

Cost per 1,000 results

With default 5 results per query ≈ $0.02 per request

$4.00
Native Web Search Models
Some models have built-in web search capabilities with different pricing tiers based on search context size

Search Context Levels:

Low

Basic search with minimal context

Medium

Standard search with moderate context

High

Comprehensive search with extensive context

{
  "web_search_options": {
    "context_size": "medium"
  }
}

Model-specific Pricing:

Model TypeLow ContextMedium ContextHigh Context

Premium Models

GPT-4, GPT-4o, Claude Opus equivalents

+$0.01/query
+$0.03/query
+$0.06/query

Standard Models

GPT-3.5, Claude Sonnet equivalents

+$0.005/query
+$0.015/query
+$0.03/query