Web access

Web Access

Web search can give a supported model access to current information beyond its training data. Support is model- and endpoint-specific, so check the model catalog before using this example:

python
from openai import OpenAI client = OpenAI(    base_url="https://api.livrouter.com/v1") response = client.responses.create(    model="YOUR_WEB_SEARCH_MODEL_ID",    tools=[{"type": "web_search_preview"}],    input="What was a positive news story from today?") print(response.output_text)

Note: Replace YOUR_WEB_SEARCH_MODEL_ID with a model ID that the current catalog marks as supporting web search. Do not assume that adding a suffix enables the feature.