Skip to content
Docs
GitHub

OpenAI

Run Everruns agents on OpenAI models via the Responses API or Chat Completions, including Azure OpenAI and any OpenAI-compatible endpoint.

4 min readEdit on GitHub

Everruns runs agents on OpenAI models through a uniform driver, mapping its provider-neutral messages, tools, and reasoning onto the OpenAI wire format. The same driver also powers any OpenAI-compatible endpoint through a custom base URL. For Azure deployments, use the dedicated Azure OpenAI provider instead.

  • Responses API (recommended), the default driver, with stateful continuation and server-side context compaction on api.openai.com and Azure OpenAI hosts.
  • Chat Completions: a compatibility driver (openai_completions) for legacy integrations and OpenAI-compatible gateways.
  • Streaming, tool calls, and reasoning mapped to provider-neutral Everruns types, including extended thinking on reasoning models.
  • Prompt caching via a deterministic cache key derived from the session (or agent, harness, organization) and model.
  • Structured output: a direct model call can require a reply that matches a JSON Schema, enforced by OpenAI (text.format on the Responses API, response_format on Chat Completions).
  • Background mode for xhigh and max reasoning on OpenAI and Azure: the response keeps running at OpenAI if the connection drops or the worker running the turn restarts, and Everruns picks the stream back up instead of paying for the call twice. A cancelled turn cancels the response. Background mode stores the response, so organizations with zero data retention fall back to a normal streaming call.
  • WebSocket transport (opt-in): on api.openai.com, a call can stream over OpenAI’s Responses WebSocket mode instead of HTTP streaming, keeping one connection open across the turns of a tool loop. OpenAI recommends it for the ultrafast speed tier. It is off by default; see WebSocket transport.
  1. Go to Settings → Providers and click Add provider.
  2. Choose OpenAI (Responses API) for new setups, or OpenAI Completions for Chat Completions compatibility. For Azure, choose the dedicated Azure OpenAI provider instead.
  3. Paste your OpenAI API key. Get one from the OpenAI API keys page.
  4. (Optional) Set a base URL to target another OpenAI-compatible endpoint.
  5. Save. Everruns discovers available models automatically.

The OpenAI driver works with any OpenAI-compatible API. Set the base URL to your endpoint. Self-hosted and proxy gateways are treated as stateless, so the driver replays the full transcript each turn instead of relying on server-side continuation. For Microsoft Azure deployments, use the dedicated Azure OpenAI provider, which is recognized as a stateful host.

HTTP streaming (SSE) is the default. To use OpenAI’s WebSocket mode instead, opt in per call with the openai/websocket driver option set to true (false opts a call out), or for a whole provider when you build it in code:

use everruns_drivers::openai::OpenAIChatDriver;
let driver = OpenAIChatDriver::new().with_websocket_transport(true);

Each turn of a tool loop continues on the connection the previous turn used, sending only the new tool results. The transport applies to api.openai.com only; Azure OpenAI and custom endpoints keep using HTTP streaming. If the socket cannot connect, or drops or reports an error before the response starts, the call is sent over HTTP streaming instead, so opting in never fails a call that HTTP would have served. Background-mode calls always use HTTP.

Models are discovered when the provider is created and on each sync. OpenAI’s /models listing carries only identifiers, so capability and cost metadata come from Everruns’ built-in model profiles, matched by model id.

Use gpt-6.2-sol for the current balanced model or gpt-6.2-astra for the flagship. Explicit previous model IDs remain available; the budget default is still gpt-6-luna.

Both GPT-6.2 models require the Responses API for function tools. Reasoning levels are low, medium (the default), high, xhigh, and max; none and minimal are rejected before sending. Standard, Fast (fast or priority), and Ultrafast are supported, but Flex is not. Ultrafast requires a US processing endpoint and costs 3x Standard through February 28, 2027, then 6x from March 1 Pacific time. Fast is 2x Standard.

Keep prior conversation input and encrypted reasoning items unchanged. Append new instructions instead of rewriting earlier messages: GPT-6.2 may drop reasoning after prefix edits, model downgrades, or user/organization changes. See OpenAI’s migration guide.