GPT Codex API is a multimodal chat-completions style endpoint that accepts structured input arrays, supports adjustable reasoning effort, and integrates web search or function calling tools.
tools array enables web search or function calling capabilities.{"type": "web_search"} and {"type": "function", ...} in the same tools array.curl --location --request POST 'https://api.kie.ai/api/v1/responses' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-5.1-codex",
"stream": false,
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "What is in this image?"
},
{
"type": "input_image",
"image_url": "https://file.aiquickdraw.com/custom-page/akr/section-images/1759055072437dqlsclj2.png"
}
]
}
],
"tools": [
{
"type": "web_search"
}
],
"reasoning": {
"effort": "high"
}
}'{
"output": [
{
"type": "reasoning",
"id": "rs_xxx",
"summary": []
},
{
"type": "message",
"role": "assistant",
"id": "msg_xxx",
"content": [
{
"type": "output_text",
"text": "Hello! How can I help you today?"
}
],
"status": "completed"
}
],
"usage": {
"total_tokens": 4490,
"output_tokens": 47,
"input_tokens": 4443
},
"credits_consumed": 0.48,
"status": "completed"
}