OpenAI-Compatible SDKs
Codex Pooler provides narrow OpenAI-compatible /v1 support for selected SDK routes. It translates supported requests into Codex-compatible work, then sends them through the same Pool routing, limit checks, account selection, and accounting path used by Codex backend clients.
It doesn’t provide full OpenAI API parity.
Base URL and authentication
Section titled “Base URL and authentication”Use the /v1 base URL and a Pool API key:
Base URL:https://pooler.example.com/v1
Authorization:Bearer <pool-api-key>For local setup, use http://localhost:4000/v1.
Python SDK
Section titled “Python SDK”import os
from openai import OpenAI
client = OpenAI( api_key=os.environ["CODEX_POOLER_API_KEY"], base_url="https://pooler.example.com/v1",)
response = client.responses.create( model="gpt-5.5", input="Write a short setup confirmation.",)
print(response.output_text)Node SDK
Section titled “Node SDK”import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.CODEX_POOLER_API_KEY, baseURL: "https://pooler.example.com/v1",});
const response = await client.responses.create({ model: "gpt-5.5", input: "Write a short setup confirmation.",});
console.log(response.output_text);Vercel AI SDK
Section titled “Vercel AI SDK”import { createOpenAI } from "@ai-sdk/openai";import { generateText } from "ai";
const pooler = createOpenAI({ apiKey: process.env.CODEX_POOLER_API_KEY, baseURL: "https://pooler.example.com/v1",});
const { text } = await generateText({ model: pooler.responses("gpt-5.5"), prompt: "Write a short setup confirmation.",});
console.log(text);Selected route support
Section titled “Selected route support”The OpenAI-compatible /v1 surface supports selected routes only:
GET /v1/modelsPOST /v1/responsesGET /v1/responses, narrow Responses websocket compatibility onlyPOST /v1/responses/compactPOST /v1/chat/completionsGET /v1/usageGET /v1/filesPOST /v1/filesGET /v1/files/:file_idGET /v1/files/:file_id/content, deterministic unsupported content read after ownership checksDELETE /v1/files/:file_id, deterministic unsupported delete after ownership checksPOST /v1/audio/transcriptionsPOST /v1/images/generationsPOST /v1/images/edits
The /v1 surface is compatibility over Codex routing, not a separate OpenAI engine. Supported requests still require a Pool API key and a Pool with eligible upstream capacity for the requested model.
Unsupported boundaries
Section titled “Unsupported boundaries”These /v1 routes are unsupported and may return deterministic OpenAI-shaped unsupported endpoint errors when explicitly routed:
POST /v1/images/variationsPOST /v1/embeddingsPOST /v1/batchesPOST /v1/moderationsPOST /v1/fine_tuning/jobsGET /v1/responses/:response_idPOST /v1/responses/:response_id/cancelDELETE /v1/responses/:response_id/v1/realtimeand OpenAI Realtime SDK websocket or session routes
GET /v1/responses is narrow Responses websocket compatibility, not /v1/realtime support. OpenAI Realtime SDK websocket and session routes are not supported.
MCP stays separate
Section titled “MCP stays separate”The operator MCP endpoint is rooted at /mcp, not under /v1. It uses operator-owned MCP bearer tokens and returns metadata only.
MCP URL:https://pooler.example.com/mcp
Authorization:Bearer <operator-mcp-token>Don’t use Pool API keys, browser sessions, cookies, query tokens, invite tokens, upstream tokens, or custom headers as MCP authentication.