get_service_tier_cost_multiplier (providers/openai_responses_hooks.rs)

prime-agent · crates/pa-ai/src/providers/openai_responses_hooks.rs · rust · MIT
ai

Calculates OpenAI service tier cost multipliers and applies them to usage blocks.

// Source: https://github.com/PrimeIntellect-ai/prime-agent | License: MIT | Copyright 2025-2026 Prime Intellect Ltd
// Provided via justclaw.it.com; keep this notice with the code.
//! `OpenAI` Responses stream hooks, reasoning-summary options, and service-tier pricing.

use crate::types::Usage;

/// Reasoning summary mode requested from the Responses API.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[allow(dead_code)] // full TS option surface; variants set by callers
pub enum ReasoningSummary {
    Auto,
    Detailed,
    Concise,
}

impl ReasoningSummary {
    pub fn as_str(self) -> &'static str {
        match self {
            ReasoningSummary::Auto => "auto",
            ReasoningSummary::Detailed => "detailed",
            ReasoningSummary::Concise => "concise",
        }
    }
}

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

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

Get a free API key