Set up your tool

Every tool below talks to the same key and balance. Pick yours, paste the lines, start coding.

Before you start

  • Your key: sign in on the API page and copy it. Export it as NERDLY_API_KEY or paste it where a tool asks.
  • OpenAI-compatible tools use https://api.nerdly.us/v1; Anthropic-compatible tools use https://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.

  1. Point Claude Code at Nerdly and pick the model, then start it in your project.

    shell
    1export ANTHROPIC_BASE_URL="https://api.nerdly.us"
    2export ANTHROPIC_AUTH_TOKEN="sk-nerd-…"
    3export ANTHROPIC_MODEL="deepseek-v4-flash-0731"
    4claude
  2. To keep it, put the same values in ~/.claude/settings.json.

    json
    1{
    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.

  1. Add Nerdly as a provider in ~/.codex/config.toml.

    toml
    1model = "deepseek-v4-flash-0731"
    2model_provider = "nerdly"
    3
    4[model_providers.nerdly]
    5name = "Nerdly"
    6base_url = "https://api.nerdly.us/v1"
    7env_key = "NERDLY_API_KEY"
    8wire_api = "responses"
  2. Export the key and run Codex in your project.

    shell
    1export 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.

  1. Open Cursor Settings, then Models. Under API Keys, paste your key in OpenAI API Key and turn on Override OpenAI Base URL.

    text
    1sk-nerd-…
    2https://api.nerdly.us/v1
  2. Add the model by its id and turn it on; pick it in the chat or agent panel.

    text
    1deepseek-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.

  1. In Cline’s settings choose the API provider OpenAI Compatible and fill in these three fields.

    text
    1Base URL https://api.nerdly.us/v1
    2API 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.

  1. Add Nerdly as a provider in opencode.json at the root of your project (or ~/.config/opencode/opencode.json).

    json
    1{
    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}
  2. Export the key, start OpenCode and pick the model with /models.

    shell
    1export 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.

  1. Aider speaks to any OpenAI-compatible endpoint; the openai/ prefix tells it which kind.

    shell
    1export 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.

  1. OpenAI format: POST /v1/chat/completions.

    shell
    1curl 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."}]}'
  2. Anthropic format: POST /v1/messages, with the key in x-api-key.

    shell
    1curl 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."}]}'
  3. Every model you can call, without a key: GET /v1/models.

    shell
    1curl 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.

  1. With the OpenAI SDK (pip install openai).

    python
    1import os
    2from openai import OpenAI
    3
    4client = 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)
  2. With the Anthropic SDK (pip install anthropic).

    python
    1import os
    2from anthropic import Anthropic
    3
    4client = 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.

  1. With the OpenAI SDK (npm install openai), as an ES module.

    javascript
    1import OpenAI from 'openai';
    2
    3const 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);
Join on TelegramHelp