Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tokencost

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tokencost

To calculate token and translated USD cost of string and message calls to OpenAI, for example when used by AI agents

  • 0.1.17
  • PyPI
  • Socket score

Maintainers
3

Tokencost

Clientside token counting + price estimation for LLM apps and AI agents.

Python Version

🐦 Twitter   •   📢 Discord   •   🖇️ AgentOps

TokenCost

License: MIT PyPI - Version X (formerly Twitter) Follow

Tokencost helps calculate the USD cost of using major Large Language Model (LLMs) APIs by calculating the estimated cost of prompts and completions.

Building AI agents? Check out AgentOps

Features

  • LLM Price Tracking Major LLM providers frequently add new models and update pricing. This repo helps track the latest price changes
  • Token counting Accurately count prompt tokens before sending OpenAI requests
  • Easy integration Get the cost of a prompt or completion with a single function

Example usage:

from tokencost import calculate_prompt_cost, calculate_completion_cost

model = "gpt-3.5-turbo"
prompt = [{ "role": "user", "content": "Hello world"}]
completion = "How may I assist you today?"

prompt_cost = calculate_prompt_cost(prompt, model)
completion_cost = calculate_completion_cost(completion, model)

print(f"{prompt_cost} + {completion_cost} = {prompt_cost + completion_cost}")
# 0.0000135 + 0.000014 = 0.0000275

Installation

pip install tokencost

Usage

Cost estimates

Calculating the cost of prompts and completions from OpenAI requests

from openai import OpenAI

client = OpenAI()
model = "gpt-3.5-turbo"
prompt = [{ "role": "user", "content": "Say this is a test"}]

chat_completion = client.chat.completions.create(
    messages=prompt, model=model
)

completion = chat_completion.choices[0].message.content
# "This is a test."

prompt_cost = calculate_prompt_cost(prompt, model)
completion_cost = calculate_completion_cost(completion, model)
print(f"{prompt_cost} + {completion_cost} = {prompt_cost + completion_cost}")
# 0.0000180 + 0.000010 = 0.0000280

Calculating cost using string prompts instead of messages:

from tokencost import calculate_prompt_cost

prompt_string = "Hello world" 
response = "How may I assist you today?"
model= "gpt-3.5-turbo"

prompt_cost = calculate_prompt_cost(prompt_string, model)
print(f"Cost: ${prompt_cost}")
# Cost: $3e-06

Counting tokens

from tokencost import count_message_tokens, count_string_tokens

message_prompt = [{ "role": "user", "content": "Hello world"}]
# Counting tokens in prompts formatted as message lists
print(count_message_tokens(message_prompt, model="gpt-3.5-turbo"))
# 9

# Alternatively, counting tokens in string prompts
print(count_string_tokens(prompt="Hello world", model="gpt-3.5-turbo"))
# 2

Cost table

Units denominated in USD. All prices can be located in model_prices.json.

Model NamePrompt Cost (USD) per 1M tokensCompletion Cost (USD) per 1M tokensMax Prompt TokensMax Output Tokens
gpt-4$30.00$60.0081924096
gpt-4o$ 5.00$15.00128,0004096
gpt-4o-audio-preview$2.5$10.00128,00016384
gpt-4o-audio-preview-2024-10-01$2.5$10.00128,00016384
gpt-4o-mini$0.15$0.6128,00016384
gpt-4o-mini-2024-07-18$0.15$0.6128,00016384
o1-mini$ 3.00$12.00128,00065536
o1-mini-2024-09-12$ 3.00$12.00128,00065536
o1-preview$15.00$60.00128,00032768
o1-preview-2024-09-12$15.00$60.00128,00032768
chatgpt-4o-latest$ 5.00$15.00128,0004096
gpt-4o-2024-05-13$ 5.00$15.00128,0004096
gpt-4o-2024-08-06$2.5$10.00128,00016384
gpt-4-turbo-preview$10.00$30.00128,0004096
gpt-4-0314$30.00$60.008,1924096
gpt-4-0613$30.00$60.008,1924096
gpt-4-32k$60.00$120.0032,7684096
gpt-4-32k-0314$60.00$120.0032,7684096
gpt-4-32k-0613$60.00$120.0032,7684096
gpt-4-turbo$10.00$30.00128,0004096
gpt-4-turbo-2024-04-09$10.00$30.00128,0004096
gpt-4-1106-preview$10.00$30.00128,0004096
gpt-4-0125-preview$10.00$30.00128,0004096
gpt-4-vision-preview$10.00$30.00128,0004096
gpt-4-1106-vision-preview$10.00$30.00128,0004096
gpt-3.5-turbo$1.5$ 2.0016,3854096
gpt-3.5-turbo-0301$1.5$ 2.004,0974096
gpt-3.5-turbo-0613$1.5$ 2.004,0974096
gpt-3.5-turbo-1106$ 1.00$ 2.0016,3854096
gpt-3.5-turbo-0125$0.5$1.516,3854096
gpt-3.5-turbo-16k$ 3.00$ 4.0016,3854096
gpt-3.5-turbo-16k-0613$ 3.00$ 4.0016,3854096
ft:gpt-3.5-turbo$ 3.00$ 6.0016,3854096
ft:gpt-3.5-turbo-0125$ 3.00$ 6.0016,3854096
ft:gpt-3.5-turbo-1106$ 3.00$ 6.0016,3854096
ft:gpt-3.5-turbo-0613$ 3.00$ 6.004,0964096
ft:gpt-4-0613$30.00$60.008,1924096
ft:gpt-4o-2024-08-06$3.75$15.00128,00016384
ft:gpt-4o-mini-2024-07-18$0.3$1.2128,00016384
ft:davinci-002$ 2.00$ 2.0016,3844096
ft:babbage-002$0.4$0.416,3844096
text-embedding-3-large$0.13$ 0.008,191nan
text-embedding-3-small$0.02$ 0.008,191nan
text-embedding-ada-002$0.1$ 0.008,191nan
text-embedding-ada-002-v2$0.1$ 0.008,191nan
text-moderation-stable$ 0.00$ 0.0032,7680
text-moderation-007$ 0.00$ 0.0032,7680
text-moderation-latest$ 0.00$ 0.0032,7680
256-x-256/dall-e-2----nannan
512-x-512/dall-e-2----nannan
1024-x-1024/dall-e-2----nannan
hd/1024-x-1792/dall-e-3----nannan
hd/1792-x-1024/dall-e-3----nannan
hd/1024-x-1024/dall-e-3----nannan
standard/1024-x-1792/dall-e-3----nannan
standard/1792-x-1024/dall-e-3----nannan
standard/1024-x-1024/dall-e-3----nannan
whisper-1----nannan
tts-1----nannan
tts-1-hd----nannan
azure/tts-1----nannan
azure/tts-1-hd----nannan
azure/whisper-1----nannan
azure/o1-mini$ 3.00$12.00128,00065536
azure/o1-mini-2024-09-12$ 3.00$12.00128,00065536
azure/o1-preview$15.00$60.00128,00032768
azure/o1-preview-2024-09-12$15.00$60.00128,00032768
azure/gpt-4o$ 5.00$15.00128,0004096
azure/gpt-4o-2024-08-06$2.75$11.00128,00016384
azure/gpt-4o-2024-05-13$ 5.00$15.00128,0004096
azure/global-standard/gpt-4o-2024-08-06$2.5$10.00128,00016384
azure/global-standard/gpt-4o-mini$0.15$0.6128,00016384
azure/gpt-4o-mini$0.165$0.66128,00016384
azure/gpt-4-turbo-2024-04-09$10.00$30.00128,0004096
azure/gpt-4-0125-preview$10.00$30.00128,0004096
azure/gpt-4-1106-preview$10.00$30.00128,0004096
azure/gpt-4-0613$30.00$60.008,1924096
azure/gpt-4-32k-0613$60.00$120.0032,7684096
azure/gpt-4-32k$60.00$120.0032,7684096
azure/gpt-4$30.00$60.008,1924096
azure/gpt-4-turbo$10.00$30.00128,0004096
azure/gpt-4-turbo-vision-preview$10.00$30.00128,0004096
azure/gpt-35-turbo-16k-0613$ 3.00$ 4.0016,3854096
azure/gpt-35-turbo-1106$ 1.00$ 2.0016,3844096
azure/gpt-35-turbo-0613$1.5$ 2.004,0974096
azure/gpt-35-turbo-0301$0.2$ 2.004,0974096
azure/gpt-35-turbo-0125$0.5$1.516,3844096
azure/gpt-35-turbo-16k$ 3.00$ 4.0016,3854096
azure/gpt-35-turbo$0.5$1.54,0974096
azure/gpt-3.5-turbo-instruct-0914$1.5$ 2.004,097nan
azure/gpt-35-turbo-instruct$1.5$ 2.004,097nan
azure/gpt-35-turbo-instruct-0914$1.5$ 2.004,097nan
azure/mistral-large-latest$ 8.00$24.0032,000nan
azure/mistral-large-2402$ 8.00$24.0032,000nan
azure/command-r-plus$ 3.00$15.00128,0004096
azure/ada$0.1$ 0.008,191nan
azure/text-embedding-ada-002$0.1$ 0.008,191nan
azure/text-embedding-3-large$0.13$ 0.008,191nan
azure/text-embedding-3-small$0.02$ 0.008,191nan
azure/standard/1024-x-1024/dall-e-3--$ 0.00nannan
azure/hd/1024-x-1024/dall-e-3--$ 0.00nannan
azure/standard/1024-x-1792/dall-e-3--$ 0.00nannan
azure/standard/1792-x-1024/dall-e-3--$ 0.00nannan
azure/hd/1024-x-1792/dall-e-3--$ 0.00nannan
azure/hd/1792-x-1024/dall-e-3--$ 0.00nannan
azure/standard/1024-x-1024/dall-e-2--$ 0.00nannan
azure_ai/jamba-instruct$0.5$0.770,0004096
azure_ai/mistral-large$ 4.00$12.0032,0008191
azure_ai/mistral-small$ 1.00$ 3.0032,0008191
azure_ai/Meta-Llama-3-70B-Instruct$1.1$0.378,1928192
azure_ai/Meta-Llama-3.1-8B-Instruct$0.3$0.61128,000128000
azure_ai/Meta-Llama-3.1-70B-Instruct$2.68$3.54128,000128000
azure_ai/Meta-Llama-3.1-405B-Instruct$5.33$16.00128,000128000
azure_ai/cohere-rerank-v3-multilingual$ 0.00$ 0.004,0964096
azure_ai/cohere-rerank-v3-english$ 0.00$ 0.004,0964096
azure_ai/Cohere-embed-v3-english$0.1$ 0.00512nan
azure_ai/Cohere-embed-v3-multilingual$0.1$ 0.00512nan
babbage-002$0.4$0.416,3844096
davinci-002$ 2.00$ 2.0016,3844096
gpt-3.5-turbo-instruct$1.5$ 2.008,1924096
gpt-3.5-turbo-instruct-0914$1.5$ 2.008,1924097
claude-instant-1$1.63$5.51100,0008191
mistral/mistral-tiny$0.25$0.2532,0008191
mistral/mistral-small$ 1.00$ 3.0032,0008191
mistral/mistral-small-latest$ 1.00$ 3.0032,0008191
mistral/mistral-medium$2.7$8.132,0008191
mistral/mistral-medium-latest$2.7$8.132,0008191
mistral/mistral-medium-2312$2.7$8.132,0008191
mistral/mistral-large-latest$ 3.00$ 9.00128,000128000
mistral/mistral-large-2402$ 4.00$12.0032,0008191
mistral/mistral-large-2407$ 3.00$ 9.00128,000128000
mistral/pixtral-12b-2409$0.15$0.15128,000128000
mistral/open-mistral-7b$0.25$0.2532,0008191
mistral/open-mixtral-8x7b$0.7$0.732,0008191
mistral/open-mixtral-8x22b$ 2.00$ 6.0064,0008191
mistral/codestral-latest$ 1.00$ 3.0032,0008191
mistral/codestral-2405$ 1.00$ 3.0032,0008191
mistral/open-mistral-nemo$0.3$0.3128,000128000
mistral/open-mistral-nemo-2407$0.3$0.3128,000128000
mistral/open-codestral-mamba$0.25$0.25256,000256000
mistral/codestral-mamba-latest$0.25$0.25256,000256000
mistral/mistral-embed$0.1--8,192nan
deepseek-chat$0.14$0.28128,0004096
codestral/codestral-latest$ 0.00$ 0.0032,0008191
codestral/codestral-2405$ 0.00$ 0.0032,0008191
text-completion-codestral/codestral-latest$ 0.00$ 0.0032,0008191
text-completion-codestral/codestral-2405$ 0.00$ 0.0032,0008191
deepseek-coder$0.14$0.28128,0004096
groq/llama2-70b-4096$0.7$0.84,0964096
groq/llama3-8b-8192$0.05$0.088,1928192
groq/llama3-70b-8192$0.59$0.798,1928192
groq/llama-3.1-8b-instant$0.05$0.088,1928192
groq/llama-3.1-70b-versatile$0.59$0.798,1928192
groq/llama-3.1-405b-reasoning$0.59$0.798,1928192
groq/mixtral-8x7b-32768$0.24$0.2432,76832768
groq/gemma-7b-it$0.07$0.078,1928192
groq/gemma2-9b-it$0.2$0.28,1928192
groq/llama3-groq-70b-8192-tool-use-preview$0.89$0.898,1928192
groq/llama3-groq-8b-8192-tool-use-preview$0.19$0.198,1928192
cerebras/llama3.1-8b$0.1$0.1128,000128000
cerebras/llama3.1-70b$0.6$0.6128,000128000
friendliai/mixtral-8x7b-instruct-v0-1$0.4$0.432,76832768
friendliai/meta-llama-3-8b-instruct$0.1$0.18,1928192
friendliai/meta-llama-3-70b-instruct$0.8$0.88,1928192
claude-instant-1.2$0.163$0.551100,0008191
claude-2$ 8.00$24.00100,0008191
claude-2.1$ 8.00$24.00200,0008191
claude-3-haiku-20240307$0.25$1.25200,0004096
claude-3-haiku-latest$0.25$1.25200,0004096
claude-3-opus-20240229$15.00$75.00200,0004096
claude-3-opus-latest$15.00$75.00200,0004096
claude-3-sonnet-20240229$ 3.00$15.00200,0004096
claude-3-5-sonnet-20240620$ 3.00$15.00200,0008192
claude-3-5-sonnet-20241022$ 3.00$15.00200,0008192
claude-3-5-sonnet-latest$ 3.00$15.00200,0008192
text-bison----8,1922048
text-bison@001----8,1921024
text-bison@002----8,1921024
text-bison32k$0.125$0.1258,1921024
text-bison32k@002$0.125$0.1258,1921024
text-unicorn$10.00$28.008,1921024
text-unicorn@001$10.00$28.008,1921024
chat-bison$0.125$0.1258,1924096
chat-bison@001$0.125$0.1258,1924096
chat-bison@002$0.125$0.1258,1924096
chat-bison-32k$0.125$0.12532,0008192
chat-bison-32k@002$0.125$0.12532,0008192
code-bison$0.125$0.1256,1441024
code-bison@001$0.125$0.1256,1441024
code-bison@002$0.125$0.1256,1441024
code-bison32k$0.125$0.1256,1441024
code-bison-32k@002$0.125$0.1256,1441024
code-gecko@001$0.125$0.1252,04864
code-gecko@002$0.125$0.1252,04864
code-gecko$0.125$0.1252,04864
code-gecko-latest$0.125$0.1252,04864
codechat-bison@latest$0.125$0.1256,1441024
codechat-bison$0.125$0.1256,1441024
codechat-bison@001$0.125$0.1256,1441024
codechat-bison@002$0.125$0.1256,1441024
codechat-bison-32k$0.125$0.12532,0008192
codechat-bison-32k@002$0.125$0.12532,0008192
gemini-pro$0.5$1.532,7608192
gemini-1.0-pro$0.5$1.532,7608192
gemini-1.0-pro-001$0.5$1.532,7608192
gemini-1.0-ultra$0.5$1.58,1922048
gemini-1.0-ultra-001$0.5$1.58,1922048
gemini-1.0-pro-002$0.5$1.532,7608192
gemini-1.5-pro$0.078125$0.31252,097,1528192
gemini-1.5-pro-002$0.078125$0.31252,097,1528192
gemini-1.5-pro-001$0.078125$0.31251,000,0008192
gemini-1.5-pro-preview-0514$0.078125$0.31251,000,0008192
gemini-1.5-pro-preview-0215$0.078125$0.31251,000,0008192
gemini-1.5-pro-preview-0409$0.078125$0.31251,000,0008192
gemini-1.5-flash$0.004688$0.00468751,000,0008192
gemini-1.5-flash-exp-0827$0.004688$0.00468751,000,0008192
gemini-1.5-flash-002$0.004688$0.00468751,048,5768192
gemini-1.5-flash-001$0.004688$0.00468751,000,0008192
gemini-1.5-flash-preview-0514$0.004688$0.00468751,000,0008192
gemini-pro-experimental$ 0.00$ 0.001,000,0008192
gemini-flash-experimental$ 0.00$ 0.001,000,0008192
gemini-pro-vision$0.25$0.516,3842048
gemini-1.0-pro-vision$0.25$0.516,3842048
gemini-1.0-pro-vision-001$0.25$0.516,3842048
medlm-medium----32,7688192
medlm-large----8,1921024
vertex_ai/claude-3-sonnet@20240229$ 3.00$15.00200,0004096
vertex_ai/claude-3-5-sonnet@20240620$ 3.00$15.00200,0008192
vertex_ai/claude-3-5-sonnet-v2@20241022$ 3.00$15.00200,0008192
vertex_ai/claude-3-haiku@20240307$0.25$1.25200,0004096
vertex_ai/claude-3-opus@20240229$15.00$75.00200,0004096
vertex_ai/meta/llama3-405b-instruct-maas$ 0.00$ 0.0032,00032000
vertex_ai/meta/llama3-70b-instruct-maas$ 0.00$ 0.0032,00032000
vertex_ai/meta/llama3-8b-instruct-maas$ 0.00$ 0.0032,00032000
vertex_ai/meta/llama-3.2-90b-vision-instruct-maas$ 0.00$ 0.00128,0008192
vertex_ai/mistral-large@latest$ 3.00$ 9.00128,0008191
vertex_ai/mistral-large@2407$ 3.00$ 9.00128,0008191
vertex_ai/mistral-nemo@latest$ 3.00$ 3.00128,000128000
vertex_ai/jamba-1.5-mini@001$0.2$0.4256,000256000
vertex_ai/jamba-1.5-large@001$ 2.00$ 8.00256,000256000
vertex_ai/jamba-1.5$0.2$0.4256,000256000
vertex_ai/jamba-1.5-mini$0.2$0.4256,000256000
vertex_ai/jamba-1.5-large$ 2.00$ 8.00256,000256000
vertex_ai/mistral-nemo@2407$ 3.00$ 3.00128,000128000
vertex_ai/codestral@latest$ 1.00$ 3.00128,000128000
vertex_ai/codestral@2405$ 1.00$ 3.00128,000128000
vertex_ai/imagegeneration@006----nannan
vertex_ai/imagen-3.0-generate-001----nannan
vertex_ai/imagen-3.0-fast-generate-001----nannan
text-embedding-004$0.00625$ 0.003,072nan
text-multilingual-embedding-002$0.00625$ 0.002,048nan
textembedding-gecko$0.00625$ 0.003,072nan
textembedding-gecko-multilingual$0.00625$ 0.003,072nan
textembedding-gecko-multilingual@001$0.00625$ 0.003,072nan
textembedding-gecko@001$0.00625$ 0.003,072nan
textembedding-gecko@003$0.00625$ 0.003,072nan
text-embedding-preview-0409$0.00625$ 0.003,072nan
text-multilingual-embedding-preview-0409$0.00625$ 0.003,072nan
palm/chat-bison$0.125$0.1258,1924096
palm/chat-bison-001$0.125$0.1258,1924096
palm/text-bison$0.125$0.1258,1921024
palm/text-bison-001$0.125$0.1258,1921024
palm/text-bison-safety-off$0.125$0.1258,1921024
palm/text-bison-safety-recitation-off$0.125$0.1258,1921024
gemini/gemini-1.5-flash-002$0.075$0.31,048,5768192
gemini/gemini-1.5-flash-001$0.075$0.31,048,5768192
gemini/gemini-1.5-flash$0.075$0.31,048,5768192
gemini/gemini-1.5-flash-latest$0.075$0.31,048,5768192
gemini/gemini-1.5-flash-8b-exp-0924$ 0.00$ 0.001,048,5768192
gemini/gemini-1.5-flash-exp-0827$ 0.00$ 0.001,048,5768192
gemini/gemini-1.5-flash-8b-exp-0827$ 0.00$ 0.001,000,0008192
gemini/gemini-pro$0.35$1.0532,7608192
gemini/gemini-1.5-pro$3.5$10.52,097,1528192
gemini/gemini-1.5-pro-002$3.5$10.52,097,1528192
gemini/gemini-1.5-pro-001$3.5$10.52,097,1528192
gemini/gemini-1.5-pro-exp-0801$3.5$10.52,097,1528192
gemini/gemini-1.5-pro-exp-0827$ 0.00$ 0.002,097,1528192
gemini/gemini-1.5-pro-latest$3.5$1.051,048,5768192
gemini/gemini-pro-vision$0.35$1.0530,7202048
gemini/gemini-gemma-2-27b-it$0.35$1.05nan8192
gemini/gemini-gemma-2-9b-it$0.35$1.05nan8192
command-r$0.15$0.6128,0004096
command-r-08-2024$0.15$0.6128,0004096
command-light$0.3$0.64,0964096
command-r-plus$2.5$10.00128,0004096
command-r-plus-08-2024$2.5$10.00128,0004096
command-nightly$ 1.00$ 2.004,0964096
command$ 1.00$ 2.004,0964096
rerank-english-v3.0$ 0.00$ 0.004,0964096
rerank-multilingual-v3.0$ 0.00$ 0.004,0964096
rerank-english-v2.0$ 0.00$ 0.004,0964096
rerank-multilingual-v2.0$ 0.00$ 0.004,0964096
embed-english-v3.0$0.1$ 0.001,024nan
embed-english-light-v3.0$0.1$ 0.001,024nan
embed-multilingual-v3.0$0.1$ 0.001,024nan
embed-english-v2.0$0.1$ 0.004,096nan
embed-english-light-v2.0$0.1$ 0.001,024nan
embed-multilingual-v2.0$0.1$ 0.00768nan
replicate/meta/llama-2-13b$0.1$0.54,0964096
replicate/meta/llama-2-13b-chat$0.1$0.54,0964096
replicate/meta/llama-2-70b$0.65$2.754,0964096
replicate/meta/llama-2-70b-chat$0.65$2.754,0964096
replicate/meta/llama-2-7b$0.05$0.254,0964096
replicate/meta/llama-2-7b-chat$0.05$0.254,0964096
replicate/meta/llama-3-70b$0.65$2.758,1928192
replicate/meta/llama-3-70b-instruct$0.65$2.758,1928192
replicate/meta/llama-3-8b$0.05$0.258,0868086
replicate/meta/llama-3-8b-instruct$0.05$0.258,0868086
replicate/mistralai/mistral-7b-v0.1$0.05$0.254,0964096
replicate/mistralai/mistral-7b-instruct-v0.2$0.05$0.254,0964096
replicate/mistralai/mixtral-8x7b-instruct-v0.1$0.3$ 1.004,0964096
openrouter/deepseek/deepseek-coder$0.14$0.2832,0004096
openrouter/microsoft/wizardlm-2-8x22b:nitro$ 1.00$ 1.00nannan
openrouter/google/gemini-pro-1.5$2.5$7.51,000,0008192
openrouter/mistralai/mixtral-8x22b-instruct$0.65$0.65nannan
openrouter/cohere/command-r-plus$ 3.00$15.00nannan
openrouter/databricks/dbrx-instruct$0.6$0.6nannan
openrouter/anthropic/claude-3-haiku$0.25$1.25nannan
openrouter/anthropic/claude-3-haiku-20240307$0.25$1.25200,0004096
anthropic/claude-3-5-sonnet-20241022$ 3.00$15.00200,0008192
anthropic/claude-3-5-sonnet-latest$ 3.00$15.00200,0008192
openrouter/anthropic/claude-3.5-sonnet$ 3.00$15.00200,0008192
openrouter/anthropic/claude-3.5-sonnet:beta$ 3.00$15.00200,0008192
openrouter/anthropic/claude-3-sonnet$ 3.00$15.00nannan
openrouter/mistralai/mistral-large$ 8.00$24.00nannan
openrouter/cognitivecomputations/dolphin-mixtral-8x7b$0.5$0.5nannan
openrouter/google/gemini-pro-vision$0.125$0.375nannan
openrouter/fireworks/firellava-13b$0.2$0.2nannan
openrouter/meta-llama/llama-3-8b-instruct:free$ 0.00$ 0.00nannan
openrouter/meta-llama/llama-3-8b-instruct:extended$0.225$2.25nannan
openrouter/meta-llama/llama-3-70b-instruct:nitro$0.9$0.9nannan
openrouter/meta-llama/llama-3-70b-instruct$0.59$0.79nannan
openrouter/openai/o1-mini$ 3.00$12.00128,00065536
openrouter/openai/o1-mini-2024-09-12$ 3.00$12.00128,00065536
openrouter/openai/o1-preview$15.00$60.00128,00032768
openrouter/openai/o1-preview-2024-09-12$15.00$60.00128,00032768
openrouter/openai/gpt-4o$ 5.00$15.00128,0004096
openrouter/openai/gpt-4o-2024-05-13$ 5.00$15.00128,0004096
openrouter/openai/gpt-4-vision-preview$10.00$30.00nannan
openrouter/openai/gpt-3.5-turbo$1.5$ 2.00nannan
openrouter/openai/gpt-3.5-turbo-16k$ 3.00$ 4.00nannan
openrouter/openai/gpt-4$30.00$60.00nannan
openrouter/anthropic/claude-instant-v1$1.63$5.51nan8191
openrouter/anthropic/claude-2$11.02$32.68nan8191
openrouter/anthropic/claude-3-opus$15.00$75.00200,0004096
openrouter/google/palm-2-chat-bison$0.5$0.5nannan
openrouter/google/palm-2-codechat-bison$0.5$0.5nannan
openrouter/meta-llama/llama-2-13b-chat$0.2$0.2nannan
openrouter/meta-llama/llama-2-70b-chat$1.5$1.5nannan
openrouter/meta-llama/codellama-34b-instruct$0.5$0.5nannan
openrouter/nousresearch/nous-hermes-llama2-13b$0.2$0.2nannan
openrouter/mancer/weaver$5.625$5.625nannan
openrouter/gryphe/mythomax-l2-13b$1.875$1.875nannan
openrouter/jondurbin/airoboros-l2-70b-2.1$13.875$13.875nannan
openrouter/undi95/remm-slerp-l2-13b$1.875$1.875nannan
openrouter/pygmalionai/mythalion-13b$1.875$1.875nannan
openrouter/mistralai/mistral-7b-instruct$0.13$0.13nannan
openrouter/mistralai/mistral-7b-instruct:free$ 0.00$ 0.00nannan
j2-ultra$15.00$15.008,1928192
jamba-1.5-mini@001$0.2$0.4256,000256000
jamba-1.5-large@001$ 2.00$ 8.00256,000256000
jamba-1.5$0.2$0.4256,000256000
jamba-1.5-mini$0.2$0.4256,000256000
jamba-1.5-large$ 2.00$ 8.00256,000256000
j2-mid$10.00$10.008,1928192
j2-light$ 3.00$ 3.008,1928192
dolphin$0.5$0.516,38416384
chatdolphin$0.5$0.516,38416384
luminous-base$30.00$33.00nannan
luminous-base-control$37.5$41.25nannan
luminous-extended$45.00$49.5nannan
luminous-extended-control$56.25$61.875nannan
luminous-supreme$175.00$192.5nannan
luminous-supreme-control$218.75$240.625nannan
ai21.j2-mid-v1$12.5$12.58,1918191
ai21.j2-ultra-v1$18.8$18.88,1918191
ai21.jamba-instruct-v1:0$0.5$0.770,0004096
amazon.titan-text-lite-v1$0.3$0.442,0004000
amazon.titan-text-express-v1$1.3$1.742,0008000
amazon.titan-text-premier-v1:0$0.5$1.542,00032000
amazon.titan-embed-text-v1$0.1$ 0.008,192nan
amazon.titan-embed-text-v2:0$0.2$ 0.008,192nan
mistral.mistral-7b-instruct-v0:2$0.15$0.232,0008191
mistral.mixtral-8x7b-instruct-v0:1$0.45$0.732,0008191
mistral.mistral-large-2402-v1:0$ 8.00$24.0032,0008191
mistral.mistral-large-2407-v1:0$ 3.00$ 9.00128,0008191
mistral.mistral-small-2402-v1:0$ 1.00$ 3.0032,0008191
bedrock/us-west-2/mistral.mixtral-8x7b-instruct-v0:1$0.45$0.732,0008191
bedrock/us-east-1/mistral.mixtral-8x7b-instruct-v0:1$0.45$0.732,0008191
bedrock/eu-west-3/mistral.mixtral-8x7b-instruct-v0:1$0.59$0.9132,0008191
bedrock/us-west-2/mistral.mistral-7b-instruct-v0:2$0.15$0.232,0008191
bedrock/us-east-1/mistral.mistral-7b-instruct-v0:2$0.15$0.232,0008191
bedrock/eu-west-3/mistral.mistral-7b-instruct-v0:2$0.2$0.2632,0008191
bedrock/us-east-1/mistral.mistral-large-2402-v1:0$ 8.00$24.0032,0008191
bedrock/us-west-2/mistral.mistral-large-2402-v1:0$ 8.00$24.0032,0008191
bedrock/eu-west-3/mistral.mistral-large-2402-v1:0$10.4$31.232,0008191
anthropic.claude-3-sonnet-20240229-v1:0$ 3.00$15.00200,0004096
anthropic.claude-3-5-sonnet-20240620-v1:0$ 3.00$15.00200,0004096
anthropic.claude-3-5-sonnet-20241022-v2:0$ 3.00$15.00200,0004096
anthropic.claude-3-5-sonnet-latest-v2:0$ 3.00$15.00200,0004096
anthropic.claude-3-haiku-20240307-v1:0$0.25$1.25200,0004096
anthropic.claude-3-opus-20240229-v1:0$15.00$75.00200,0004096
us.anthropic.claude-3-sonnet-20240229-v1:0$ 3.00$15.00200,0004096
us.anthropic.claude-3-5-sonnet-20240620-v1:0$ 3.00$15.00200,0004096
us.anthropic.claude-3-5-sonnet-20241022-v2:0$ 3.00$15.00200,0004096
us.anthropic.claude-3-haiku-20240307-v1:0$0.25$1.25200,0004096
us.anthropic.claude-3-opus-20240229-v1:0$15.00$75.00200,0004096
eu.anthropic.claude-3-sonnet-20240229-v1:0$ 3.00$15.00200,0004096
eu.anthropic.claude-3-5-sonnet-20240620-v1:0$ 3.00$15.00200,0004096
eu.anthropic.claude-3-5-sonnet-20241022-v2:0$ 3.00$15.00200,0004096
eu.anthropic.claude-3-haiku-20240307-v1:0$0.25$1.25200,0004096
eu.anthropic.claude-3-opus-20240229-v1:0$15.00$75.00200,0004096
anthropic.claude-v1$ 8.00$24.00100,0008191
bedrock/us-east-1/anthropic.claude-v1$ 8.00$24.00100,0008191
bedrock/us-west-2/anthropic.claude-v1$ 8.00$24.00100,0008191
bedrock/ap-northeast-1/anthropic.claude-v1$ 8.00$24.00100,0008191
bedrock/ap-northeast-1/1-month-commitment/anthropic.claude-v1----100,0008191
bedrock/ap-northeast-1/6-month-commitment/anthropic.claude-v1----100,0008191
bedrock/eu-central-1/anthropic.claude-v1$ 8.00$24.00100,0008191
bedrock/eu-central-1/1-month-commitment/anthropic.claude-v1----100,0008191
bedrock/eu-central-1/6-month-commitment/anthropic.claude-v1----100,0008191
bedrock/us-east-1/1-month-commitment/anthropic.claude-v1----100,0008191
bedrock/us-east-1/6-month-commitment/anthropic.claude-v1----100,0008191
bedrock/us-west-2/1-month-commitment/anthropic.claude-v1----100,0008191
bedrock/us-west-2/6-month-commitment/anthropic.claude-v1----100,0008191
anthropic.claude-v2$ 8.00$24.00100,0008191
bedrock/us-east-1/anthropic.claude-v2$ 8.00$24.00100,0008191
bedrock/us-west-2/anthropic.claude-v2$ 8.00$24.00100,0008191
bedrock/ap-northeast-1/anthropic.claude-v2$ 8.00$24.00100,0008191
bedrock/ap-northeast-1/1-month-commitment/anthropic.claude-v2----100,0008191
bedrock/ap-northeast-1/6-month-commitment/anthropic.claude-v2----100,0008191
bedrock/eu-central-1/anthropic.claude-v2$ 8.00$24.00100,0008191
bedrock/eu-central-1/1-month-commitment/anthropic.claude-v2----100,0008191
bedrock/eu-central-1/6-month-commitment/anthropic.claude-v2----100,0008191
bedrock/us-east-1/1-month-commitment/anthropic.claude-v2----100,0008191
bedrock/us-east-1/6-month-commitment/anthropic.claude-v2----100,0008191
bedrock/us-west-2/1-month-commitment/anthropic.claude-v2----100,0008191
bedrock/us-west-2/6-month-commitment/anthropic.claude-v2----100,0008191
anthropic.claude-v2:1$ 8.00$24.00100,0008191
bedrock/us-east-1/anthropic.claude-v2:1$ 8.00$24.00100,0008191
bedrock/us-west-2/anthropic.claude-v2:1$ 8.00$24.00100,0008191
bedrock/ap-northeast-1/anthropic.claude-v2:1$ 8.00$24.00100,0008191
bedrock/ap-northeast-1/1-month-commitment/anthropic.claude-v2:1----100,0008191
bedrock/ap-northeast-1/6-month-commitment/anthropic.claude-v2:1----100,0008191
bedrock/eu-central-1/anthropic.claude-v2:1$ 8.00$24.00100,0008191
bedrock/eu-central-1/1-month-commitment/anthropic.claude-v2:1----100,0008191
bedrock/eu-central-1/6-month-commitment/anthropic.claude-v2:1----100,0008191
bedrock/us-east-1/1-month-commitment/anthropic.claude-v2:1----100,0008191
bedrock/us-east-1/6-month-commitment/anthropic.claude-v2:1----100,0008191
bedrock/us-west-2/1-month-commitment/anthropic.claude-v2:1----100,0008191
bedrock/us-west-2/6-month-commitment/anthropic.claude-v2:1----100,0008191
anthropic.claude-instant-v1$1.63$5.51100,0008191
bedrock/us-east-1/anthropic.claude-instant-v1$0.8$2.4100,0008191
bedrock/us-east-1/1-month-commitment/anthropic.claude-instant-v1----100,0008191
bedrock/us-east-1/6-month-commitment/anthropic.claude-instant-v1----100,0008191
bedrock/us-west-2/1-month-commitment/anthropic.claude-instant-v1----100,0008191
bedrock/us-west-2/6-month-commitment/anthropic.claude-instant-v1----100,0008191
bedrock/us-west-2/anthropic.claude-instant-v1$0.8$2.4100,0008191
bedrock/ap-northeast-1/anthropic.claude-instant-v1$2.23$7.55100,0008191
bedrock/ap-northeast-1/1-month-commitment/anthropic.claude-instant-v1----100,0008191
bedrock/ap-northeast-1/6-month-commitment/anthropic.claude-instant-v1----100,0008191
bedrock/eu-central-1/anthropic.claude-instant-v1$2.48$8.38100,0008191
bedrock/eu-central-1/1-month-commitment/anthropic.claude-instant-v1----100,0008191
bedrock/eu-central-1/6-month-commitment/anthropic.claude-instant-v1----100,0008191
cohere.command-text-v14$1.5$ 2.004,0964096
bedrock/*/1-month-commitment/cohere.command-text-v14----4,0964096
bedrock/*/6-month-commitment/cohere.command-text-v14----4,0964096
cohere.command-light-text-v14$0.3$0.64,0964096
bedrock/*/1-month-commitment/cohere.command-light-text-v14----4,0964096
bedrock/*/6-month-commitment/cohere.command-light-text-v14----4,0964096
cohere.command-r-plus-v1:0$ 3.00$15.00128,0004096
cohere.command-r-v1:0$0.5$1.5128,0004096
cohere.embed-english-v3$0.1$ 0.00512nan
cohere.embed-multilingual-v3$0.1$ 0.00512nan
meta.llama2-13b-chat-v1$0.75$ 1.004,0964096
meta.llama2-70b-chat-v1$1.95$2.564,0964096
meta.llama3-8b-instruct-v1:0$0.3$0.68,1928192
bedrock/us-east-1/meta.llama3-8b-instruct-v1:0$0.3$0.68,1928192
bedrock/us-west-1/meta.llama3-8b-instruct-v1:0$0.3$0.68,1928192
bedrock/ap-south-1/meta.llama3-8b-instruct-v1:0$0.36$0.728,1928192
bedrock/ca-central-1/meta.llama3-8b-instruct-v1:0$0.35$0.698,1928192
bedrock/eu-west-1/meta.llama3-8b-instruct-v1:0$0.32$0.658,1928192
bedrock/eu-west-2/meta.llama3-8b-instruct-v1:0$0.39$0.788,1928192
bedrock/sa-east-1/meta.llama3-8b-instruct-v1:0$0.5$1.018,1928192
meta.llama3-70b-instruct-v1:0$2.65$3.58,1928192
bedrock/us-east-1/meta.llama3-70b-instruct-v1:0$2.65$3.58,1928192
bedrock/us-west-1/meta.llama3-70b-instruct-v1:0$2.65$3.58,1928192
bedrock/ap-south-1/meta.llama3-70b-instruct-v1:0$3.18$4.28,1928192
bedrock/ca-central-1/meta.llama3-70b-instruct-v1:0$3.05$4.038,1928192
bedrock/eu-west-1/meta.llama3-70b-instruct-v1:0$2.86$3.788,1928192
bedrock/eu-west-2/meta.llama3-70b-instruct-v1:0$3.45$4.558,1928192
bedrock/sa-east-1/meta.llama3-70b-instruct-v1:0$4.45$5.888,1928192
meta.llama3-1-8b-instruct-v1:0$0.22$0.22128,0002048
meta.llama3-1-70b-instruct-v1:0$0.99$0.99128,0002048
meta.llama3-1-405b-instruct-v1:0$5.32$16.00128,0004096
meta.llama3-2-1b-instruct-v1:0$0.1$0.1128,0004096
us.meta.llama3-2-1b-instruct-v1:0$0.1$0.1128,0004096
eu.meta.llama3-2-1b-instruct-v1:0$0.13$0.13128,0004096
meta.llama3-2-3b-instruct-v1:0$0.15$0.15128,0004096
us.meta.llama3-2-3b-instruct-v1:0$0.15$0.15128,0004096
eu.meta.llama3-2-3b-instruct-v1:0$0.19$0.19128,0004096
meta.llama3-2-11b-instruct-v1:0$0.35$0.35128,0004096
us.meta.llama3-2-11b-instruct-v1:0$0.35$0.35128,0004096
meta.llama3-2-90b-instruct-v1:0$ 2.00$ 2.00128,0004096
us.meta.llama3-2-90b-instruct-v1:0$ 2.00$ 2.00128,0004096
512-x-512/50-steps/stability.stable-diffusion-xl-v0----77nan
512-x-512/max-steps/stability.stable-diffusion-xl-v0----77nan
max-x-max/50-steps/stability.stable-diffusion-xl-v0----77nan
max-x-max/max-steps/stability.stable-diffusion-xl-v0----77nan
1024-x-1024/50-steps/stability.stable-diffusion-xl-v1----77nan
1024-x-1024/max-steps/stability.stable-diffusion-xl-v1----77nan
sagemaker/meta-textgeneration-llama-2-7b$ 0.00$ 0.004,0964096
sagemaker/meta-textgeneration-llama-2-7b-f$ 0.00$ 0.004,0964096
sagemaker/meta-textgeneration-llama-2-13b$ 0.00$ 0.004,0964096
sagemaker/meta-textgeneration-llama-2-13b-f$ 0.00$ 0.004,0964096
sagemaker/meta-textgeneration-llama-2-70b$ 0.00$ 0.004,0964096
sagemaker/meta-textgeneration-llama-2-70b-b-f$ 0.00$ 0.004,0964096
together-ai-up-to-4b$0.1$0.1nannan
together-ai-4.1b-8b$0.2$0.2nannan
together-ai-8.1b-21b$0.3$0.3nannan
together-ai-21.1b-41b$0.8$0.8nannan
together-ai-41.1b-80b$0.9$0.9nannan
together-ai-81.1b-110b$1.8$1.8nannan
together-ai-embedding-up-to-150m$0.008$ 0.00nannan
together-ai-embedding-151m-to-350m$0.016$ 0.00nannan
together_ai/mistralai/Mixtral-8x7B-Instruct-v0.1$0.6$0.6nannan
together_ai/mistralai/Mistral-7B-Instruct-v0.1----nannan
together_ai/togethercomputer/CodeLlama-34b-Instruct----nannan
ollama/codegemma$ 0.00$ 0.008,1928192
ollama/codegeex4$ 0.00$ 0.0032,7688192
ollama/deepseek-coder-v2-instruct$ 0.00$ 0.0032,7688192
ollama/deepseek-coder-v2-base$ 0.00$ 0.008,1928192
ollama/deepseek-coder-v2-lite-instruct$ 0.00$ 0.0032,7688192
ollama/deepseek-coder-v2-lite-base$ 0.00$ 0.008,1928192
ollama/internlm2_5-20b-chat$ 0.00$ 0.0032,7688192
ollama/llama2$ 0.00$ 0.004,0964096
ollama/llama2:7b$ 0.00$ 0.004,0964096
ollama/llama2:13b$ 0.00$ 0.004,0964096
ollama/llama2:70b$ 0.00$ 0.004,0964096
ollama/llama2-uncensored$ 0.00$ 0.004,0964096
ollama/llama3$ 0.00$ 0.008,1928192
ollama/llama3:8b$ 0.00$ 0.008,1928192
ollama/llama3:70b$ 0.00$ 0.008,1928192
ollama/llama3.1$ 0.00$ 0.008,1928192
ollama/mistral-large-instruct-2407$ 0.00$ 0.0065,5368192
ollama/mistral$ 0.00$ 0.008,1928192
ollama/mistral-7B-Instruct-v0.1$ 0.00$ 0.008,1928192
ollama/mistral-7B-Instruct-v0.2$ 0.00$ 0.0032,76832768
ollama/mixtral-8x7B-Instruct-v0.1$ 0.00$ 0.0032,76832768
ollama/mixtral-8x22B-Instruct-v0.1$ 0.00$ 0.0065,53665536
ollama/codellama$ 0.00$ 0.004,0964096
ollama/orca-mini$ 0.00$ 0.004,0964096
ollama/vicuna$ 0.00$ 0.002,0482048
deepinfra/lizpreciatior/lzlv_70b_fp16_hf$0.7$0.94,0964096
deepinfra/Gryphe/MythoMax-L2-13b$0.22$0.224,0964096
deepinfra/mistralai/Mistral-7B-Instruct-v0.1$0.13$0.1332,7688191
deepinfra/meta-llama/Llama-2-70b-chat-hf$0.7$0.94,0964096
deepinfra/cognitivecomputations/dolphin-2.6-mixtral-8x7b$0.27$0.2732,7688191
deepinfra/codellama/CodeLlama-34b-Instruct-hf$0.6$0.64,0964096
deepinfra/deepinfra/mixtral$0.27$0.2732,0004096
deepinfra/Phind/Phind-CodeLlama-34B-v2$0.6$0.616,3844096
deepinfra/mistralai/Mixtral-8x7B-Instruct-v0.1$0.27$0.2732,7688191
deepinfra/deepinfra/airoboros-70b$0.7$0.94,0964096
deepinfra/01-ai/Yi-34B-Chat$0.6$0.64,0964096
deepinfra/01-ai/Yi-6B-200K$0.13$0.13200,0004096
deepinfra/jondurbin/airoboros-l2-70b-gpt4-1.4.1$0.7$0.94,0964096
deepinfra/meta-llama/Llama-2-13b-chat-hf$0.22$0.224,0964096
deepinfra/amazon/MistralLite$0.2$0.232,7688191
deepinfra/meta-llama/Llama-2-7b-chat-hf$0.13$0.134,0964096
deepinfra/meta-llama/Meta-Llama-3-8B-Instruct$0.08$0.088,1914096
deepinfra/meta-llama/Meta-Llama-3-70B-Instruct$0.59$0.798,1914096
deepinfra/01-ai/Yi-34B-200K$0.6$0.6200,0004096
deepinfra/openchat/openchat_3.5$0.13$0.134,0964096
perplexity/codellama-34b-instruct$0.35$1.416,38416384
perplexity/codellama-70b-instruct$0.7$2.816,38416384
perplexity/llama-3.1-70b-instruct$ 1.00$ 1.00131,072131072
perplexity/llama-3.1-8b-instruct$0.2$0.2131,072131072
perplexity/llama-3.1-sonar-huge-128k-online$ 5.00$ 5.00127,072127072
perplexity/llama-3.1-sonar-large-128k-online$ 1.00$ 1.00127,072127072
perplexity/llama-3.1-sonar-large-128k-chat$ 1.00$ 1.00131,072131072
perplexity/llama-3.1-sonar-small-128k-chat$0.2$0.2131,072131072
perplexity/llama-3.1-sonar-small-128k-online$0.2$0.2127,072127072
perplexity/pplx-7b-chat$0.07$0.288,1928192
perplexity/pplx-70b-chat$0.7$2.84,0964096
perplexity/pplx-7b-online$ 0.00$0.284,0964096
perplexity/pplx-70b-online$ 0.00$2.84,0964096
perplexity/llama-2-70b-chat$0.7$2.84,0964096
perplexity/mistral-7b-instruct$0.07$0.284,0964096
perplexity/mixtral-8x7b-instruct$0.07$0.284,0964096
perplexity/sonar-small-chat$0.07$0.2816,38416384
perplexity/sonar-small-online$ 0.00$0.2812,00012000
perplexity/sonar-medium-chat$0.6$1.816,38416384
perplexity/sonar-medium-online$ 0.00$1.812,00012000
fireworks_ai/accounts/fireworks/models/llama-v3p2-1b-instruct$0.1$0.116,38416384
fireworks_ai/accounts/fireworks/models/llama-v3p2-3b-instruct$0.1$0.116,38416384
fireworks_ai/accounts/fireworks/models/llama-v3p2-11b-vision-instruct$0.2$0.216,38416384
accounts/fireworks/models/llama-v3p2-90b-vision-instruct$0.9$0.916,38416384
fireworks_ai/accounts/fireworks/models/firefunction-v2$0.9$0.98,1928192
fireworks_ai/accounts/fireworks/models/mixtral-8x22b-instruct-hf$1.2$1.265,53665536
fireworks_ai/accounts/fireworks/models/qwen2-72b-instruct$0.9$0.932,76832768
fireworks_ai/accounts/fireworks/models/yi-large$ 3.00$ 3.0032,76832768
fireworks_ai/accounts/fireworks/models/deepseek-coder-v2-instruct$1.2$1.265,5368192
fireworks_ai/nomic-ai/nomic-embed-text-v1.5$0.008$ 0.008,192nan
fireworks_ai/nomic-ai/nomic-embed-text-v1$0.008$ 0.008,192nan
fireworks_ai/WhereIsAI/UAE-Large-V1$0.016$ 0.00512nan
fireworks_ai/thenlper/gte-large$0.016$ 0.00512nan
fireworks_ai/thenlper/gte-base$0.008$ 0.00512nan
fireworks-ai-up-to-16b$0.2$0.2nannan
fireworks-ai-16.1b-to-80b$0.9$0.9nannan
fireworks-ai-moe-up-to-56b$0.5$0.5nannan
fireworks-ai-56b-to-176b$1.2$1.2nannan
fireworks-ai-default$ 0.00$ 0.00nannan
fireworks-ai-embedding-up-to-150m$0.008$ 0.00nannan
fireworks-ai-embedding-150m-to-350m$0.016$ 0.00nannan
anyscale/mistralai/Mistral-7B-Instruct-v0.1$0.15$0.1516,38416384
anyscale/mistralai/Mixtral-8x7B-Instruct-v0.1$0.15$0.1516,38416384
anyscale/mistralai/Mixtral-8x22B-Instruct-v0.1$0.9$0.965,53665536
anyscale/HuggingFaceH4/zephyr-7b-beta$0.15$0.1516,38416384
anyscale/google/gemma-7b-it$0.15$0.158,1928192
anyscale/meta-llama/Llama-2-7b-chat-hf$0.15$0.154,0964096
anyscale/meta-llama/Llama-2-13b-chat-hf$0.25$0.254,0964096
anyscale/meta-llama/Llama-2-70b-chat-hf$ 1.00$ 1.004,0964096
anyscale/codellama/CodeLlama-34b-Instruct-hf$ 1.00$ 1.004,0964096
anyscale/codellama/CodeLlama-70b-Instruct-hf$ 1.00$ 1.004,0964096
anyscale/meta-llama/Meta-Llama-3-8B-Instruct$0.15$0.158,1928192
anyscale/meta-llama/Meta-Llama-3-70B-Instruct$ 1.00$ 1.008,1928192
cloudflare/@cf/meta/llama-2-7b-chat-fp16$1.923$1.9233,0723072
cloudflare/@cf/meta/llama-2-7b-chat-int8$1.923$1.9232,0482048
cloudflare/@cf/mistral/mistral-7b-instruct-v0.1$1.923$1.9238,1928192
cloudflare/@hf/thebloke/codellama-7b-instruct-awq$1.923$1.9234,0964096
voyage/voyage-01$0.1$ 0.004,096nan
voyage/voyage-lite-01$0.1$ 0.004,096nan
voyage/voyage-large-2$0.12$ 0.0016,000nan
voyage/voyage-law-2$0.12$ 0.0016,000nan
voyage/voyage-code-2$0.12$ 0.0016,000nan
voyage/voyage-2$0.1$ 0.004,000nan
voyage/voyage-lite-02-instruct$0.1$ 0.004,000nan
voyage/voyage-finance-2$0.12$ 0.004,000nan
databricks/databricks-meta-llama-3-1-405b-instruct$ 5.00$15.00002128,000128000
databricks/databricks-meta-llama-3-1-70b-instruct$1.00002$2.99999128,000128000
databricks/databricks-dbrx-instruct$0.74998$2.2490132,76832768
databricks/databricks-meta-llama-3-70b-instruct$1.00002$2.99999128,000128000
databricks/databricks-llama-2-70b-chat$0.50001$1.54,0964096
databricks/databricks-mixtral-8x7b-instruct$0.50001$0.999024,0964096
databricks/databricks-mpt-30b-instruct$0.99902$0.999028,1928192
databricks/databricks-mpt-7b-instruct$0.50001$ 0.008,1928192
databricks/databricks-bge-large-en$0.10003$ 0.00512nan
databricks/databricks-gte-large-en$0.12999$ 0.008,192nan
azure/gpt-4o-mini-2024-07-18$0.165$0.66128,00016384
amazon.titan-embed-image-v1$0.8$ 0.00128nan

Callback handlers

You may also calculate token costs in LLM wrapper/framework libraries using callbacks.

LlamaIndex
pip install `'tokencost[llama-index]'`

To use the base callback handler, you may import it:

from tokencost.callbacks.llama_index import TokenCostHandler

and pass to your framework callback handler.

Langchain

(Coming Soon)

Running locally

Installation via GitHub:
git clone git@github.com:AgentOps-AI/tokencost.git
cd tokencost
pip install -e .

Running tests

  1. Install pytest if you don't have it already
pip install pytest
  1. Run the tests/ folder while in the parent directory
pytest tests

This repo also supports tox, simply run python -m tox.

Contributing

Contributions to TokenCost are welcome! Feel free to create an issue for any bug reports, complaints, or feature suggestions.

License

TokenCost is released under the MIT License.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc