模型

OpenAI: GPT-5

Markdown · JSON

OpenAI: GPT-5

GPT-5 是用於程式設計、文字與圖片任務,以及代理工作流程的推理模型。它支援可設定的推理與回答詳細程度,可結合專案或文件證據,以及應用程式工具的結果。

關於模型

此說明介紹模型的能力。Ailoot 可用的輸入、輸出與選項,依所選方法列於下方。

GPT-5 是 OpenAI 面向跨領域程式設計與代理任務的推理模型。它接受文字與圖片,並產生文字。開發者版本說明區分了 API 推理模型與非推理對話選項,並介紹程式設計協作、前端工作、指令遵循,以及連結一連串工具結果的工作流程。

工程工作應提供必要行為、相關檔案與修改限制。範例請求可要求檢查元件如何互動,找出它們處理某項輸入時的問題,並提出協調一致的修改提案。前端工作應提供預定互動與視覺參考。文件問題應指出決策、來源資料及必要章節,讓回覆具有具體目的。

開發商記載的推理強度為 minimal、low、medium 與 high,開發者版本說明預設為 medium。答案詳略程度是另一項獨立控制,可選 low、medium 與 high;文件記載預設為 medium,但明確的輸出指令具有優先權。這個區別讓任務可以要求精簡成果,同時仍依複雜度分配適當分析。

OpenAI 為 GPT-5 列出 400,000 個 token 的上下文視窗、272,000 個 token 的最大輸入,以及 128,000 個 token 的最大輸出,知識截止日期為 2024 年 9 月 30 日。推理與可見輸出共用生成 token 容量。請保留相關來源資料與成功判準,並為分析及最終答案留下空間,不要用無關上下文填滿整個視窗。

開發商列出 Responses、Chat Completions 與 Batch 介面、串流、Structured Outputs、函式呼叫、檔案與圖片輸入、網頁與檔案搜尋,以及提示快取。其確切模型卡工具包括圖片生成、程式碼解譯與 MCP 連線。開發者版本也記載平行工具呼叫、操作之間可見的進度訊息,以及接受純文字並可選擇文法限制的自訂工具。應用程式執行操作,再回傳供下一次決策使用的實際結果。

目前快取指引包含 GPT-5 可選的延長保留,最長為 24 小時,是否能重複使用則取決於符合條件且已保留的前綴。就任務本身而言,請定義代表完成的成果與依據。修補提案、結構化分析或文件,只有在重要選擇能對應提供的要求與事實時才有用。請將已完成檢查的結果與仍只是提案的操作分開,讓最終回覆能支持下一階段工作。

Ailoot Ultra · OpenAI Chat POST /v1/chat/completions gpt-5-thinking

gpt-5-thinking

OpenAI /gpt-5-thinking

入門

GPT-5 是用於程式設計、文字與圖片任務,以及代理工作流程的推理模型。它支援可設定的推理與回答詳細程度,可結合專案或文件證據,以及應用程式工具的結果。

接受的輸入
文字
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot Ultra · OpenAI Chat POST /v1/chat/completions
輸入
text
輸出
text
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
gpt-5-thinking
預設值—
欄位messages類型message[]要求必填值與限制
項目數下限: 1
預設值—
欄位messages[].role類型string要求必填值與限制
依模型而定
預設值—
欄位messages[].content類型string要求選填值與限制
適用條件: 文字對話
預設值—
欄位stream類型boolean要求選填值與限制預設值false
輸入素材組合

文字 · UTF8 文字

messages[].content

方法參數與生命週期
參數規格
參數content_type規格application/json
參數required規格model, messages
參數material_types規格text
參數messages規格具有 role/content 結構的訊息陣列
參數file_material規格實際 UTF-8 文件以原文文字插入;不推定檔案 ID
參數optional_controls規格stream
參數control_scope規格文字對話;stream 是布林值,預設為 false。
參數output_modalities規格text
參數hosted_operations規格false
參數multimodal_input_binding規格null

方法別名: /chat/completions

生命週期: synchronous_or_streamed

將確切模型 ID 與 messages 一併送出。

上下文長度不是輸出上限。

文字檔案可提供原文文字;圖片/音訊/檔案物件輸入需要精確綁定。

方案

費率資訊不會增加請求選項。支援的參數列於所選方法中。

快速模式
未指定 選取快速模式時
flex 模式
未指定 選取 flex 模式時
最高推理強度
未指定 最高推理強度採用 default 調整值時

Ailoot 費率

各設定的價格

設定費率表費用
設定詞元基本費率費率表基本費率費用
輸入 · 輸入 Token $0.0025 / 1K Token
輸出 · 輸出 Token $0.02 / 1K Token
輸入 · 讀取快取 $0.00025 / 1K Token
輸入 · 寫入快取 $0 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

請求範例

Ailoot Ultra · OpenAI Chat

curlPython SDK
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model":"gpt-5-thinking","messages":[{"role":"user","content":"hello"}],"stream":false}')

Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
for x in r.get("choices",[]):
    if x.get("message",{}).get("content"): print(x["message"]["content"])
PY_RESULT
from openai import OpenAI
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.chat.completions.create(model="gpt-5-thinking", messages=[{"role":"user","content":"hello"}], stream=False)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(result.to_dict(mode="json"))

接收並儲存結果

Ailoot Ultra · OpenAI Chat

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留每個候選項及其內容/工具呼叫/推理。SSE 中依候選項/工具索引組合增量,保留最終完成原因與用量。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位choices[].index類型integer
欄位choices[].message.content類型string|null
欄位choices[].message.tool_calls類型tool_call[]
欄位choices[].message.reasoning_content類型string
欄位choices[].message.reasoning_details類型object|array
欄位choices[].finish_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot Ultra gpt-5-thinking

方法路徑別名

/chat/completions

相關呼叫用 ID

gpt-5-thinking

Ailoot Ultra · Anthropic Messages POST /v1/messages gpt-5-thinking

gpt-5-thinking

OpenAI /gpt-5-thinking

入門

GPT-5 是用於程式設計、文字與圖片任務,以及代理工作流程的推理模型。它支援可設定的推理與回答詳細程度,可結合專案或文件證據,以及應用程式工具的結果。

接受的輸入
文字
結果
json · sse

Ailoot 可用 · 輸入與方法

Ailoot Ultra · Anthropic Messages POST /v1/messages
輸入
text
輸出
json, sse
輸出格式
JSON 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
gpt-5-thinking
預設值—
欄位messages類型message[]要求必填值與限制預設值—
欄位messages[].role類型string要求必填值與限制
user, assistant
預設值—
欄位messages[].content類型string要求必填值與限制預設值—
欄位max_tokens類型integer要求必填值與限制預設值—
欄位stream類型boolean要求選填值與限制預設值false
輸入素材組合

文字 · UTF-8 文字

messages[].content 字串

方法參數與生命週期
參數規格
參數content_type規格application/json
參數required規格model, messages, max_tokens
參數optional_controls規格stream
參數material_types規格text
參數text_file_material規格讀取實際 UTF-8 文件,將文字放入指定的 input 或訊息內容字串。

生命週期: synchronous_or_streamed

方案

費率資訊不會增加請求選項。支援的參數列於所選方法中。

快速模式
未指定 選取快速模式時
flex 模式
未指定 選取 flex 模式時
最高推理強度
未指定 最高推理強度採用 default 調整值時

Ailoot 費率

各設定的價格

設定費率表費用
設定詞元基本費率費率表基本費率費用
輸入 · 輸入 Token $0.0025 / 1K Token
輸出 · 輸出 Token $0.02 / 1K Token
輸入 · 讀取快取 $0.00025 / 1K Token
輸入 · 寫入快取 $0 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

請求範例

Ailoot Ultra · Anthropic Messages

完整的最小 JSON 請求主體curl · 使用您的 UTF-8 文件Python · 儲存完整結果
{
  "model": "gpt-5-thinking",
  "max_tokens": 128,
  "messages": [
    {
      "role": "user",
      "content": "Summarize the incident report."
    }
  ],
  "stream": false
}
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 document}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json, os
from pathlib import Path

source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
    raise SystemExit('Choose a document containing text')
payload = {'model': 'gpt-5-thinking', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
Path('request.json').write_text(json.dumps(payload, ensure_ascii=False), encoding='utf-8')
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
  -H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path

result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))
PY_RESULT
import json, os
from pathlib import Path

source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
    raise SystemExit('Choose a document containing text')
payload = {'model': 'gpt-5-thinking', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
from urllib.request import Request, urlopen
from urllib.error import HTTPError

api_key = os.environ['AILOOT_API_KEY']
if not api_key.strip():
    raise SystemExit('Set AILOOT_API_KEY before making a request')
headers = {'x-api-key': 'PLACEHOLDER_KEY', 'anthropic-version': '2023-06-01', 'Content-Type': 'application/json'}
headers['x-api-key'] = api_key
request = Request('https://api.ailoot.ai/v1/messages', data=json.dumps(payload, ensure_ascii=False).encode('utf-8'), headers=headers, method='POST')
try:
    with urlopen(request, timeout=120) as response:
        raw = response.read()
        Path('response-headers.txt').write_text(str(response.headers), encoding='utf-8')
except HTTPError as error:
    Path('result.json').write_bytes(error.read())
    Path('response-headers.txt').write_text(str(error.headers), encoding='utf-8')
    raise
Path('result.json').write_bytes(raw)
import json
from pathlib import Path

result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))

接收並儲存結果

Ailoot Ultra · Anthropic Messages

JSON 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留所有內容區塊、思考簽章與實際工具使用 ID。組合所有 SSE 區塊增量;第一個文字區塊不是完整輸出。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位id類型string
欄位model類型string
欄位content[]類型text|thinking|tool_use|other content block
欄位stop_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot Ultra gpt-5-thinking

方法路徑別名

/chat/completions

相關呼叫用 ID

gpt-5-thinking

FAQ · OpenAI: GPT-5
可以使用哪些輸入與結果?

POST /v1/chat/completions · gpt-5-thinking: text → text

POST /v1/messages · gpt-5-thinking: text → json, sse

請求使用哪些欄位?

POST /v1/chat/completions · gpt-5-thinking: model, messages, stream

POST /v1/messages · gpt-5-thinking: model, messages, max_tokens, stream

適用哪些限制?

POST /v1/chat/completions · gpt-5-thinking: messages.min_items: 1

更多詳情

將 Ailoot 串接 Claude Code、OpenCode、Hermes 或自己的應用程式。

公司及其專案組合

公司及其專案組合:數百萬客戶,每月銷售額達數十億。

優惠購買 token。

訂閱優惠適合持續工作,折扣碼購買 token 最高可折 50%。

訂閱
為定期請求選擇優惠方案。
最高 50% 折扣碼
購買時輸入代碼,價格依活動重算。
歷史中的費用
每次請求保存模型、token 與金額。

選擇訂閱 · 查看模型價格

將 API 加入 你銷售的產品。

依 Ailoot 正式服務條款與授權合約串接 SaaS、應用程式與機器人;轉售請申請經銷授權。

商用應用程式
在付費功能加入文字、圖片、影片與聲音生成。
經銷授權
提供專案說明與存取方式,要求書面使用和轉售條件。
網站文件
串接前可閱讀正式服務條款、授權合約與資料處理政策。

申請經銷授權 · 正式服務條款與授權合約