Skip to content

Releases: Eunho-J/codex-as-api

v0.6.5

Choose a tag to compare

@Eunho-J Eunho-J released this 08 Aug 15:27

Full Changelog: v0.6.4...v0.6.5

v0.6.4 - Session and cache semantics

Choose a tag to compare

@Eunho-J Eunho-J released this 27 Jul 15:58

Codex identity and cache affinity

  • Remove process-global generated session_id and thread_id values from Python, TypeScript, and Rust. Codex metadata mode now requires an explicit non-empty client_metadata.session_id, defaults a root thread_id to that session, preserves an explicit child thread, and refreshes only turn-scoped identity on each request.
  • Resolve Chat prompt_cache_key as explicit value, then non-empty client_metadata.session_id, then omission. This matches Codex 0.145.0 and current main, where the official default is Responses metadata session_id, not thread_id.
  • Retain bounded process-local Chat previous_response_id history replay over private HTTP. The ID remains local and is never forwarded upstream.

Claude Code session and cache compatibility

  • Read x-claude-code-session-id on /v1/messages and derive a stable, privacy-safe SHA-256 prompt_cache_key; an explicit proxy extension prompt_cache_key takes precedence.
  • Keep normal Anthropic Messages stateless: reject non-null previous_response_id, disable ambient Codex metadata, avoid fabricated Claude thread IDs, and remove Python's nonstandard Anthropic response_id.
  • Validate Anthropic cache_control hints at request, system, message, content, and tool locations. Accept only type: "ephemeral" with optional TTL 5m or 1h, then strip the hint because the private Codex transport cannot preserve Anthropic cache breakpoints or TTL behavior.

Validation

  • Python: 515 tests, mypy, and changed-file Ruff checks.
  • TypeScript: 261 tests and production build.
  • Rust: 253 tests and rustfmt.
  • Re-audited @openai/codex 0.145.0 plus main at bd2de422aa287b97b06ca6425a10935bcf1b3731, and reproduced the Claude Code 2.1.220 request shape.

v0.6.3 - Claude Code Web compatibility

Choose a tag to compare

@Eunho-J Eunho-J released this 14 Jul 14:14

Claude Code WebSearch/WebFetch auxiliary calls

  • Fix HTTP 400 responses when a Claude Code session with ambient effort sends a WebSearch/WebFetch auxiliary request containing both output_config.effort and call-level thinking: {"type":"disabled"}.
  • Give explicit disabled thinking precedence over valid ambient effort and forward Codex reasoning effort none across Python, TypeScript, and Rust.
  • Require and document CODEX_AS_API_RESPONSES_LITE=off for Claude Code hosted WebSearch on GPT-5.6 because official Responses Lite relies on a standalone web.run executor; WebFetch does not require this override.
  • Continue rejecting empty, non-string, or unsupported effort values and unsupported output_config fields rather than silently discarding malformed requests.

Validation

  • Adapter tests cover every valid Claude Code effort value paired with disabled thinking while retaining invalid-value failures.
  • Streamed /v1/messages tests across all three runtimes and a local /count_tokens test reproduce the Claude Code 2.1.209 request shape and prove provider-backed requests reach the classic Codex wire with reasoning effort none.
  • A real GPT-5.6 Sol Codex OAuth WebSearch completed with HTTP 200 and structured server_tool_use, web_search_tool_result, and terminal SSE events.

v0.6.2

Choose a tag to compare

@Eunho-J Eunho-J released this 14 Jul 07:23

v0.6.2

  • Replace the Anthropic count_tokens byte/double-count estimator with bundled o200k_base ordinary tokenization across Python, TypeScript, and Rust.
  • Port the official tiktoken 0.13.0 Unicode pre-tokenization and BPE merge logic without adding a tiktoken package dependency or runtime encoding download.
  • Count normalized model-visible messages, tools, reasoning, and tool-result metadata once; ignore request controls and keep image estimates separate.
  • Record the 2026-07-14 upstream sync commit, rank SHA-256, and MIT third-party notice in source and package artifacts.

Validation before release:

  • Python: 486 tests passed; scoped Ruff and mypy passed; wheel/sdist checked and isolated wheel install passed.
  • TypeScript: 255 tests passed; type-check, build, npm pack, and isolated package install passed.
  • Rust: 244 tests passed; format, check, and release build passed.
  • All three endpoints matched 204 multilingual and long-input cases; a 4,000-byte ASCII message returns 1,012 tokens instead of roughly 8,000.
  • Claude Code 2.1.209 completed a real Codex OAuth request through the updated proxy.

v0.6.1

Choose a tag to compare

@Eunho-J Eunho-J released this 14 Jul 05:45

v0.6.1

  • Add Claude Code 2.1.208 custom GPT model routing alongside Fable, Opus, Sonnet, and Haiku.
  • Wire output_config.effort, Fast Mode, current context cleanup, model-specific token limits, and remote compaction across Python, TypeScript, and Rust.
  • Preserve URL images and tool-error state, and reject unsupported task budgets, beta tool semantics, malformed output formats, and unknown image sources before transport.
  • Keep Python streaming off the ASGI event loop and make Rust Anthropic SSE incremental with preserved OAuth, rate-limit, and overload errors.
  • Restrict Python source distributions to release inputs so local state cannot enter PyPI artifacts.

Validation before release:

  • Official openai/codex 0.144.4 and current main audited at 393f64565ab46f09d99ca4d9bd973537e72a114b.
  • Claude Code 2.1.208 completed a real Codex OAuth chat, explicit GPT-5.6 Sol max-effort call, and two-turn Read tool loop.
  • Python: 470 tests passed; mypy passed; wheel/sdist built, checked, installed, and served a health request.
  • TypeScript: 250 tests passed; build, type-check, and npm pack dry run passed.
  • Rust: 239 tests passed; format, check, and release build passed.

v0.6.0

Choose a tag to compare

@Eunho-J Eunho-J released this 10 Jul 09:44

v0.6.0

  • Add the GPT-5.6 alias plus Sol, Terra, and Luna model capabilities across Python, TypeScript, and Rust.
  • Wire reasoning effort/context and public standard mode, map ultra to private effort max, and reject unsupported Pro explicitly.
  • Map service_tier: fast to priority, gate classic detail: original by model capability, and refresh current context/default-effort metadata.
  • Implement bounded process-local previous_response_id continuation for private HTTP by replaying official response.output_item.done history; never alias it to thread_id or forward it on HTTP.
  • Preserve prompt_cache_key; reject non-null public cache options/breakpoints and safety_identifier because the private Codex contract has no equivalent fields.
  • Reject non-empty stop controls before transport, update Responses Lite/Compact behavior, and add npm package documentation.

Validation before release:

  • Official openai/codex main audited at 6ad0e943cc727dc836d7c671f3377db30107f4d9.
  • Python: 419 tests passed; mypy passed; wheel built.
  • TypeScript: 233 tests passed; build and npm pack dry run passed.
  • Rust: 209 tests passed; format, clippy execution, and release build passed.
  • Live ChatGPT Codex OAuth: two GPT-5.6 Sol HTTP calls completed with standard mapped to medium/all_turns; the second call replayed three semantic input items and sent no HTTP previous_response_id.

v0.5.2

Choose a tag to compare

@Eunho-J Eunho-J released this 03 Jul 02:18

v0.5.2

  • Support latest Codex root-level OAuth token files while keeping PAT-only, agent-identity-only, and Bedrock-only auth files explicitly unsupported.
  • Add shared model capability gating for Responses Lite, parallel tool calls, verbosity, and service-tier behavior across Python, TypeScript, and Rust.
  • Preserve encrypted reasoning state via top-level reasoning.encrypted_content include and add Codex metadata forwarding controls.

Validation before release:

  • Python pytest: 216 passed
  • TypeScript npm test: 151 passed
  • TypeScript build and npm pack dry-run passed
  • Rust cargo test: 129 passed
  • Rust cargo package verification passed

v0.5.1

Choose a tag to compare

@Eunho-J Eunho-J released this 01 Jun 01:27

Release Notes

v0.5.1

Codex backend version-header compatibility

  • Add the official Codex CLI originator header and versioned User-Agent header to ChatGPT/Codex OAuth requests across Python, TypeScript, and Rust.
  • Resolve the latest @openai/codex version from npm during server startup and cache it for outgoing requests.
  • Keep CODEX_AS_API_CODEX_CLI_VERSION as an explicit override for offline or pinned deployments.

Validation

  • Python: CODEX_AS_API_AUTH_PATH=/tmp/codex-as-api-missing-auth.json .venv/bin/pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build && npm pack --dry-run
  • Python package dry run: uv build --out-dir /tmp/codex-as-api-dist

v0.5.0

Claude Code conversation-history compatibility

  • Preserve Anthropic server-tool history blocks (server_tool_use, web_search_tool_result, and other *_tool_result blocks) as backend-readable context instead of silently dropping them on follow-up turns.
  • Preserve redacted_thinking placeholders without exposing unavailable reasoning text.
  • Preserve document and search_result content nested inside tool_result blocks.
  • Keep Python Anthropic streaming routes aligned with provider defaults so text.format and omitted optional knobs can pass through consistently.

Structured outputs

  • Map Anthropic output_format / output_config.format-style JSON schema requests to OpenAI Responses text.format for Claude Code side queries.
  • Keep JSON schema names OpenAI-compatible while preserving schema, description, and explicit strict settings.

Web search version tolerance

  • Accept unsuffixed type: "web_search" server tools in addition to versioned web_search_* tool types.

Validation

  • Python: .venv/bin/pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build

v0.4.0

Anthropic hosted web search compatibility

  • Route Anthropic web_search_* server tools to the OpenAI Responses hosted web_search tool instead of treating them as function tools.
  • Convert hosted web search calls back into Anthropic server_tool_use and web_search_tool_result blocks for Claude Code compatibility.
  • Preserve or synthesize usage.server_tool_use.web_search_requests and cover the behavior across Python, TypeScript, and Rust.

Package publishing preparation

  • Add a GitHub Actions workflow that builds/tests the TypeScript package and can publish to npmjs (codex-as-api) and GitHub Packages (@eunho-j/codex-as-api) by manual dispatch.

Validation

  • Python: .venv/bin/pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build

v0.3.3

Claude Code retry fix

  • Stop forwarding Anthropic/OpenAI max_tokens as Codex max_output_tokens because the Codex OAuth Responses backend rejects that parameter.
  • Add Python, TypeScript, and Rust regression coverage to keep provider payloads free of max_output_tokens even when clients send max_tokens.

Validation

  • Python: PYTHONPATH=src pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build

v0.3.2

Claude Code compatibility fix

  • Restored immediate Anthropic streaming so clients receive message_start before the backend response completes.
  • /v1/messages/count_tokens now returns a conservative local estimate because Codex OAuth has no Anthropic-equivalent count-only endpoint.
  • Token estimates use UTF-8 byte length as a conservative upper bound for GPT/Codex BPE text tokens, plus overhead for roles, message boundaries, tools, raw request metadata, and images.
  • Keeps real final streaming usage in message_delta while avoiding stream buffering.

Validation

  • Python: PYTHONPATH=src pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build
  • Live smoke: /v1/messages/count_tokens and streaming /v1/messages against local server

v0.3.1

Anthropic token accounting attempt

  • /v1/messages/count_tokens asked the Codex backend for real input-token usage with max_output_tokens: 0; this is superseded by v0.3.2 because Codex OAuth rejects count-only requests.
  • Token counting forwards Anthropic-converted tools, tool choice, stop sequences, and thinking/reasoning settings across Python, TypeScript, and Rust.
  • Provider requests now pass max_output_tokens through to Codex where requested.

Streaming usage parity

  • Anthropic streaming now propagates real cumulative usage details from the backend, including cache creation/read fields, server tool use, and service tier metadata when present.
  • message_start and final message_delta usage payloads now match the backend-reported accounting across all implementations.

Validation

  • Python: PYTHONPATH=src pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build

v0.3.0

Codex config parity

  • Python, TypeScript, and Rust now read Codex CLI config from CODEX_HOME / ~/.codex/config.toml.
  • model, model_context_window, and model_auto_compact_token_limit are reflected consistently across implementations.
  • CODEX_AS_API_MODEL still overrides the Codex config model when set.

Claude Code / Anthropic compatibility

  • /v1/messages preserves the client-supplied Anthropic model name in responses while using the configured Codex model for backend requests.
  • Added POST /v1/messages/count_tokens with estimated input_tokens, context_window, and auto_compact_token_limit.
  • Added POST /v1/messages/compact as an Anthropic-compatible alias for remote conversation compaction.

Observability and error handling

  • /health now reports codex_config_path, context_window, and auto_compact_token_limit.
  • Context-window failures now map to Anthropic-style 400 invalid_request_error responses.
  • Streaming Anthropic requests now emit error SSE events when backend errors occur mid-stream.

Validation

  • Python: PYTHONPATH=src pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build

v0.4.0

Choose a tag to compare

@Eunho-J Eunho-J released this 21 May 15:50

Release Notes

v0.4.0

Anthropic hosted web search compatibility

  • Route Anthropic web_search_* server tools to the OpenAI Responses hosted web_search tool instead of treating them as function tools.
  • Convert hosted web search calls back into Anthropic server_tool_use and web_search_tool_result blocks for Claude Code compatibility.
  • Preserve or synthesize usage.server_tool_use.web_search_requests and cover the behavior across Python, TypeScript, and Rust.

Package publishing preparation

  • Add a GitHub Actions workflow that builds/tests the TypeScript package and can publish to npmjs (codex-as-api) and GitHub Packages (@eunho-j/codex-as-api) by manual dispatch.

Validation

  • Python: .venv/bin/pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build

v0.3.3

Claude Code retry fix

  • Stop forwarding Anthropic/OpenAI max_tokens as Codex max_output_tokens because the Codex OAuth Responses backend rejects that parameter.
  • Add Python, TypeScript, and Rust regression coverage to keep provider payloads free of max_output_tokens even when clients send max_tokens.

Validation

  • Python: PYTHONPATH=src pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build

v0.3.2

Claude Code compatibility fix

  • Restored immediate Anthropic streaming so clients receive message_start before the backend response completes.
  • /v1/messages/count_tokens now returns a conservative local estimate because Codex OAuth has no Anthropic-equivalent count-only endpoint.
  • Token estimates use UTF-8 byte length as a conservative upper bound for GPT/Codex BPE text tokens, plus overhead for roles, message boundaries, tools, raw request metadata, and images.
  • Keeps real final streaming usage in message_delta while avoiding stream buffering.

Validation

  • Python: PYTHONPATH=src pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build
  • Live smoke: /v1/messages/count_tokens and streaming /v1/messages against local server

v0.3.1

Anthropic token accounting attempt

  • /v1/messages/count_tokens asked the Codex backend for real input-token usage with max_output_tokens: 0; this is superseded by v0.3.2 because Codex OAuth rejects count-only requests.
  • Token counting forwards Anthropic-converted tools, tool choice, stop sequences, and thinking/reasoning settings across Python, TypeScript, and Rust.
  • Provider requests now pass max_output_tokens through to Codex where requested.

Streaming usage parity

  • Anthropic streaming now propagates real cumulative usage details from the backend, including cache creation/read fields, server tool use, and service tier metadata when present.
  • message_start and final message_delta usage payloads now match the backend-reported accounting across all implementations.

Validation

  • Python: PYTHONPATH=src pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build

v0.3.0

Codex config parity

  • Python, TypeScript, and Rust now read Codex CLI config from CODEX_HOME / ~/.codex/config.toml.
  • model, model_context_window, and model_auto_compact_token_limit are reflected consistently across implementations.
  • CODEX_AS_API_MODEL still overrides the Codex config model when set.

Claude Code / Anthropic compatibility

  • /v1/messages preserves the client-supplied Anthropic model name in responses while using the configured Codex model for backend requests.
  • Added POST /v1/messages/count_tokens with estimated input_tokens, context_window, and auto_compact_token_limit.
  • Added POST /v1/messages/compact as an Anthropic-compatible alias for remote conversation compaction.

Observability and error handling

  • /health now reports codex_config_path, context_window, and auto_compact_token_limit.
  • Context-window failures now map to Anthropic-style 400 invalid_request_error responses.
  • Streaming Anthropic requests now emit error SSE events when backend errors occur mid-stream.

Validation

  • Python: PYTHONPATH=src pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build

v0.3.3

Choose a tag to compare

@Eunho-J Eunho-J released this 15 May 01:30

Claude Code retry fix

  • Stop forwarding Anthropic/OpenAI max_tokens as Codex max_output_tokens because the Codex OAuth Responses backend rejects that parameter.
  • Add Python, TypeScript, and Rust regression coverage to keep provider payloads free of max_output_tokens even when clients send max_tokens.

Validation

  • Python: PYTHONPATH=src pytest -q
  • Rust: cargo test
  • TypeScript: npm test && npm run build