pub struct OpenRouterAttributionConfig {
pub enabled: bool,
pub referer: Option<String>,
pub title: Option<String>,
}Expand description
OpenRouter app attribution (https://openrouter.ai/docs/app-attribution).
Opt-in only. When enabled is false no attribution headers are sent.
When true, VT Code sends HTTP-Referer, X-OpenRouter-Title, and
X-OpenRouter-Categories: cli-agent.
Fields§
§enabled: boolMaster opt-in switch. Default false for privacy.
referer: Option<String>Override app URL used as HTTP-Referer. Defaults to the VT Code repo.
title: Option<String>Override display name used as X-OpenRouter-Title. Defaults to VT Code.
Implementations§
Source§impl OpenRouterAttributionConfig
impl OpenRouterAttributionConfig
Sourcepub const DEFAULT_REFERER: &'static str = "https://github.com/vinhnx/vtcode"
pub const DEFAULT_REFERER: &'static str = "https://github.com/vinhnx/vtcode"
Default referer sent when attribution is enabled and no override is set.
Sourcepub const DEFAULT_TITLE: &'static str = "VT Code"
pub const DEFAULT_TITLE: &'static str = "VT Code"
Default title sent when attribution is enabled and no override is set.
Sourcepub const CATEGORIES: &'static str = "cli-agent"
pub const CATEGORIES: &'static str = "cli-agent"
Fixed marketplace category. cli-agent is the allowlisted terminal-agent category.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Resolve whether attribution headers should be sent.
The environment layer wins when set to a recognized value
(ConfigLayerStack env > file); unrecognized or unset values fall
through to the file value. Delegates to the canonical tri-state
parser — do not fork the accepted-value set.
Sourcepub fn resolved_referer(&self) -> &str
pub fn resolved_referer(&self) -> &str
Resolve effective referer, falling back to the default. Empty or header-unsafe overrides are ignored.
Sourcepub fn resolved_title(&self) -> &str
pub fn resolved_title(&self) -> &str
Resolve effective title, falling back to the default. Empty or header-unsafe overrides are ignored.
Trait Implementations§
Source§impl Clone for OpenRouterAttributionConfig
impl Clone for OpenRouterAttributionConfig
Source§impl Debug for OpenRouterAttributionConfig
impl Debug for OpenRouterAttributionConfig
Source§impl<'de> Deserialize<'de> for OpenRouterAttributionConfig
impl<'de> Deserialize<'de> for OpenRouterAttributionConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for OpenRouterAttributionConfig
Source§impl JsonSchema for OpenRouterAttributionConfig
impl JsonSchema for OpenRouterAttributionConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for OpenRouterAttributionConfig
Auto Trait Implementations§
impl Freeze for OpenRouterAttributionConfig
impl RefUnwindSafe for OpenRouterAttributionConfig
impl Send for OpenRouterAttributionConfig
impl Sync for OpenRouterAttributionConfig
impl Unpin for OpenRouterAttributionConfig
impl UnsafeUnpin for OpenRouterAttributionConfig
impl UnwindSafe for OpenRouterAttributionConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.