GPT-5-2 API is a next-generation multimodal model with exceptional reasoning capabilities, supporting text and image inputs with Web Search grounding and adjustable reasoning effort.
tools parameter is an optional array that allows you to enable Web Search grounding.
Web Search
All APIs require authentication via Bearer Token.
Get API Key:
Usage: Add to request header: Authorization: Bearer YOUR_API_KEY
Note:
An array of message objects. Each message has a role and content.
Unified Media File Format:
In the content array, only images are supported. All image files use the same format structure:
type field is always "image_url"image_url field name remains unchangedurl value, which points to the corresponding image addressFor example: { type: 'image_url', image_url: { url: '...' } } structure.
1An optional array of tools the model may call. Supports Web Search: {"type": "function", "function": {"name": "web_search"}} - Enables real-time information retrieval via Web Search.
The effort level for the model to use for reasoning. Low effort is faster to respond, high effort is slower to respond but solves more complex problems. Default is "high".
low, high Request successful. Returns the standard chat completion format.
Unique identifier for the chat completion
"chatcmpl-example-123"
Object type
"chat.completion"
Unix timestamp of when the completion was created
1677652288
Model name
"gpt-5-2"
Array of completion choices