#[non_exhaustive]pub struct OpenRouterExtras {
pub provider: Option<String>,
pub native_finish_reason: Option<String>,
pub service_tier: Option<String>,
pub system_fingerprint: Option<String>,
pub cost: Option<f64>,
pub cost_details: Option<Map<String, Value>>,
pub is_byok: Option<bool>,
pub prompt_tokens_details: Option<Value>,
pub server_tool_use_details: Option<Value>,
pub openrouter_metadata: Option<Value>,
pub annotations: Option<Vec<Value>>,
}Expand description
OpenRouter’s reply fields. Each is None when the reply lacks it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.provider: Option<String>The upstream provider that served the request. Chat; Responses when sent.
native_finish_reason: Option<String>The upstream provider’s own finish reason. Chat only.
service_tier: Option<String>The service tier that served the request. Both routes.
system_fingerprint: Option<String>The upstream backend’s fingerprint. Chat only.
cost: Option<f64>The request’s cost in credits. Both routes.
cost_details: Option<Map<String, Value>>The cost broken down by upstream charge. Both routes, keyed as each route spells them.
is_byok: Option<bool>Whether the request ran on the caller’s own provider key. Both routes.
prompt_tokens_details: Option<Value>Prompt token details: usage.prompt_tokens_details on Chat,
usage.input_tokens_details on Responses.
server_tool_use_details: Option<Value>Server tool usage, such as web searches. Chat only.
openrouter_metadata: Option<Value>OpenRouter’s routing metadata. Chat only.
annotations: Option<Vec<Value>>The message’s annotations, such as URL citations. Chat only.
Trait Implementations§
Source§impl Clone for OpenRouterExtras
impl Clone for OpenRouterExtras
Source§impl Debug for OpenRouterExtras
impl Debug for OpenRouterExtras
Source§impl Default for OpenRouterExtras
impl Default for OpenRouterExtras
Source§impl PartialEq for OpenRouterExtras
impl PartialEq for OpenRouterExtras
Source§impl ReplyExtras for OpenRouterExtras
impl ReplyExtras for OpenRouterExtras
impl StructuralPartialEq for OpenRouterExtras
Auto Trait Implementations§
impl Freeze for OpenRouterExtras
impl RefUnwindSafe for OpenRouterExtras
impl Send for OpenRouterExtras
impl Sync for OpenRouterExtras
impl Unpin for OpenRouterExtras
impl UnsafeUnpin for OpenRouterExtras
impl UnwindSafe for OpenRouterExtras
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more