An explicitly enabled model can search the web while answering your request. First check that GET /v1/models lists singleapi:web_search in the selected model's supported_tools. Search availability and allowed combinations are published per model; ordinary chat support alone does not imply search support.
Send a search request
With client and model_id configured as in the quickstart, send the SingleAPI tool through the SDK's extra_body:
response = client.chat.completions.create(
model=model_id,
messages=[{"role": "user", "content": "Find the official Python documentation and cite the source."}],
max_tokens=1024,
extra_body={"tools": [{"type": "singleapi:web_search", "max_uses": 1}]},
)
print(response.choices[0].message.content)
details = response.model_dump()
print(details.get("hosted_tool_usage"))
print(details["choices"][0]["message"].get("citations"))Limits and billing
max_uses is per request: the API accepts 1–10, defaults to 3 if omitted, and rejects a value above the model's published limit. Start with 1. Optional domain filters and combinations with streaming, functions or JSON output require explicit model support. Do not send stop for hosted search. See the API reference.
Managed requests can charge token usage and published search fees. Each request has its own hold, while API-key budgets limit cumulative spending. For BYOK, select the provider credential as in the BYOK guide; the SingleAPI charge remains zero and your provider account pays its own charges.