Add internet search capability to all models. There are two ways to enable this feature, and you can choose either one:
1.
Append -web-search to the model suffix, e.g., gpt-3.5-turbo-web-search (convenient for third-party software)
2.
Include the parameter "web-search": true in the model request, as shown in the example (convenient for API usage)
Note: If the model suffix includes -web-search but "web-search" is set to false, the internet search functionality will also be disabled.(Can be used together with -ocr, e.g., deepseek-r1-ocr-web-search)
Supported Parameters: search-service: Search service provider
search-include-sites: Whitelist for search (not supported by Bocha)
["arxiv.org", "paperswithcode.com"]
search-exclude-sites: Blacklist for search (not supported by Bocha)
["arxiv.org", "paperswithcode.com"]
*The principle behind this feature is: Before each request, keywords are extracted from the user's conversation, followed by a search. The results from the search engine are then incorporated into the model's context as reference information. The detailed process can be viewed in the logs during API calls.Price: Original model cost + search API fees
Request
Header Params
Content-Type
string
required
Example:
application/json
Accept
string
required
Example:
application/json
Authorization
string
required
Insert the API Key generated in the Admin Console - API KEYS section after Bearer, e.g., Bearer sk-xxxx
Sampling Temperature A value between 0 and 2. Higher values (e.g., 0.8) will make the output more random, while lower values (e.g., 0.2) will make the output more focused and deterministic. We generally recommend adjusting this or top_p, but not both
top_p
integer
optional
Top-p Sampling An alternative to temperature sampling, called nucleus sampling, where the model considers results from tokens with top_p probability mass. For example, 0.1 means only tokens comprising the top 10% probability mass are considered. We generally recommend adjusting this or temperature, but not both
n
integer
optional
Generate how many chat completion options per input message
stream
boolean
optional
If enabled, partial message increments will be sent, similar to ChatGPT. As tokens become available, they will be sent as raw data via Server-Sent Events(: [DONE]`. The stream is terminated by a message. See example code in the OpenAI Cookbook.
stop
string
optional
Up to 4 sequences where the API will stop generating additional tokens.
max_tokens
integer
optional
The maximum number of tokens to generate for chat completions. The total length of input tokens and generated tokens is limited by the model's context length
presence_penalty
number
optional
A number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the likelihood of the model discussing new topics. Learn more about frequency and presence penalties
frequency_penalty
number
optional
A number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text, reducing the likelihood of the model repeating the same line verbatim. Learn more about frequency and presence penalties
logit_bias
null
optional
Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by token IDs in the tokenizer) to associated bias values ranging from -100 to 100. Mathematically, the bias is added to the logits generated by the model before sampling. The exact effect varies by model, but values between -1 and 1 should slightly reduce or increase the likelihood of selection; values like -100 or 100 should result in banning or exclusive selection of the associated token.
user
string
optional
A unique identifier representing your end user, which can help OpenAI monitor and detect abuse. Learn more.。
{"id":"chatcmpl-123","object":"chat.completion","created":1677652288,"choices":[{"index":0,"message":{"role":"assistant","content":"\n\nHello there, how may I assist you today?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":9,"completion_tokens":12,"total_tokens":21}}