Module exposing: Usage, CompletionTokensDetails, PromptTokensDetails
// Source: https://github.com/swuecho/chat | License: MIT | Copyright 2026 Hao Wu
// Provided via justclaw.it.com; keep this notice with the code.
package openai
// common.go defines common types used throughout the OpenAI API.
// Usage Represents the total token usage per request to OpenAI.
type Usage struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
PromptTokensDetails *PromptTokensDetails `json:"prompt_tokens_details"`
CompletionTokensDetails *CompletionTokensDetails `json:"completion_tokens_details"`
}
// CompletionTokensDetails Breakdown of tokens used in a completion.
type CompletionTokensDeta
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key