From ed94410ef51fe9d2fcdb2dfcc1aa600622c72bb2 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Sat, 16 Sep 2023 12:59:08 -0700 Subject: [PATCH] docs --- docs/my-website/docs/max_tokens_cost.md | 39 +++++++++++-------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/docs/my-website/docs/max_tokens_cost.md b/docs/my-website/docs/max_tokens_cost.md index b5eaefada8..b0f2e54a80 100644 --- a/docs/my-website/docs/max_tokens_cost.md +++ b/docs/my-website/docs/max_tokens_cost.md @@ -4,30 +4,25 @@ For every LLM LiteLLM allows you to: * Get model context window * Get cost per token +## LiteLLM API api.litellm.ai +Usage +```curl +curl 'https://api.litellm.ai/get_max_tokens?model=claude-2' +``` + +### Output +```json +{ + "input_cost_per_token": 1.102e-05, + "max_tokens": 100000, + "model": "claude-2", + "output_cost_per_token": 3.268e-05 +} +``` + ## LiteLLM Package Usage ```python import litellm model_data = litellm.model_cost["gpt-4"] -``` - -## LiteLLM API api.litellm.ai -Usage -```python -import requests - -url = "https://api.litellm.ai/get_max_tokens?model=claude-2" - -response = requests.request("GET", url) - -print(response.text) -``` - -```curl -curl 'https://api.litellm.ai/get_max_tokens?model=gpt-3.5-turbo' -``` - -```curl -curl 'https://api.litellm.ai/get_max_tokens?model=claude-2' -``` - +``` \ No newline at end of file