Skip to main content
Serverless models can search the web while they answer. You ask for search in the request, and Lyceum runs the searches, gives the model the results, and returns an answer that cites its sources. You don’t need a search provider or API key of your own.

Chat Completions

Add web_search_options to a chat completion. An empty object turns search on:
The model cites results as [1], [2] and so on. Each cited source comes back as a url_citation annotation on the message, with the position of the citation in the text:
When you stream, the annotations arrive in the last chunk before the finish reason. Set stream_options.include_usage to true to get the token usage as well.

Options

Your own function tools work alongside search. The model can’t search when tool_choice is "none" or forces one of your functions. The search runs as a function named web_search, so give your own functions other names.

Responses API

Add the web_search tool:
Each search shows in output as a web_search_call item, and the answer’s text carries url_citation annotations. The tool takes search_context_size and filters.allowed_domains, which limits results to the domains you list. Set max_tool_calls to cap the number of searches.

Coding tools

How you turn on search depends on the tool:

Models

Search works best with models that call tools reliably. We’ve tested it with:
  • z-ai/glm-5.3
  • z-ai/glm-5.3-flash
  • deepseek/deepseek-v4.1-flash
  • deepseek/deepseek-v4-flash-0731
  • qwen/qwen3.8-27b
  • moonshotai/kimi-k3.1-pro
Other models accept the request, but may answer without searching.

Limits

  • A model can search in up to 4 turns, with up to 5 searches per turn. After that it has to answer from what it found.
  • Results are cut to fit the model’s context: each excerpt is at most 1,500 characters.
  • If a search fails, the model is told so and answers without it.

Pricing

You pay for the tokens of every model turn, including the turns that read search results, at the model’s usual price. Each search that returns results costs $0.00625. Searches that find nothing are free.