Set it up
You need a Nerdly key (it starts with sk-nerd-): sign in on the API page to get one, and add credit in Billing.
- In the Python SDK, one call with the openai/ prefix on the model id.python1
import os2import litellm34response = litellm.completion(5model="openai/deepseek-v4-flash-0731",6api_base="https://api.nerdly.us/v1",7api_key=os.environ["NERDLY_API_KEY"],8messages=[{"role": "user", "content": "Write a Python function that checks if a string is a palindrome."}],9max_tokens=600,10)11print(response.choices[0].message.content) - For the proxy, list the model in config.yaml; os.environ/ reads a value from the environment and keeps the key out of the file.yaml1
model_list:2- model_name: deepseek-v4-flash-07313litellm_params:4model: openai/deepseek-v4-flash-07315api_base: "https://api.nerdly.us/v1"6api_key: os.environ/NERDLY_API_KEY78litellm_settings:9num_retries: 110request_timeout: 1201112general_settings:13master_key: os.environ/LITELLM_MASTER_KEY - Start the proxy; it listens on port 4000 and takes the master key from any OpenAI SDK.shell1
export NERDLY_API_KEY="sk-nerd-…"2export LITELLM_MASTER_KEY="sk-pick-your-own"3litellm --config config.yaml
The examples use deepseek-v4-flash-0731, the most used coding model on Nerdly today; put any id from the models page in its place.
Which model to pick
- Qwen4 35B A3B Uncensored (
qwen4-35b-a3b-uncensored): $0.48 in, $2.40 out per million tokens, 1M context, about 1.4¢ an agent step. - Ergo Uncensored (
ergo-uncensored): $4.40 in, $13.32 out per million tokens, 1M context, about $0.11 an agent step. - GLM-5.3 Abliterated (
glm-5.3-abliterated): $2.33 in, $4.66 out per million tokens, 131K context, about 5.6¢ an agent step. - DeepSeek V4 Flash 0731 (
deepseek-v4-flash-0731): $0.08 in, $0.12 out per million tokens, 1M context, about 0.19¢ an agent step. - DeepSeek V4.1 Flash 1017 (
deepseek-v4.1-flash-1017): $0.25 in, $1.20 out per million tokens, 1M context, about 0.74¢ an agent step. - Claude Opus 5.5 (
claude-opus-5-5): $2.80 in, $10 out per million tokens, 1M context, about 7.6¢ an agent step.
What a session costs
50 chat turns (about 2,000 tokens in and 500 out each) on DeepSeek V4 Flash 0731 cost about 1.1¢, paid from your balance. Every request LiteLLM sends is priced by its tokens at the model’s rate; a cheaper model costs less, a larger one more.
Things that trip people up
- The model needs the openai/ prefix so LiteLLM routes it as OpenAI-compatible; the id after it goes to the API as is.
- api_base ends in /v1; Not Found on every call usually means it does not.
- input_cost_per_token and output_cost_per_token under model_info are for LiteLLM’s spend tracking only and change nothing that is billed.
- context_window_fallbacks only work with enable_pre_call_checks: true under router_settings.
- Fallbacks between entries on the same key cannot fix a 401 or a 402: every entry answers the same.
LiteLLM’s own documentation: docs.litellm.ai/docs/providers/openai_compatible.
More guides
Questions.
Something else? Email hello@nerdly.us
Run LiteLLM on any model.
Get a key, add credit from $10, and point the tool at Nerdly.
Get a key