GPT-5.4 mini·续
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"annotations": [],
"content": "The rain had been falling since midnight, soft and persistent, turning the city into a blur of sodium light and reflected secrets. Detective Mara Venn stood in the doorway of apartment 4B, one gloved hand resting against the frame, and looked down at the object gleaming on the floorboards.\n\nIt wasn’t a weapon. It wasn’t jewelry, either.\n\nAt first glance, it looked like a child’s toy: a tiny brass bird with one wing folded and the other raised as if caught mid-flight. But when Mara knelt and picked it up, she felt the weight of it—too heavy for its size—and noticed the fine engraved line along its belly. A seam.\n\nShe turned the figurine over. Hidden beneath the bird’s feet was a row of numbers, stamped so neatly they might have been part of the design. Not a serial number, exactly. Too deliberate for that. Too precise.\n\nBehind her, the apartment hummed with the low buzz of the refrigerator and the distant wail of a siren moving somewhere farther downtown. Inside the room, the dead man sat slumped in his chair as if he’d merely nodded off. His hands were folded on the desk. His face was calm.\n\nMara looked again at the brass bird.\n\nThe numbers weren’t random. She knew that before she even compared them to the note pinned under the victim’s pen, written in a hand so steady it seemed almost smug:\n\n**You’re late. Look under the third stone.**\n\nShe slipped the bird into an evidence bag and stared at the cold line of the victim’s mouth.\n\nSomeone had planned this very carefully.\n\nAnd somehow, they had expected her to come.",
"refusal": null,
"role": "assistant"
}
}
],
"created": 1776470828,
"gatewayMetadata": {
"keySource": "Unified"
},
"id": "chatcmpl-DVnVEh2k96IQnpAZXEH5eHHSILLHq",
"model": "gpt-5.4-mini-2026-03-17",
"object": "chat.completion",
"service_tier": "default",
"system_fingerprint": null,
"usage": {
"completion_tokens": 343,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens": 19,
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
},
"total_tokens": 362
}
}
</details>
<details>
<summary>Streaming Response — Enable streaming for real-time output</summary>
const response = await env.AI.run(
'openai/gpt-5.4-mini',
{
messages: [{ content: 'Explain the concept of recursion with a simple example.', role: 'user' }],
stream: true,
stream_options: { include_usage: true },
},
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "openai/gpt-5.4-mini",
"messages": [
{
"content": "Explain the concept of recursion with a simple example.",
"role": "user"
}
],
"stream": true,
"stream_options": {
"include_usage": true
}
}'
Recursion is when a function solves a problem by calling itself on a smaller version of the same problem.
### Simple idea
A recursive function usually has:
1. **A base case** — when to stop calling itself
2. **A recursive case** — when it calls itself with a smaller input
### Example: counting down
```python
def countdown(n):
if n == 0: # base case
print("Done!")
else:
print(n)
countdown(n - 1) # recursive call
```
If you run:
```python
countdown(3)
```
It prints:
```python
3
2
1
Done!
```
### How it works
- `countdown(3)` prints `3`, then calls `countdown(2)`
- `countdown(2)` prints `2`, then calls `countdown(1)`
- `countdown(1)` prints `1`, then calls `countdown(0)`
- `countdown(0)` reaches the base case and stops
### In short
Recursion is like solving a big problem by breaking it into smaller versions of the same problem until you reach a stopping point.
[
{
"choices": [
{
"delta": {
"content": "",
"refusal": null,
"role": "assistant"
},
"finish_reason": null,
"index": 0
}
],
"created": 1776470832,
"id": "chatcmpl-DVnVIJWPzCL8OTA38vb3b0IM2eEca",
"model": "gpt-5.4-mini-2026-03-17",
"obfuscation": "9pV",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": null,
"usage": null
},
{
"choices": [
{
"delta": {
"content": "Rec"
},
"finish_reason": null,
"index": 0
}
],
"created": 1776470832,
"id": "chatcmpl-DVnVIJWPzCL8OTA38vb3b0IM2eEca",
"model": "gpt-5.4-mini-2026-03-17",
"obfuscation": "2K",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": null,
"usage": null
},
"... 248 more chunks omitted ...",
{
"choices": [],
"created": 1776470832,
"id": "chatcmpl-DVnVIJWPzCL8OTA38vb3b0IM2eEca",
"model": "gpt-5.4-mini-2026-03-17",
"obfuscation": "Ic",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": null,
"usage": {
"completion_tokens": 251,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens": 16,
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
},
"total_tokens": 267
}
}
]
</details>
<details>
<summary>Web Search — Letting the model use OpenAI's built-in web search tool to answer with current information</summary>
const response = await env.AI.run(
'openai/gpt-5.4-mini',
{
input: 'What were the top news stories about Cloudflare this week? Summarise in three bullets.',
max_output_tokens: 4096,
tools: [{ type: 'web_search_preview' }],
},
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/responses \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "openai/gpt-5.4-mini",
"input": "What were the top news stories about Cloudflare this week? Summarise in three bullets.",
"max_output_tokens": 4096,
"tools": [
{
"type": "web_search_preview"
}
]
}'
Here are the top Cloudflare stories from **this week** I found, in three bullets:
- **Cloudflare had a service degradation/outage today, June 22, 2026**, with widespread user reports of 500 errors and impacted services; discussion online suggests it affected a broad set of Cloudflare-dependent sites. ([reddit.com](https://www.reddit.com/r/sysadmin/comments/1ucm4f2/cloudflare_na_service_degraded_6222026/?utm_source=openai))
- **Cloudflare announced a new partner initiative for AI and SASE adoption** on **June 18, 2026**, adding a Cloudflare One Design Partner designation and AI tooling to help customers migrate away from fragmented security setups. ([itpro.com](https://www.itpro.com/technology/artificial-intelligence/cloudflare-launches-new-partner-initiative-to-support-ai-and-sase-adoption?utm_source=openai))
- **Cloudflare’s June product/news cycle was dominated by AI and platform expansion**, including the launch of “Application Services for Private Origins” on **June 10**, the company’s acquisition of **VoidZero** on **June 4**, and new AI security/budgeting features on **June 5**. ([blog.cloudflare.com](https://blog.cloudflare.com/?utm_source=openai))
If you want, I can turn this into a **more newsroom-style summary** or a **“most important + why it matters”** version.
{
"id": "resp_0f020ddf70098206016a399675cf94819bbe9b7eee768256c3",
"object": "response",
"created_at": 1782158965,
"model": "gpt-5.4-mini-2026-03-17",
"output": [
{
"id": "ws_0f020ddf70098206016a3996763370819b932817a9ee0bacdc",
"type": "web_search_call",
"status": "completed",
"action": {
"type": "search",
"queries": [
"Cloudflare news this week June 2026 Cloudflare",
"Cloudflare this week news June 2026",
"Cloudflare latest news June 2026 site:reuters.com OR site:bloomberg.com OR site:techcrunch.com OR site:theverge.com"
],
"query": "Cloudflare news this week June 2026 Cloudflare"
}
},
{
"id": "ws_0f020ddf70098206016a399678a478819ba4f867a7c11a5136",
"type": "web_search_call",
"status": "completed",
"action": {
"type": "search",
"queries": [
"site:reuters.com Cloudflare June 2026 outage June 22 2026",
"site:cloudflare.com blog June 2026 Cloudflare outage June 22 2026",
"site:techcrunch.com Cloudflare June 2026 outage"
],
"query": "site:reuters.com Cloudflare June 2026 outage June 22 2026"
}
},
{
"id": "msg_0f020ddf70098206016a39967aa8f0819bb32294764e0878d9",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [
{
"type": "url_citation",
"end_index": 427,
"start_index": 303,
"title": "Cloudflare NA service degraded 6-22-2026",
"url": "https://www.reddit.com/r/sysadmin/comments/1ucm4f2/cloudflare_na_service_degraded_6222026/?utm_source=openai"
},
{
"type": "url_citation",
"end_index": 822,
"start_index": 658,
"title": "Cloudflare launches new partner initiative to support AI and SASE adoption",
"url": "https://www.itpro.com/technology/artificial-intelligence/cloudflare-launches-new-partner-initiative-to-support-ai-and-sase-adoption?utm_source=openai"
},
{
"type": "url_citation",
"end_index": 1176,
"start_index": 1105,
"title": "The Cloudflare Blog",
"url": "https://blog.cloudflare.com/?utm_source=openai"
}
],
"logprobs": [],
"text": "Here are the top Cloudflare stories from **this week** I found, in three bullets:\n\n- **Cloudflare had a service degradation/outage today, June 22, 2026**, with widespread user reports of 500 errors and impacted services; discussion online suggests it affected a broad set of Cloudflare-dependent sites. ([reddit.com](https://www.reddit.com/r/sysadmin/comments/1ucm4f2/cloudflare_na_service_degraded_6222026/?utm_source=openai))\n\n- **Cloudflare announced a new partner initiative for AI and SASE adoption** on **June 18, 2026**, adding a Cloudflare One Design Partner designation and AI tooling to help customers migrate away from fragmented security setups. ([itpro.com](https://www.itpro.com/technology/artificial-intelligence/cloudflare-launches-new-partner-initiative-to-support-ai-and-sase-adoption?utm_source=openai))\n\n- **Cloudflare’s June product/news cycle was dominated by AI and platform expansion**, including the launch of “Application Services for Private Origins” on **June 10**, the company’s acquisition of **VoidZero** on **June 4**, and new AI security/budgeting features on **June 5**. ([blog.cloudflare.com](https://blog.cloudflare.com/?utm_source=openai))\n\nIf you want, I can turn this into a **more newsroom-style summary** or a **“most important + why it matters”** version."
}
],
"phase": "final_answer",
"role": "assistant"
}
],
"status": "completed",
"usage": {
"input_tokens": 17121,
"output_tokens": 485,
"total_tokens": 17606,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens_details": {
"reasoning_tokens": 196
}
},
"background": false,
"billing": {
"payer": "developer"
},
"completed_at": 1782158971,
"error": null,
"frequency_penalty": 0,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": 4096,
"max_tool_calls": null,
"moderation": null,
"parallel_tool_calls": true,
"presence_penalty": 0,
"previous_response_id": null,
"prompt_cache_key": null,
"prompt_cache_retention": "in_memory",
"reasoning": {
"context": "current_turn",
"effort": "none",
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": false,
"temperature": 1,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [
{
"type": "web_search_preview",
"search_content_types": [
"text"
],
"search_context_size": "medium",
"user_location": {
"type": "approximate",
"city": null,
"country": "US",
"region": null,
"timezone": null
}
}
],
"top_logprobs": 0,
"top_p": 0.98,
"truncation": "disabled",
"user": null,
"metadata": {},
"gatewayMetadata": {
"keySource": "Unified"
}
}
</details>
Parameters
Schema variant
ResponsesChat Completions
▶input
one ofrequired
instructions
string
temperature
numberminimum: 0maximum: 2
max_output_tokens
numberexclusiveMinimum: 0
top_p
numberminimum: 0maximum: 1
stream
boolean
▶tools[]
array
tool_choice
▶text{}
object
▶reasoning{}
object
▶messages[]
arrayrequired
temperature
numberminimum: 0maximum: 2
max_tokens
numberexclusiveMinimum: 0
max_completion_tokens
numberexclusiveMinimum: 0
top_p
numberminimum: 0maximum: 1
frequency_penalty
numberminimum: -2maximum: 2
presence_penalty
numberminimum: -2maximum: 2
stream
boolean
▶stream_options{}
object
▶tools[]
array
tool_choice
response_format
▶modalities[]
array
▶audio{}
object
reasoning_effort
stringOptional reasoning control; availability and accepted values are model-dependent.
id
string
object
stringconst: response
created_at
number
model
string
▶output[]
array
output_text
string
status
stringenum: in_progress, completed, failed, incomplete
▶usage{}
object
id
string
object
string
created
number
model
string
▶choices[]
array
▶usage{}
object
API Schemas (Raw)
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ai/models/openai/gpt-5.4-mini/#page","headline":"GPT-5.4 mini","description":"GPT-5.4 mini is a smaller, faster, and more cost-efficient version of GPT-5.4 for lightweight tasks.","url":"https://developers.cloudflare.com/ai/models/openai/gpt-5.4-mini/","inLanguage":"en","image":"https://developers.cloudflare.com/og-docs.png","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: GPT-5.4 nano is OpenAI's smallest and fastest model, optimized for edge and low-latency use cases. title: GPT-5.4 nano image: https://developers.cloudflare.com/og-docs.png
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/llms.txt
Use this file to discover all available pages before exploring further.

