Skip to main content

OpenAI

OpenAI provides developer APIs for GPT models. Velaclaw supports two auth routes:
  • API key — direct OpenAI Platform access with usage-based billing (openai/* models)
  • Codex subscription — ChatGPT/Codex sign-in with subscription access (openai-codex/* models)
OpenAI explicitly supports subscription OAuth usage in external tools and workflows like Velaclaw.

Getting started

Choose your preferred auth method and follow the setup steps.
Best for: direct API access and usage-based billing.
1

Get your API key

Create or copy an API key from the OpenAI Platform dashboard.
2

Run onboarding

Or pass the key directly:
3

Verify the model is available

Route summary

ChatGPT/Codex sign-in is routed through openai-codex/*, not openai/*.

Config example

Velaclaw does not expose openai/gpt-5.3-codex-spark on the direct API path. Live OpenAI API requests reject that model. Spark is Codex-only.

Image generation

The bundled openai plugin registers image generation through the image_generate tool.
See Image Generation for shared tool parameters, provider selection, and failover behavior.

Video generation

The bundled openai plugin registers video generation through the video_generate tool.
See Video Generation for shared tool parameters, provider selection, and failover behavior.

Personality overlay

Velaclaw adds a small OpenAI-specific prompt overlay for openai/* and openai-codex/* runs. The overlay keeps the assistant warm, collaborative, concise, and a little more emotionally expressive without replacing the base system prompt.
Values are case-insensitive at runtime, so "Off" and "off" both disable the overlay.

Voice and speech

The bundled openai plugin registers speech synthesis for the messages.tts surface.Available models: gpt-4o-mini-tts, tts-1, tts-1-hd. Available voices: alloy, ash, ballad, cedar, coral, echo, fable, juniper, marin, onyx, nova, sage, shimmer, verse.
Set OPENAI_TTS_BASE_URL to override the TTS base URL without affecting the chat API endpoint.
The bundled openai plugin registers realtime transcription for the Voice Call plugin.
Uses a WebSocket connection to wss://api.openai.com/v1/realtime with G.711 u-law audio.
The bundled openai plugin registers realtime voice for the Voice Call plugin.
Supports Azure OpenAI via azureEndpoint and azureDeployment config keys. Supports bidirectional tool calling. Uses G.711 u-law audio format.

Advanced configuration

Velaclaw uses WebSocket-first with SSE fallback ("auto") for both openai/* and openai-codex/*.In "auto" mode, Velaclaw:
  • Retries one early WebSocket failure before falling back to SSE
  • After a failure, marks WebSocket as degraded for ~60 seconds and uses SSE during cool-down
  • Attaches stable session and turn identity headers for retries and reconnects
  • Normalizes usage counters (input_tokens / prompt_tokens) across transport variants
Related OpenAI docs:
Velaclaw enables WebSocket warm-up by default for openai/* to reduce first-turn latency.
Velaclaw exposes a shared fast-mode toggle for both openai/* and openai-codex/*:
  • Chat/UI: /fast status|on|off
  • Config: agents.defaults.models["<provider>/<model>"].params.fastMode
When enabled, Velaclaw maps fast mode to OpenAI priority processing (service_tier = "priority"). Existing service_tier values are preserved, and fast mode does not rewrite reasoning or text.verbosity.
Session overrides win over config. Clearing the session override in the Sessions UI returns the session to the configured default.
OpenAI’s API exposes priority processing via service_tier. Set it per model in Velaclaw:
Supported values: auto, default, flex, priority.
serviceTier is only forwarded to native OpenAI endpoints (api.openai.com) and native Codex endpoints (chatgpt.com/backend-api). If you route either provider through a proxy, Velaclaw leaves service_tier untouched.
For direct OpenAI Responses models (openai/* on api.openai.com), Velaclaw auto-enables server-side compaction:
  • Forces store: true (unless model compat sets supportsStore: false)
  • Injects context_management: [{ type: "compaction", compact_threshold: ... }]
  • Default compact_threshold: 70% of contextWindow (or 80000 when unavailable)
Useful for compatible endpoints like Azure OpenAI Responses:
responsesServerCompaction only controls context_management injection. Direct OpenAI Responses models still force store: true unless compat sets supportsStore: false.
For GPT-5-family runs on openai/* and openai-codex/*, Velaclaw can use a stricter embedded execution contract:
With strict-agentic, Velaclaw:
  • No longer treats a plan-only turn as successful progress when a tool action is available
  • Retries the turn with an act-now steer
  • Auto-enables update_plan for substantial work
  • Surfaces an explicit blocked state if the model keeps planning without acting
Scoped to OpenAI and Codex GPT-5-family runs only. Other providers and older model families keep default behavior.
Velaclaw treats direct OpenAI, Codex, and Azure OpenAI endpoints differently from generic OpenAI-compatible /v1 proxies:Native routes (openai/*, openai-codex/*, Azure OpenAI):
  • Keep reasoning: { effort: "none" } intact when reasoning is explicitly disabled
  • Default tool schemas to strict mode
  • Attach hidden attribution headers on verified native hosts only
  • Keep OpenAI-only request shaping (service_tier, store, reasoning-compat, prompt-cache hints)
Proxy/compatible routes:
  • Use looser compat behavior
  • Do not force strict tool schemas or native-only headers
Azure OpenAI uses native transport and compat behavior but does not receive the hidden attribution headers.

Model selection

Choosing providers, model refs, and failover behavior.

Image generation

Shared image tool parameters and provider selection.

Video generation

Shared video tool parameters and provider selection.

OAuth and auth

Auth details and credential reuse rules.