Skip to main content

Module codex

Module codex 

Source
Expand description

The Codex backend: a base-url proxy serving Anthropic’s windowed /api/oauth/usage shape, authenticated by the account’s flat base_url + token pair stamped onto ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN. The response always maps leniently - a proxy emits each window on its own and {} is the cold steady state, not a malformed response.

Re-exports§

use async_trait::async_trait; 🔒
use forge_primitives::usage::oauth::OauthUsageError; 🔒
use forge_primitives::usage::UsageSnapshot; 🔒
use forge_primitives::usage::UsageSourceKind; 🔒
use crate::helpers::BaseUrlCredential; 🔒
use crate::helpers::MissingBase; 🔒
use crate::helpers::OAUTH_TIMEOUT; 🔒
use crate::helpers::anthropic_windowed_probe; 🔒
use crate::helpers::base_url_credential; 🔒
use crate::helpers::snapshot_from_payload_lenient; 🔒
use crate::AccountEnv; 🔒
use crate::BillingModel; 🔒
use crate::ProbeError; 🔒
use crate::Provider; 🔒
use crate::ProviderBackend; 🔒
use crate::ProviderHost; 🔒

Structs§

Codex
The Codex [[accounts]] provider token.

Enums§

Mapper 🔒

Functions§

choose_mapper 🔒
The mapper the account’s env earns, paired with the credential that earns it: the base-url pair always maps leniently, and a missing base url carries its error to the probe’s Unmappable surface. Pure so the routing stays unit-pinned - the probe cannot be driven against the network offline.