Codex (OpenAI) operations
This client mirrors and verifies upstream-compatible behavior. Upstream runtimes remain the canonical protocol owners.
Runtime-only provider over the OpenAI Responses API. Auth: Authorization: Bearer <apiKey>. providerKind codex-responses, protocolVersion responses-v1. Default model gpt-5-codex (CODEX_DEFAULT_MODEL) when a run omits one. Background responses make it stateful — getRun/cancelRun are implemented. Supports the batch surface over the OpenAI Batch API.
Capability (CODEX_RUNTIME_SUPPORT): runs ✅ · getRun ✅ · cancelRun ✅ · streamRun ✅ · batch ✅.
startRun
Maps the universal body to an OpenAI Responses request; output/tokens are normalized from the response. See runtime · startRun for the full field tables.
Example
import { createCodexProviderModule } from "@cavi-ai/api-client/providers/codex";
// … construct the runtime client, then:
const run = await client.startRun({ input: "Hi", model: "gpt-5-codex" });getRun
Reads a background response by id. Field tables per runtime · getRun.
cancelRun
Cancels an in-flight background response. See runtime · cancelRun.
streamRun
Streams the Responses SSE event feed, normalized to canonical run-stream events. See runtime · streamRun.
submitBatch / getBatch / cancelBatch / getBatchResults
submitBatch uploads a JSONL input file (POST /v1/files) and creates a batch against the /v1/responses endpoint; getBatchResults reads the batch (GET /v1/batches/:id) then downloads its output/error file (GET /v1/files/:id/content). Field tables per runtime · batch operations.