Inicio rápido
| Ajuste | Valor |
|---|---|
| URL base | https://cheapllm.shop/v1 |
| Clave de API | sk-cheap-... desde tu panel |
| Modelo | deepseek-v4.1-flash-1017 |
curl https://cheapllm.shop/v1/chat/completions \ -H "Authorization: Bearer $CHEAPLLM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-v4.1-flash-1017", "messages": [{"role": "user", "content": "Hello!"}] }'
En Windows, en PowerShell:
Invoke-RestMethod -Method Post -Uri "https://cheapllm.shop/v1/chat/completions" ` -Headers @{ Authorization = "Bearer $env:CHEAPLLM_API_KEY" } -ContentType "application/json" ` -Body '{"model": "deepseek-v4.1-flash-1017", "messages": [{"role": "user", "content": "Hello!"}]}'
Python
from openai import OpenAI client = OpenAI(base_url="https://cheapllm.shop/v1", api_key="sk-cheap-...") resp = client.chat.completions.create( model="deepseek-v4.1-flash-1017", messages=[{"role": "user", "content": "Hello!"}], ) print(resp.choices[0].message.content)
Node / TypeScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://cheapllm.shop/v1", apiKey: process.env.CHEAPLLM_API_KEY });
const resp = await client.chat.completions.create({
model: "deepseek-v4.1-flash-1017",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);Sin SDK, fetch simple
const r = await fetch("https://cheapllm.shop/v1/chat/completions", {
method: "POST",
headers: { "Authorization": `Bearer ${KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ model: "deepseek-v4.1-flash-1017", messages: [{ role: "user", content: "Hello!" }] }),
});
const data = await r.json();Claves
Envía tu clave como Authorization: Bearer sk-cheap-.... El encabezado x-api-key también funciona, para los clientes que lo usan.
- Crea hasta 25 claves en el panel, una por aplicación o compañero de equipo.
- Una clave se muestra una sola vez, cuando la creas. Solo almacenamos una huella.
- La revocación surte efecto en la siguiente solicitud.
- CORS está abierto, así que las aplicaciones de navegador pueden llamar a la API directamente. Pero no incluyas una clave dentro de una página web pública; cualquiera puede leerla.
Completaciones de chat
POST /v1/chat/completions acepta el mismo cuerpo que el endpoint de OpenAI. Los campos que más se usan:
| Campo | Notas |
|---|---|
model | deepseek-v4.1-flash-1017. Opcional, es el único. |
messages | Obligatorio. Roles system, user, assistant, tool. |
stream | true para eventos enviados por el servidor. Ver abajo. |
max_tokens | Límite superior para la respuesta, razonamiento incluido. |
temperature, top_p | Muestreo, como de costumbre. |
stop | Cadena o lista de cadenas. |
tools, tool_choice, response_format | Se pasa al modelo tal cual. |
Las respuestas llevan un objeto usage con prompt_tokens y completion_tokens, y un encabezado x-request-id que vale la pena citar si nos escribes.
Ventana de contexto: tokens.
Streaming
Con "stream": true obtienes text/event-stream: una línea data: {...} por fragmento y un data: [DONE] final. Añade "stream_options": {"include_usage": true} para obtener un último fragmento con recuentos de tokens.
stream = client.chat.completions.create(
model="deepseek-v4.1-flash-1017",
messages=[{"role": "user", "content": "Count to five, slowly."}],
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="", flush=True)
elif chunk.usage:
print("\n", chunk.usage)Cerrar la conexión detiene la generación, así que una solicitud cancelada deja de consumir tiempo.
Razonamiento
El modelo piensa antes de responder. El razonamiento llega por separado de la respuesta, así que nunca contamina tu salida:
| Dónde | Razonamiento | Respuesta |
|---|---|---|
| Streaming | delta.reasoning_content (también delta.reasoning) | delta.content |
| Sin streaming | message.reasoning_content | message.content |
completion_tokens y max_tokens. Si las respuestas se cortan, aumenta max_tokens.Modelos
GET /v1/models lista lo que hay en el menú. Hoy es un solo modelo:
{"object": "list", "data": [{"id": "deepseek-v4.1-flash-1017", "object": "model", "owned_by": "cheapllm"}]}
Model names containing deepseek are routed to it too, so tools with a hard-coded DeepSeek model name just work.
Limits
Free tier
During the beta every account is free, with no rate limit. When the beta ends, every account keeps a permanent free tier, with no card: at least 5,000 input tokens and 1,000 output tokens per hour (5,000 and 1,000 today), counted per account over a rolling hour, all keys together. These numbers can go up, never below that minimum. Past the free tier, usage is billed at $0.005 per million input tokens, $0.001 per million cached input tokens and $0.14 per million output tokens, with no rate limit. We'll email every account before the beta ends.
Rate and size limits
| Thing | Limit |
|---|---|
| Requests per minute | None |
| Tokens per minute | None |
| Parallel requests | None |
| Request body | 4 MB |
| Keys per account | 25 |
503. That's not a limit on you, it means the kitchen is full for a moment. Retry after the number of seconds in Retry-After; the official SDKs do this on their own.Errors
Errors come back as {"error": {"message", "type", "code"}}, like OpenAI's.
| Status | Meaning | What to do |
|---|---|---|
400 | Bad body, e.g. no messages | Read the message, fix the request |
401 | Missing, wrong or revoked key | Check the header, or make a new key |
404 | Unknown model or endpoint | Use deepseek-v4.1-flash-1017 |
413 | Body over 4 MB | Trim the prompt |
503 | Kitchen full, even after our retries | Retry after Retry-After seconds |
504 | Generation took too long | Lower max_tokens or stream |
Anthropic and Responses formats
Tools built for the Anthropic Messages API (Claude Code, the Anthropic SDKs) can use the same model. Point them at https://cheapllm.shop; they call POST /v1/messages. The key works as x-api-key or Authorization: Bearer. Any model name is accepted and routed to deepseek-v4.1-flash-1017.
curl https://cheapllm.shop/v1/messages \ -H "x-api-key: $CHEAPLLM_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{"model": "deepseek-v4.1-flash-1017", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello!"}]}'
Supported: text, images, system prompts, tool use and tool results, streaming events, stop sequences. Thinking blocks are not returned. POST /v1/messages/count_tokens returns an estimate.
Tools built for the OpenAI Responses API (Codex CLI, recent OpenAI SDK code) can call POST /v1/responses on https://cheapllm.shop/v1: text and image input, instructions, function and custom tools, streaming events. Stateless only (store and previous_response_id are not kept).
Can't find it here? : it has read these docs and knows the 40 integrations.
Your tools
Step-by-step settings for Claude Code, OpenCode, Codex CLI, DeepSeek Harness, Cline, Roo Code, Kilo Code, Continue, Copilot, Cursor, Zed and many more are on the integrations page. In short: anything with an "OpenAI-compatible" or "custom base URL" setting works with the base URL, your key and the model name above.
Environment variables
export OPENAI_BASE_URL=https://cheapllm.shop/v1 export OPENAI_API_BASE=https://cheapllm.shop/v1 # older libraries export OPENAI_API_KEY=sk-cheap-...
Windows (PowerShell; setx keeps them for new windows):
setx OPENAI_BASE_URL "https://cheapllm.shop/v1" setx OPENAI_API_BASE "https://cheapllm.shop/v1" setx OPENAI_API_KEY "sk-cheap-..."
Or let the installer pick, install and configure your tools (all 40 from the integrations page): curl -fsSL https://cheapllm.shop/setup.sh | sh on macOS and Linux, irm https://cheapllm.shop/setup.ps1 | iex in Windows PowerShell.
Open WebUI
Admin settings, Connections, OpenAI API: add a connection with the base URL and your key. The model appears in the picker.
LibreChat
endpoints:
custom:
- name: "cheapllm"
apiKey: "${CHEAPLLM_API_KEY}"
baseURL: "https://cheapllm.shop/v1"
models:
default: ["deepseek-v4.1-flash-1017"]
Continue (VS Code, JetBrains)
models:
- name: cheapllm
provider: openai
model: deepseek-v4.1-flash-1017
apiBase: https://cheapllm.shop/v1
apiKey: sk-cheap-...
Aider
aider --openai-api-base https://cheapllm.shop/v1 --openai-api-key sk-cheap-... \ --model openai/deepseek-v4.1-flash-1017
Cursor
Settings, Models: paste your key in the OpenAI API key field, turn on "Override OpenAI Base URL" with the base URL, then add the model name as a custom model.
LangChain
from langchain_openai import ChatOpenAI llm = ChatOpenAI(model="deepseek-v4.1-flash-1017", base_url="https://cheapllm.shop/v1", api_key="sk-cheap-...")
Vercel AI SDK
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
const cheapllm = createOpenAICompatible({ name: "cheapllm", baseURL: "https://cheapllm.shop/v1", apiKey: process.env.CHEAPLLM_API_KEY });
const model = cheapllm("deepseek-v4.1-flash-1017");
Stuck? Write to [email protected] with the x-request-id of the failing call.