gpt-4o-mini-search-preview
Model Overview
A specialized model trained to understand and execute web search queries with the Chat completions API.
How to Make a Call
API Schema
Creates a chat completion using a language model, allowing interactive conversation by predicting the next response based on the given chat history. This is useful for AI-driven dialogue systems and virtual assistants.
Authorizations
Body
modelundefined Β· enumRequiredPossible values:
max_tokensnumber Β· min: 1OptionalDefault:
The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.
512
streambooleanOptionalDefault:
If set to True, the model response data will be streamed to the client as it is generated using server-sent events.
false
Responses
201Success
No content
post
async function main() {
const response = await fetch('https://api.aimlapi.com/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'gpt-4o-mini-search-preview',
messages:[
{
role:'user',
content: 'Hello'
}
]
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
201Success
No content
Code Example
import requests
import json # for getting a structured output with indentation
response = requests.post(
"https://api.aimlapi.com/v1/chat/completions",
headers={
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
"Authorization":"Bearer <YOUR_AIMLAPI_KEY>",
"Content-Type":"application/json"
},
json={
"model":"gpt-4o-mini-search-preview",
"messages":[
{
"role":"user",
"content":"Hello" # insert your prompt here, instead of Hello
}
]
}
)
data = response.json()
print(json.dumps(data, indent=2, ensure_ascii=False))
Last updated
Was this helpful?