We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.

Web search

Endpoints

Web search

Ground model answers in live web results on api14 with the :online variant, plugins or web_search_options, and read the cited sources.

Try it in the playground

Web search adds live web results to the model's context and returns URL citations. You can turn it on for any text model in three ways.

1. The :online variant

Add :online to any model id:

{ "model": "openai/gpt-5-mini:online", "messages": [{ "role": "user", "content": "What happened in AI this week?" }] }

:online uses the same pricing, key allowlist and plan rules as the base model. See Model ids.

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api14.com/api/v1",
  apiKey: process.env.API14_API_KEY,
});

const result = await client.chat.completions.create({
  "model": "openai/gpt-5-mini:online",
  "messages": [
    {
      "role": "user",
      "content": "What are the latest AI model releases this week?"
    }
  ]
});
console.log(result.choices[0].message.content);

2. The web plugin

The plugin gives you control over the search:

{
  "model": "anthropic/claude-sonnet-4.5",
  "messages": [{ "role": "user", "content": "Latest stable Node.js version?" }],
  "plugins": [
    { "id": "web", "max_results": 5, "engine": "exa", "search_prompt": "Use these sources:" }
  ]
}
FieldTypeDescription
plugins[].idstring"web"
max_resultsintegerNumber of results to inject (default 5).
enginestring"native" (the provider's own search, when available) or "exa". If you leave it out, native is used when available, otherwise Exa.
search_promptstringText placed before the injected results.

3. web_search_options

The OpenAI-style option for models with native search:

{
  "model": "openai/gpt-4o-search-preview",
  "messages": [{ "role": "user", "content": "Who won yesterday's match?" }],
  "web_search_options": { "search_context_size": "high" }
}

search_context_size is "low", "medium" or "high". It sets how much search content is retrieved, and the price.

Response

Citations are returned as annotations on the message:

{
  "choices": [
    {
      "index": 0,
      "finish_reason": "stop",
      "message": {
        "role": "assistant",
        "content": "The latest LTS release is ... [nodejs.org](https://nodejs.org/en/blog)",
        "annotations": [
          {
            "type": "url_citation",
            "url_citation": { "url": "https://nodejs.org/en/blog", "title": "Node.js Blog", "start_index": 25, "end_index": 60, "content": "..." }
          }
        ]
      }
    }
  ],
  "usage": { "prompt_tokens": 2410, "completion_tokens": 85, "total_tokens": 2495, "cost": 0.02061 }
}

Pricing

On top of tokens, search has its own price: Exa is charged per result, and native search per request according to the model's web_search price. The search results also count as input tokens. All of it is included in usage.cost and debited in USD. See Pricing & billing.

Errors

The same as Chat completions. See Errors.