Skip to main content

aither_codex/
lib.rs

1//! `ChatGPT` Codex provider for aither.
2//!
3//! This crate integrates `ChatGPT` subscription accounts ("Codex") as a model
4//! provider:
5//!
6//! - [`auth`] — the two OAuth login flows (browser PKCE loopback and device
7//!   authorization), token refresh, and the persisted
8//!   [`CodexCredentials`] type.
9//! - [`Codex`] — a [`LanguageModel`] that wraps the `aither-openai` Responses
10//!   client pointed at the `chatgpt.com/backend-api/codex` subscription
11//!   endpoint, handling token refresh and rotation internally.
12//! - [`CodexProvider`] — a [`LanguageModelProvider`] that lists the backend's
13//!   own model catalog and hands out [`Codex`] clients.
14
15pub mod auth;
16mod client;
17pub mod constant;
18mod error;
19mod provider;
20
21pub use auth::CodexCredentials;
22pub use client::Codex;
23pub use error::CodexError;
24pub use provider::CodexProvider;
25
26pub use aither_core::llm::{LanguageModel, provider::LanguageModelProvider};