mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
71 lines
2.7 KiB
Swift
71 lines
2.7 KiB
Swift
//
|
|
// RoutedUsage.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct RoutedUsage: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Account is the provider-side account identifier. */
|
|
public var account: String?
|
|
/** Billing is how the routed inference bills: plan or commerce. */
|
|
public var billing: String?
|
|
/** CompletionTokens is the routed completion-token count. */
|
|
public var completionTokens: Int64?
|
|
/** CostCents is the routed cost in cents. */
|
|
public var costCents: Int64?
|
|
/** Kind is how the account authenticates: subscription or apikey. */
|
|
public var kind: String?
|
|
/** PromptTokens is the routed prompt-token count. */
|
|
public var promptTokens: Int64?
|
|
/** Provider is the AI provider the row's account belongs to. */
|
|
public var provider: String?
|
|
/** Requests is how many requests the gateway routed through this account. */
|
|
public var requests: Int64?
|
|
/** TotalTokens is the routed total token count. */
|
|
public var totalTokens: Int64?
|
|
|
|
public init(account: String? = nil, billing: String? = nil, completionTokens: Int64? = nil, costCents: Int64? = nil, kind: String? = nil, promptTokens: Int64? = nil, provider: String? = nil, requests: Int64? = nil, totalTokens: Int64? = nil) {
|
|
self.account = account
|
|
self.billing = billing
|
|
self.completionTokens = completionTokens
|
|
self.costCents = costCents
|
|
self.kind = kind
|
|
self.promptTokens = promptTokens
|
|
self.provider = provider
|
|
self.requests = requests
|
|
self.totalTokens = totalTokens
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case account
|
|
case billing
|
|
case completionTokens
|
|
case costCents
|
|
case kind
|
|
case promptTokens
|
|
case provider
|
|
case requests
|
|
case totalTokens
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(account, forKey: .account)
|
|
try container.encodeIfPresent(billing, forKey: .billing)
|
|
try container.encodeIfPresent(completionTokens, forKey: .completionTokens)
|
|
try container.encodeIfPresent(costCents, forKey: .costCents)
|
|
try container.encodeIfPresent(kind, forKey: .kind)
|
|
try container.encodeIfPresent(promptTokens, forKey: .promptTokens)
|
|
try container.encodeIfPresent(provider, forKey: .provider)
|
|
try container.encodeIfPresent(requests, forKey: .requests)
|
|
try container.encodeIfPresent(totalTokens, forKey: .totalTokens)
|
|
}
|
|
}
|
|
|