ClaudeRefreshProvider (refresh/codex.rs)

openproxy · src/oauth/refresh/codex.rs · rust · MIT
ai

Provides OAuth token refresh for Claude and Codex, handling JSON and form requests.

// Source: https://github.com/quangdang46/openproxy | License: MIT | Copyright 2024-2026 decolua and contributors
// Provided via justclaw.it.com; keep this notice with the code.
//! Codex and Claude token refresh providers.
//!
//! Implements `RefreshProvider` for:
//! - **Claude** (Anthropic): POST JSON to Anthropic's OAuth token endpoint
//! - **Codex** (OpenAI / ChatGPT): POST form-urlencoded to OpenAI's Auth0 endpoint

use async_trait::async_trait;
use reqwest::header::{ACCEPT, CONTENT_TYPE};

use super::RefreshProvider;
use crate::oauth::token_refresh::{dedup_refresh, RefreshResult};

// ---------------------------------------------------------------------------
// Constants
// ---------------------------------------------------------------------------

/// Claude OAuth client ID.
co

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key