OpenClaw で GPT を使う。
GPT-5.5 は OpenAI のフラッグシップ生成AIで、RunAPI を通じて公式のトークン単価の半額で利用できます。OpenClaw はすでに OpenAI completions プロトコルに対応しているため、RunAPI の /v1 ベース URL を指定するだけで、すべての GPT バリアント(5.5、5.4、5.4-mini、5.3-codex)がストリーミング、関数呼び出し、構造化出力とともに動作します。
RunAPI を使って OpenAI 互換の Chat Completions エンドポイント経由で GPT-5.5 を呼び出します。
要件:
- RUNAPI_API_KEY から API キーを読み込みます。
- POST https://runapi.ai/v1/chat/completions を呼び出します。
- model を "gpt-5.5" に設定します。
- 少なくとも1つの user メッセージを含む messages 配列を含めます。
- レスポンスは同期的です——補完結果は同じ HTTP レスポンスで返されます。
- ストリーミングには "stream": true を設定して server-sent events を受け取ります。
- Responses API には代わりに POST https://runapi.ai/v1/responses を呼び出します。
curl -X POST https://runapi.ai/v1/chat/completions \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [
{"role": "system", "content": "You are a concise coding assistant."},
{"role": "user", "content": "Write a Python function that merges two sorted lists in O(n) time."}
],
"temperature": 0.3,
"max_tokens": 1024
}'
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "gpt-5.5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "def merge_sorted(a, b):\n result = []\n i = j = 0\n while i < len(a) and j < len(b):\n if a[i] <= b[j]:\n result.append(a[i]); i += 1\n else:\n result.append(b[j]); j += 1\n result.extend(a[i:])\n result.extend(b[j:])\n return result"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 38,
"completion_tokens": 95,
"total_tokens": 133
}
}
OpenClaw で GPT を使う3ステップ
Point OpenClaw at RunAPI
If RunAPI is already configured as a provider in OpenClaw, the same key and /v1 base URL work for GPT. OpenClaw uses the openai-completions API mode, so GPT-5.5 is a drop-in model swap — no protocol change needed.
export RUNAPI_API_KEY=runapi_xxx
Select a GPT model
Set the model to gpt-5.5 for the flagship, gpt-5.4 or gpt-5.4-mini for lower cost, or gpt-5.3-codex for code-heavy tasks. The /v1/chat/completions endpoint returns a standard OpenAI response with usage counts and finish_reason.
model: gpt-5.5
Use streaming or function calling
Add "stream" true for token-by-token SSE output. Add a tools array for function calling. Add response_format for structured JSON output. All standard OpenAI parameters work through RunAPI without modification.
"stream": true
GPT Chat Completions パラメータ
| パラメータ | 型 | 説明 |
|---|---|---|
model |
string |
Required. gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-5.4-nano, gpt-5.3-codex, or gpt-5.2. |
messages |
array |
Required. Array of message objects with role (system, user, assistant) and content fields. |
temperature |
number |
Optional. Sampling temperature between 0 and 2. Lower values produce more deterministic output. Defaults to 1. |
max_tokens |
integer |
Optional. Maximum number of tokens to generate in the completion. |
stream |
boolean |
Optional. When true, returns server-sent events with incremental token deltas. Defaults to false. |
tools |
array |
Optional. Array of tool definitions for function calling. Each tool has a type, function name, description, and parameters schema. |
response_format |
object |
Optional. Set type to "json_object" or "json_schema" for structured JSON output. |
reasoning_effort |
string |
Optional. Controls thinking depth for supported models. Accepted values are low, medium, high. |
OpenClaw上のGPTとは?
GPTはOpenAIのフラッグシップLLMファミリーで、RunAPIを通じて公式の1トークンあたり価格の半額で提供されます。OpenClawはすでにOpenAIのチャット補完プロトコルをネイティブサポートしているため、RunAPIへの切り替えはbase URLの1行変更だけです——GPT-5.5で最高推論・GPT-5.4で日常タスク・GPT-5.4-miniで安価な大量処理・GPT-5.3-codexでコード生成、すべてストリーミング・関数呼び出し・構造化JSON出力をサポートします。
GPTの活用例
チャットボットと会話型AIの構築
RunAPIを通じてOpenAI価格の50%でGPT-5.5チャット補完を実行し、アプリが既に使用しているSDKとAPIフォーマットをそのまま使います。base URL以外はコードの変更不要です。
コード生成とagentic coding
より低い1トークンあたりコストでGPT-5.3-codexをコード生成・編集・デバッグタスクに使用します。フラッグシップモデルと同じ関数呼び出しと構造化出力をサポートします。
構造化出力でのデータ抽出
response_formatをjson_schemaに設定してGPTから保証された有効なJSONを取得し、ドキュメントからの構造化データ抽出・請求書の解析・RAGパイプライン構築に活用します。
GPT + OpenClaw のよくある質問
Yes. OpenClaw supports OpenAI-compatible providers. Add RunAPI with base URL https://runapi.ai/v1 and set the model to gpt-5.5. The openai-completions protocol that OpenClaw already uses works without changes.
Chat Completions (/v1/chat/completions) is the standard request-response endpoint that returns a message. The Responses API (/v1/responses) is OpenAI's newer surface that supports built-in web search, file search, and computer use tools. Both are available through RunAPI at the same discounted rate.
GPT-5.5 for complex reasoning and hard problems. GPT-5.4 for everyday tasks at lower cost. GPT-5.4-mini for high-volume cheap work like classification or tagging. GPT-5.3-codex for code generation and editing. All use the same endpoint and parameters.
Set response_format to json_schema with a schema definition in your request. GPT will constrain its output to match your schema exactly. This works for data extraction, form parsing, and any task where you need predictable JSON structure. RunAPI forwards the schema parameter unchanged.
Yes. Pass a tools array for function calling or set response_format to json_schema for structured output. RunAPI forwards these parameters to the GPT model and returns the tool_calls or structured JSON in the standard OpenAI response format.
今すぐ OpenClaw で GPT-5.5 を試す。
無料の RunAPI キーを取得し、OpenClaw を /v1 に指定して、公式 OpenAI トークン価格の半額で GPT-5.5 を呼び出しましょう——ストリーミング、関数呼び出し、構造化出力を含みます。