Theme
Web Search
POST
https://www.kkiai.com/v1/chat/completions
Reference documentation: https://platform.openai.com/docs/api-reference/chat/create
Request Parameters
Authorization
Add the Authorization parameter to the Header. Its value is the Token concatenated after Bearer.
Example: Authorization: Bearer ********************
Header Parameters
| Parameter Name | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | Required | Bearer $OPENAI_API_KEY | |
Content-type | string | Required | application/json |
Body Parameters (application/json)
| Parameter Name | Type | Required | Description |
|---|---|---|---|
model | string | Required | |
web_search_options | object | Required | |
messages | array[object] | Required | |
└ role | string | Optional | |
└ content | string | Optional |
Request Example
json
{
"model": "gpt-4o-search-preview",
"web_search_options": {},
"messages": [{
"role": "user",
"content": "What was a positive news story from today?"
}]
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/v1/chat/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-type: application/json' \
--data-raw '{
"model": "gpt-4o-search-preview",
"web_search_options": {},
"messages": [{
"role": "user",
"content": "What was a positive news story from today?"
}]
}'Response
🟢 200 Success
Response Example
json
{}