OPENCLAW + GPT

Use GPT in OpenClaw.

GPT-5.5 is OpenAI's flagship LLM, available through RunAPI at half the official per-token price. OpenClaw already speaks the OpenAI completions protocol — point it at RunAPI's /v1 base URL and every GPT variant (5.5, 5.4, 5.4-mini, 5.3-codex) works with streaming, function calling, and structured output.

one API key · OpenAI-compatible · streaming responses
Use RunAPI to call GPT-5.5 through the OpenAI-compatible Chat Completions endpoint.

Requirements:
- Read the API key from RUNAPI_API_KEY.
- Call POST https://runapi.ai/v1/chat/completions
- Set model to "gpt-5.5".
- Include a messages array with at least one user message.
- The response is synchronous — the completion arrives in the same HTTP response.
- For streaming, set "stream": true to receive server-sent events.
- For the Responses API, call POST https://runapi.ai/v1/responses instead.
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
  }
}
Copy the curl command to test gpt
HOW IT WORKS

Use GPT in OpenClaw in three steps

1

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
2

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
3

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
PARAMETERS

GPT Chat Completions parameters

Parameter Type Description
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.

What is GPT on OpenClaw?

GPT is OpenAI's flagship LLM family, available through RunAPI at half the official per-token price. OpenClaw already speaks the OpenAI chat completions protocol, so switching to RunAPI is a one-line base URL change -- GPT-5.5 for top-tier reasoning, GPT-5.4 for everyday tasks, GPT-5.4-mini for cheap bulk work, and GPT-5.3-codex for code generation all work with streaming, function calling, and structured JSON output.

GPT use cases

Building chatbots and conversational AI

Run GPT-5.5 chat completions through RunAPI at 50% of OpenAI pricing, using the same SDK and API format your app already uses. No code changes beyond the base URL.

Code generation and agentic coding

Use GPT-5.3-codex for code generation, editing, and debugging tasks at lower per-token cost. It supports the same function calling and structured output as the flagship models.

Data extraction with structured outputs

Set response_format to json_schema and get guaranteed valid JSON from GPT, useful for extracting structured data from documents, parsing invoices, or building RAG pipelines.

FAQ

GPT + OpenClaw questions

OpenClaw general setup

Not configured yet? Start with the RunAPI setup guide for OpenClaw.

OpenClaw setup guide →

GPT model catalog

See all GPT variants, per-token pricing, and API docs.

GPT on RunAPI →

Try GPT-5.5 in OpenClaw today.

Get a free RunAPI key, point OpenClaw at /v1, and call GPT-5.5 at half the official OpenAI token price — streaming, function calling, and structured output included.