inference.eu

POST /v1/responses

Web search tool: current answers with sources, run from the EU

Language models only know what was in their training data. The web search tool lets a model look things up while it answers: recent regulation, prices on a supplier's site, release notes or today's news. You add one entry to the `tools` array of a Responses request, and the answer comes back with citations to the pages it used.

  1. 01API format: OpenAI
  2. 02EU data centres
  3. 03Covered by one DPA
POST /v1/responses
curl https://api.inference.eu/v1/responses \
  -H "Authorization: Bearer $INFERENCE_EU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-oss-120b",
    "tools": [{
      "type": "web_search",
      "user_location": {"type": "approximate", "country": "DE", "city": "Berlin"}
    }],
    "input": "What changed in the German e-invoicing rules for B2B companies this year? Cite your sources."
  }'

What the tool does

Add {"type": "web_search"} to tools in a POST /v1/responses request. The model decides whether a search is needed. If it is, the API runs one or more searches from our infrastructure in the EU, reads the relevant results, and gives the model the content to work with. The model then writes its answer based on those sources.

Searches the model runs appear in output as web_search_call items with their status. The answer is a message item whose output_text content carries annotations of type url_citation, each with the url, the page title and the start_index and end_index of the text it supports.

Key settings

user_location with type: "approximate" and fields such as country, city and region makes results more relevant to a place, which matters for questions about local law, shops or events. Use an ISO country code such as DE, FR or NL.

tool_choice set to {"type": "web_search"} forces a search, which helps when you always want fresh sources. Leave it on auto to let the model skip searching for questions it can answer directly, which is faster. In the prompt, say which sources you prefer, for example official government sites, and ask the model to cite them; it follows such instructions well.

A practical pattern

Web search suits research assistants, competitor and market monitoring, support bots that need current product information and agents that check facts before acting. Show the citations in your interface as links next to the sentences they support, so readers can verify claims in one click.

For internal knowledge, use your own retrieval with embeddings instead, and combine both in one request when a question needs company data and public information. Store the cited URLs with the answer if you need an audit trail of where information came from.

Errors and edge cases

The web is not always right. Search results can be outdated, biased or wrong, and the model can misread a page. Ask for citations, show them, and keep a person in the loop for decisions with legal or financial consequences.

Some pages block automated access or sit behind logins and paywalls, so they cannot be read. If no useful result is found, the model should say so; tell it to in your instructions. Search adds time and input tokens to a request, so do not force it where it is not needed. The search query, not your full conversation, is what goes to the search index.

Web search: common questions

The questions buyers, developers and legal teams ask us most. Something missing? Ask us directly.

Ask a question

Move your AI workloads to EU infrastructure

Tell us which models you use and roughly how much traffic you have. We reply within one working day with pricing and next steps.

  • Reply within one working day
  • Pricing for your volume
  • DPA ready to sign