Skip to main content

byokey_provider/
lib.rs

1//! Provider executor implementations and model registry.
2//!
3//! ## Module layout
4//!
5//! - [`executor`]  — Per-provider [`ProviderExecutor`] implementations.
6//! - [`factory`]   — Executor creation from provider/model identifiers + config.
7//! - [`registry`]  — Model-to-provider mapping and model listing.
8//! - [`http_util`] — Shared HTTP send/stream helpers ([`ProviderHttp`]).
9//! - [`routing`]   — Round-robin API key selection ([`CredentialRouter`]).
10//! - [`retry`]     — Multi-key retry wrapper ([`RetryExecutor`]).
11
12pub mod cloak;
13pub mod device_profile;
14pub mod executor;
15pub mod factory;
16pub mod http_util;
17pub mod registry;
18pub mod retry;
19pub mod routing;
20pub mod selector;
21pub mod stream_bridge;
22pub mod versions;
23
24pub use device_profile::DeviceProfileCache;
25pub use executor::{
26    AntigravityExecutor, ClaudeExecutor, CodexExecutor, CodexWsExecutor, CopilotExecutor,
27    GeminiExecutor, IFlowExecutor, KimiExecutor, KiroExecutor, QwenExecutor,
28};
29pub use factory::{make_executor, make_executor_for_model, make_executor_with_cache};
30pub use http_util::ProviderHttp;
31pub use registry::{
32    ModelEntry, ThinkingSupport, all_models, is_copilot_free_model, models_for_provider,
33    parse_qualified_model, resolve_provider, resolve_provider_with, thinking_capability,
34    thinking_support,
35};
36pub use routing::{CredentialRouter, RoutingStrategy};
37pub use selector::{AccountNode, AccountSelector, RoutingPolicy, StrategyKind};
38pub use versions::VersionStore;
39
40/// Claude fingerprint constants shared with the proxy crate's `/v1/messages` handler.
41pub mod claude_headers {
42    pub use crate::executor::claude::{
43        ANTHROPIC_BETA, ANTHROPIC_VERSION, RUNTIME_VERSION, SDK_PACKAGE_VERSION, USER_AGENT,
44    };
45}