pub struct Channel {Show 17 fields
pub id: String,
pub name: String,
pub api_key: SecretString,
pub protocol: String,
pub protocols: String,
pub is_builtin: bool,
pub enabled: bool,
pub created_at: i64,
pub updated_at: i64,
pub health_status: String,
pub cooldown_until: Option<String>,
pub consecutive_failures: u32,
pub billing_type: String,
pub monthly_quota: Option<u64>,
pub quota_policy: String,
pub priority: u32,
pub force_protocol: Option<String>,
}Expand description
An upstream AI provider channel with its API key and protocol.
Fields§
§id: StringUnique channel identifier (e.g. “anthropic-official”).
name: StringHuman-readable name (e.g. “Anthropic Official”).
api_key: SecretStringAPI key for authenticating with the upstream.
protocol: StringProtocol spoken by the upstream (default).
Deprecated for runtime use. Protocol selection is now derived from
protocols at request time. This field is retained
for DB backward compatibility and admin UI display only.
protocols: StringSupported protocols JSON: [{"protocol":"...","baseUrl":"...","rewritePath":"..."}].
is_builtin: boolWhether this channel was seeded by the system.
enabled: boolWhether this channel is active.
created_at: i64When the channel was first created (unix timestamp).
updated_at: i64When the channel was last modified (unix timestamp).
health_status: StringCurrent health status: “Healthy”, “Degraded”, or “Cooldown”.
cooldown_until: Option<String>If in cooldown, when it ends (RFC 3339).
consecutive_failures: u32Number of consecutive failures.
billing_type: StringBilling type: “Metered” or “FlatFee”.
monthly_quota: Option<u64>Monthly request quota (if applicable).
quota_policy: StringQuota exhaustion policy: “fallback” or “block”.
priority: u32Channel priority for weighted selection.
force_protocol: Option<String>When set, forces all traffic through this protocol regardless of client format. Used for testing protocol bridge functionality.