Как подключить CheapLLM к JavaScript
Библиотека openai для Node.js. Пошаговая настройка CheapLLM API в JavaScript с доступом к Claude, GPT-6, Gemini и DeepSeek до 70% дешевле.
1. Создайте API-ключ CheapLLM
Создайте аккаунт CheapLLM и выпустите API-ключ — один ключ открывает доступ к 48+ моделям OpenAI, Anthropic, Google и DeepSeek до 70% дешевле официальных прайсов.
Base URL (OpenAI-совместимый)
https://api.cheapllm.com/v12. Установите пакет
Терминал
npm install openai3. Сделайте первый запрос
index.ts
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.cheapllm.com/v1",
apiKey: "sk-clm-8a4f9e2b4d1c7a609c21",
});
const res = await client.chat.completions.create({
model: "openai/gpt-6-astra",
messages: [{ role: "user", content: "Привет!" }],
});
console.log(res.choices[0].message.content);Лучшие модели для JavaScript
Все 48+ моделей →| Модель | Официально (вх / вых) | CheapLLM (вх / вых) | Экономия |
|---|---|---|---|
| Claude Opus 5.5 | $2.80 / $14.00 | −30% | |
| GPT-6.1 Sol | $1.40 / $7.00 | −30% | |
| Gemini 4 Argon | $1.40 / $7.00 | −30% | |
| DeepSeek V4 Pro 0813 | $0.078 / $3.11 | −30% |