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)
Getting started
Choose your preferred auth method and follow the setup steps.- API key (OpenAI Platform)
- Codex subscription
Best for: direct API access and usage-based billing.Or pass the key directly:
1
Get your API key
Create or copy an API key from the OpenAI Platform dashboard.
2
Run onboarding
3
Verify the model is available
Route summary
ChatGPT/Codex sign-in is routed through
openai-codex/*, not openai/*.Config example
Image generation
The bundledopenai plugin registers image generation through the image_generate tool.
See Image Generation for shared tool parameters, provider selection, and failover behavior.
Video generation
The bundledopenai 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 foropenai/* and openai-codex/* runs. The overlay keeps the assistant warm, collaborative, concise, and a little more emotionally expressive without replacing the base system prompt.
- Config
- CLI
Voice and speech
Speech synthesis (TTS)
Speech synthesis (TTS)
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.Realtime transcription
Realtime transcription
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.Realtime voice
Realtime voice
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
Transport (WebSocket vs SSE)
Transport (WebSocket vs SSE)
Velaclaw uses WebSocket-first with SSE fallback (Related OpenAI docs:
"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
WebSocket warm-up
WebSocket warm-up
Velaclaw enables WebSocket warm-up by default for
openai/* to reduce first-turn latency.Fast mode
Fast mode
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
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.
Priority processing (service_tier)
Priority processing (service_tier)
OpenAI’s API exposes priority processing via Supported values:
service_tier. Set it per model in Velaclaw:auto, default, flex, priority.Server-side compaction (Responses API)
Server-side compaction (Responses API)
For direct OpenAI Responses models (
openai/* on api.openai.com), Velaclaw auto-enables server-side compaction:- Forces
store: true(unless model compat setssupportsStore: false) - Injects
context_management: [{ type: "compaction", compact_threshold: ... }] - Default
compact_threshold: 70% ofcontextWindow(or80000when unavailable)
- Enable explicitly
- Custom threshold
- Disable
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.Strict-agentic GPT mode
Strict-agentic GPT mode
For GPT-5-family runs on With
openai/* and openai-codex/*, Velaclaw can use a stricter embedded execution contract: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_planfor 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.
Native vs OpenAI-compatible routes
Native vs OpenAI-compatible routes
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)
- Use looser compat behavior
- Do not force strict tool schemas or native-only headers
Related
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.