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