Before you start
- Your key: sign in on the API page and copy it. Export it as
NERDLY_API_KEYor paste it where a tool asks. - OpenAI-compatible tools use
https://api.nerdly.us/v1; Anthropic-compatible tools usehttps://api.nerdly.us. - The examples use
deepseek-v4-flash-0731, DeepSeek V4 Flash 0731, the most used coding model today. Any id on the models page works in its place.
Claude Code · Codex CLI · Cursor · Cline · OpenCode · Aider · curl · Python · Node · More tools: Open WebUI, LiteLLM, Continue, Roo Code and others
Claude Code
The full guide, with the models to pick, what a session costs and the common errors: Claude Code with every AI model.
Point Claude Code at Nerdly and pick the model, then start it in your project.
shell1export ANTHROPIC_BASE_URL="https://api.nerdly.us"2export ANTHROPIC_AUTH_TOKEN="sk-nerd-…"3export ANTHROPIC_MODEL="deepseek-v4-flash-0731"4claudeTo keep it, put the same values in ~/.claude/settings.json.
json1{2"env": {3"ANTHROPIC_BASE_URL": "https://api.nerdly.us",4"ANTHROPIC_AUTH_TOKEN": "sk-nerd-…",5"ANTHROPIC_MODEL": "deepseek-v4-flash-0731"6}7}
Codex CLI
The full guide, with the models to pick, what a session costs and the common errors: Codex CLI with every AI model.
Add Nerdly as a provider in ~/.codex/config.toml.
toml1model = "deepseek-v4-flash-0731"2model_provider = "nerdly"34[model_providers.nerdly]5name = "Nerdly"6base_url = "https://api.nerdly.us/v1"7env_key = "NERDLY_API_KEY"8wire_api = "responses"Export the key and run Codex in your project.
shell1export NERDLY_API_KEY="sk-nerd-…"2codex
Cursor
The full guide, with the models to pick, what a session costs and the common errors: Cursor with every AI model.
Open Cursor Settings, then Models. Under API Keys, paste your key in OpenAI API Key and turn on Override OpenAI Base URL.
text1sk-nerd-…2https://api.nerdly.us/v1Add the model by its id and turn it on; pick it in the chat or agent panel.
text1deepseek-v4-flash-0731
Cline
The full guide, with the models to pick, what a session costs and the common errors: Cline with every AI model.
In Cline’s settings choose the API provider OpenAI Compatible and fill in these three fields.
text1Base URL https://api.nerdly.us/v12API Key sk-nerd-…3Model ID deepseek-v4-flash-0731
OpenCode
The full guide, with the models to pick, what a session costs and the common errors: OpenCode with every AI model.
Add Nerdly as a provider in opencode.json at the root of your project (or ~/.config/opencode/opencode.json).
json1{2"$schema": "https://opencode.ai/config.json",3"provider": {4"nerdly": {5"npm": "@ai-sdk/openai-compatible",6"name": "Nerdly",7"options": {8"baseURL": "https://api.nerdly.us/v1",9"apiKey": "{env:NERDLY_API_KEY}"10},11"models": {12"deepseek-v4-flash-0731": {}13}14}15},16"model": "nerdly/deepseek-v4-flash-0731"17}Export the key, start OpenCode and pick the model with /models.
shell1export NERDLY_API_KEY="sk-nerd-…"2opencode
Aider
The full guide, with the models to pick, what a session costs and the common errors: Aider with every AI model.
Aider speaks to any OpenAI-compatible endpoint; the openai/ prefix tells it which kind.
shell1export OPENAI_API_BASE="https://api.nerdly.us/v1"2export OPENAI_API_KEY="sk-nerd-…"3aider --model openai/deepseek-v4-flash-0731
curl
The full guide, with the models to pick, what a session costs and the common errors: curl with every AI model.
OpenAI format: POST /v1/chat/completions.
shell1curl https://api.nerdly.us/v1/chat/completions \2-H "Authorization: Bearer $NERDLY_API_KEY" \3-H "content-type: application/json" \4-d '{"model": "deepseek-v4-flash-0731", "messages": [{"role": "user", "content": "Write a regex for ISO 8601 dates."}]}'Anthropic format: POST /v1/messages, with the key in x-api-key.
shell1curl https://api.nerdly.us/v1/messages \2-H "x-api-key: $NERDLY_API_KEY" \3-H "anthropic-version: 2023-06-01" \4-H "content-type: application/json" \5-d '{"model": "deepseek-v4-flash-0731", "max_tokens": 1024, "messages": [{"role": "user", "content": "Write a regex for ISO 8601 dates."}]}'Every model you can call, without a key: GET /v1/models.
shell1curl https://api.nerdly.us/v1/models
Python
The full guide, with the models to pick, what a session costs and the common errors: Python with every AI model.
With the OpenAI SDK (pip install openai).
python1import os2from openai import OpenAI34client = OpenAI(base_url="https://api.nerdly.us/v1", api_key=os.environ["NERDLY_API_KEY"])5reply = client.chat.completions.create(model="deepseek-v4-flash-0731", messages=[{"role": "user", "content": "Explain this stack trace."}])6print(reply.choices[0].message.content)With the Anthropic SDK (pip install anthropic).
python1import os2from anthropic import Anthropic34client = Anthropic(base_url="https://api.nerdly.us", api_key=os.environ["NERDLY_API_KEY"])5msg = client.messages.create(model="deepseek-v4-flash-0731", max_tokens=1024, messages=[{"role": "user", "content": "Explain this stack trace."}])6print(msg.content[0].text)
Node
The full guide, with the models to pick, what a session costs and the common errors: Node with every AI model.
With the OpenAI SDK (npm install openai), as an ES module.
javascript1import OpenAI from 'openai';23const client = new OpenAI({ baseURL: 'https://api.nerdly.us/v1', apiKey: process.env.NERDLY_API_KEY });4const reply = await client.chat.completions.create({ model: 'deepseek-v4-flash-0731', messages: [{ role: 'user', content: 'Explain this stack trace.' }] });5console.log(reply.choices[0].message.content);