Ask a question to get started
Enter to sendā¢Shift+Enter new line
Get the cost in USD for a given model and number of tokens.
get_openai_token_cost_for_model( model_name: str, num_tokens: int, *, token_type: TokenType = TokenType.PROMPT ) -> float
model_name
str
Name of the model
num_tokens
int
Number of tokens.
token_type
TokenType
TokenType.PROMPT
Token type. Defaults to TokenType.PROMPT.