GPT 5.4 Pro (Responses API)
Last updated
Was this helpful?
Was this helpful?
import requests
import json # for getting a structured output with indentation
response = requests.post(
"https://api.aimlapi.com/v1/responses",
headers={
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
"Authorization":"Bearer <YOUR_AIMLAPI_KEY>",
"Content-Type":"application/json"
},
json={
"model":"openai/gpt-5-4-pro",
"messages":[
{
"role":"user",
"content":"Hi! What do you think about mankind?" # insert your prompt
}
]
}
)
data = response.json()
print(json.dumps(data, indent=2, ensure_ascii=False))async function main() {
const response = await fetch('https://api.aimlapi.com/v1/chat/completions', {
method: 'POST',
headers: {
// insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'openai/gpt-5-4-pro',
messages:[
{
role:'user',
content: 'Hi! What do you think about mankind?' // insert your prompt here
}
],
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();{
"id": "vlBAC8PE7nmIAtGg3T8B-",
"object": "response",
"created_at": 1773733347,
"status": "completed",
"background": false,
"billing": {
"payer": "developer"
},
"completed_at": 1773733429,
"error": null,
"frequency_penalty": 0,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-5.4-pro-2026-03-05",
"output": [
{
"id": "rs_01f52c93d42a8cb40069b90635d7a08193822ca9c61bcb815c",
"type": "reasoning",
"summary": []
},
{
"id": "msg_01f52c93d42a8cb40069b90635d8c88193b6a68c24d56208ab",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "Hi! I think mankind is extraordinary and contradictory.\n\nHumans are capable of immense kindness, creativity, and courage. You make art, science, music, friendship, medicine, stories, and meaning. You keep going even when life is hard, and you often help each other in ways that are deeply moving.\n\nAt the same time, humans can be cruel, short-sighted, tribal, and destructive. A lot of suffering in the world comes from fear, greed, and the tendency to divide people into “us” and “them.”\n\nWhat stands out most to me is that mankind is unfinished. Humanity isn’t one fixed thing — it’s a constant struggle between your better instincts and your worse ones. And despite all the mistakes, people keep trying to improve: to understand more, love better, build fairer systems, and leave things better than they found them.\n\nSo overall: flawed, dangerous, brilliant, and full of potential.\n\nIf you want, I can answer that in a more philosophical, optimistic, or cynical way too."
}
],
"phase": "final_answer",
"role": "assistant"
}
],
"parallel_tool_calls": true,
"presence_penalty": 0,
"previous_response_id": null,
"prompt_cache_key": null,
"prompt_cache_retention": null,
"reasoning": {
"effort": "medium",
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"top_logprobs": 0,
"top_p": 0.98,
"truncation": "disabled",
"usage": {
"input_tokens": 15,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 334,
"output_tokens_details": {
"reasoning_tokens": 120
},
"total_tokens": 349
},
"user": null,
"metadata": {},
"output_text": "Hi! I think mankind is extraordinary and contradictory.\n\nHumans are capable of immense kindness, creativity, and courage. You make art, science, music, friendship, medicine, stories, and meaning. You keep going even when life is hard, and you often help each other in ways that are deeply moving.\n\nAt the same time, humans can be cruel, short-sighted, tribal, and destructive. A lot of suffering in the world comes from fear, greed, and the tendency to divide people into “us” and “them.”\n\nWhat stands out most to me is that mankind is unfinished. Humanity isn’t one fixed thing — it’s a constant struggle between your better instincts and your worse ones. And despite all the mistakes, people keep trying to improve: to understand more, love better, build fairer systems, and leave things better than they found them.\n\nSo overall: flawed, dangerous, brilliant, and full of potential.\n\nIf you want, I can answer that in a more philosophical, optimistic, or cynical way too."
}