Inicio rápidoQuickstart
- En aidepsv.com › Ajustes › API se crea una clave. Se muestra una sola vez: debe guardarse en el servidor propio (por ejemplo, en una variable de entorno
DEP_API_KEY). - La API está incluida desde el plan Individual. Usa los créditos de la cuenta.
- Si la cuenta nunca usó DEP, se debe autorizar una vez el envío a proveedores de IA en Ajustes › Privacidad (la API respeta ese permiso).
- Primera llamada:
- Go to aidepsv.com › Settings › API and create a key. It is shown only once: store it on your server (for example in a
DEP_API_KEYenvironment variable). - The API is included from the Individual plan. It uses your account credits.
- If you never used DEP, authorize sending to AI providers once in Settings › Privacy (the API honors that permission).
- Make your first call:
curl https://xjqyajqpaohmchigrikc.supabase.co/functions/v1/dep-api/v1/chat \
-H "Authorization: Bearer $DEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"¿Qué es un fideicomiso?"}],"nivel":"lite"}'
AutenticaciónAuthentication
La clave se envía en la cabecera Authorization: Bearer dep_live_… (o en x-api-key). Nunca en la URL: si aparece en la dirección, la API responde 400 clave_en_url sin procesar nada, y se recomienda revocarla.
Send the key in the Authorization: Bearer dep_live_… header (or in x-api-key). Never in the URL: if it appears in the address, the API answers 400 clave_en_url without processing anything, and you should revoke it.
| Permiso | Scope | Qué habilita | What it allows |
|---|---|---|---|
| chat | POST /v1/chatPOST /v1/chat | ||
| apps | POST /v1/apps/{app}/jobs | ||
| jobs:read | GET /v1/jobs/{id} |
- Cada clave se guarda solo como un hash con pepper: DEP no puede volver a mostrártela.
- Revocar una clave en Ajustes › API la desactiva al instante. Se registra su último uso.
- La API es de servidor a servidor: no tiene CORS. No se debe incluir la clave en una página web ni en una app que se distribuya.
- Por API no hay funciones de administración, ni memoria, ni perfil: cada llamada es independiente y solo ve tus propios datos.
- Each key is stored only as a peppered hash: DEP can’t show it to you again.
- Revoking a key in Settings › API disables it immediately. Its last use is recorded.
- The API is server to server: it has no CORS. Don’t put the key in a web page or in an app you distribute.
- The API has no admin functions, memory or profile: every call is independent and only sees your own data.
POST/v1/chat
Mensajes en el formato de OpenAI/Anthropic. Cobra exactamente lo mismo que el chat de la app según el nivel, después de responder. Si el pedido falla o se corta, no se cobra.
Messages in the OpenAI/Anthropic format. It charges exactly the same as the app’s chat for each level, after answering. If the request fails or is cut off, nothing is charged.
| Campo | Field | Descripción | Description |
|---|---|---|---|
| messages | Lista de {role, content} con role = user, assistant o system. El último tiene que ser del usuario (hasta 3.000 caracteres). DEP usa los últimos 12 como contexto (2.500 caracteres cada uno). Los system se suman como instrucciones (hasta 2.000).List of {role, content} with role = user, assistant or system. The last one must be from the user (up to 3,000 characters). DEP uses the last 12 as context (2,500 characters each). system messages are added as instructions (up to 2,000). | ||
| nivel | lite, medio, alto, plus, ultra, quantum o auto (por defecto). Si tu saldo no alcanza el mínimo del nivel elegido: 402, sin cobrar.lite, medio, alto, plus, ultra, quantum or auto (default). If your balance is below the chosen level’s minimum: 402, nothing charged. | ||
| stream | true para recibir eventos SSE (recomendado en Alto y superiores, que pueden tardar varios minutos).true to receive SSE events (recommended for Alto and above, which can take several minutes). | ||
| idioma | es, en, pt, fr, it o de (por defecto, es).es, en, pt, fr, it or de (default es). |
curl https://xjqyajqpaohmchigrikc.supabase.co/functions/v1/dep-api/v1/chat \
-H "Authorization: Bearer $DEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"nivel": "medio",
"messages": [
{"role": "system", "content": "Respondé como un asesor contable."},
{"role": "user", "content": "¿Cuánto es el IVA en El Salvador?"}
]
}'
const r = await fetch("https://xjqyajqpaohmchigrikc.supabase.co/functions/v1/dep-api/v1/chat", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.DEP_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ nivel: "medio", messages: [{ role: "user", content: "¿Cuánto es el IVA en El Salvador?" }] }),
});
const j = await r.json();
if (!r.ok) throw new Error(`${r.status} ${j.error.codigo}: ${j.error.mensaje}`);
console.log(j.mensaje.content, `(${j.creditos} cr)`);
import os, requests
r = requests.post(
"https://xjqyajqpaohmchigrikc.supabase.co/functions/v1/dep-api/v1/chat",
headers={"Authorization": f"Bearer {os.environ['DEP_API_KEY']}"},
json={"nivel": "medio", "messages": [{"role": "user", "content": "¿Cuánto es el IVA en El Salvador?"}]},
timeout=420,
)
j = r.json()
if not r.ok:
raise RuntimeError(f"{r.status_code} {j['error']['codigo']}: {j['error']['mensaje']}")
print(j["mensaje"]["content"], f"({j['creditos']} cr)")
Respuesta
Response
{
"id": "chat_9eb14db1c2cd4d778b8b",
"objeto": "chat.respuesta",
"creado": 1791526600,
"nivel": "medio",
"modelo": "Sonnet",
"modo": "elegido",
"mensaje": { "role": "assistant", "content": "…" },
"choices": [{ "index": 0, "message": { "role": "assistant", "content": "…" }, "finish_reason": "stop" }],
"creditos": 1,
"con_busqueda_web": false,
"desde_cache": false,
"verificado": false
}
choices repite la respuesta en el formato de OpenAI para que puedas usar clientes existentes. Si la respuesta tarda más de 100 s sin stream, DEP empieza a responder (200) con espacios para mantener la conexión y el JSON llega al final; si hubo un error en ese caso, el JSON trae error y estado_http. Las preguntas de clima se responden con datos de MET Norway ("nivel": "clima", 1 crédito).
choices repeats the answer in OpenAI’s format so you can use existing clients. If the answer takes longer than 100 s without stream, DEP starts the response (200) with whitespace to keep the connection alive and the JSON arrives at the end; if an error happened in that case, the JSON has error and estado_http. Weather questions are answered with MET Norway data ("nivel": "clima", 1 credit).
Stream (SSE)
Stream (SSE)
Con "stream": true llegan los eventos inicio, comentarios : latido cada 10 s mientras el nivel trabaja, el texto en eventos delta cuando está listo (no token a token), y fin con los créditos. Termina con data: [DONE]. Un fallo llega como evento error.
With "stream": true you get an inicio event, : latido comments every 10 s while the level works, the text in delta events once it is ready (not token by token), and fin with the credits. It ends with data: [DONE]. A failure arrives as an error event.
event: inicio
data: {"id":"chat_…","objeto":"chat.inicio","creado":1791526600,"nivel":"alto"}
: latido
event: delta
data: {"texto":"Un fideicomiso es un contrato en el que…"}
event: fin
data: {"id":"chat_…","objeto":"chat.fin","nivel":"alto","modelo":"Sonnet","creditos":7,…}
data: [DONE]
POST/v1/apps/{app}/jobs
Encola un pedido a una app (la lista y sus precios están en GET /v1/apps). Los créditos se reservan cuando la app empieza, se cobran al terminar y se devuelven si falla. Responde 202 con el id del pedido.
Queues a job for an app (the list and prices are in GET /v1/apps). Credits are reserved when the app starts, charged when it finishes and refunded if it fails. It answers 202 with the job id.
| Campo | Field | Descripción | Description |
|---|---|---|---|
| prompt | Lo que debe hacer la app (hasta 4.000 caracteres).What you want the app to do (up to 4,000 characters). | ||
| callback_url | Opcional. HTTPS a un dominio público: DEP te avisa cuando termina (ver Webhooks).Optional. HTTPS to a public domain: DEP notifies you when it finishes (see Webhooks). | ||
| iterar_de | Opcional. Id de un pedido tuyo anterior para ajustarlo («hacelo más azul»).Optional. Id of a previous job of yours to adjust it (“make it bluer”). | ||
| sin_cadena | Opcional. true evita que DEP encadene otra app (por ejemplo, Blender → Higgsfield en un render realista).Optional. true prevents DEP from chaining another app (for example, Blender → Higgsfield for a realistic render). |
curl https://xjqyajqpaohmchigrikc.supabase.co/functions/v1/dep-api/v1/apps/perplexity/jobs \
-H "Authorization: Bearer $DEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"Comparativa de tasas de depósitos a plazo en bancos de El Salvador","callback_url":"https://tu-servidor.com/dep/webhook"}'
# Respuesta 202
# {"id":"8b0fa32f-…","objeto":"job","app":"perplexity","estado":"pendiente",
# "creditos":{"estimados":8,"variable":true,"se_cobran":"al terminar; si falla, no se cobra"},
# "modo":"comparativa","tiempo_estimado_s":30,"enlaces":{"estado":"/v1/jobs/8b0fa32f-…"}}
const BASE = "https://xjqyajqpaohmchigrikc.supabase.co/functions/v1/dep-api/v1";
const H = { Authorization: `Bearer ${process.env.DEP_API_KEY}`, "Content-Type": "application/json" };
const r = await fetch(`${BASE}/apps/excel/jobs`, { method: "POST", headers: H,
body: JSON.stringify({ prompt: "Presupuesto mensual de una cafetería con fórmulas y un gráfico" }) });
const job = await r.json();
if (r.status !== 202) throw new Error(job.error.mensaje);
// Se consulta el estado cada 10 s (o se usa callback_url).
let estado;
do {
await new Promise((ok) => setTimeout(ok, 10000));
estado = await (await fetch(`${BASE}/jobs/${job.id}`, { headers: H })).json();
} while (estado.estado === "pendiente" || estado.estado === "en_proceso");
console.log(estado.estado, estado.resultado?.archivos);
import os, time, requests
BASE = "https://xjqyajqpaohmchigrikc.supabase.co/functions/v1/dep-api/v1"
H = {"Authorization": f"Bearer {os.environ['DEP_API_KEY']}"}
r = requests.post(f"{BASE}/apps/excel/jobs", headers=H,
json={"prompt": "Presupuesto mensual de una cafetería con fórmulas y un gráfico"}, timeout=60)
job = r.json()
if r.status_code != 202:
raise RuntimeError(job["error"]["mensaje"])
while True:
time.sleep(10)
estado = requests.get(f"{BASE}/jobs/{job['id']}", headers=H, timeout=30).json()
if estado["estado"] not in ("pendiente", "en_proceso"):
break
print(estado["estado"], (estado.get("resultado") or {}).get("archivos"))
Mismos límites que la app: 2 entregas en paralelo (las siguientes entran en cola automáticamente) y un tope de pedidos por hora según tu plan. Algunas apps necesitan un archivo adjunto (por ejemplo, el Predictor de viralidad): por API todavía no se aceptan adjuntos y responden 422 falta_adjunto.
Same limits as the app: 2 deliveries in parallel (additional ones are queued automatically) and a per-hour cap depending on your plan. Some apps need an attachment (for example, the Virality predictor): the API doesn’t accept attachments yet and answers 422 falta_adjunto.
GET/v1/jobs/{id}
Estado y resultado de un pedido tuyo (también los que hiciste en la app). Un id de otra cuenta responde 404, igual que uno que no existe. estado: pendiente, en_proceso, terminado o error.
Status and result of one of your jobs (including those you made in the app). An id from another account answers 404, same as one that doesn’t exist. estado: pendiente, en_proceso, terminado or error.
{
"id": "8b0fa32f-a951-4c6e-88c0-b311d2bedbb3",
"objeto": "job",
"app": "blender",
"estado": "terminado",
"prompt": "Una silla de madera nórdica",
"resultado": {
"texto": "…",
"archivos": [
{ "rol": "principal", "nombre": "silla.blend", "url": "https://…", "vence": "2026-10-16T06:16:50.000Z", "vencido": false },
{ "rol": "vista", "nombre": "silla.png", "url": "https://…", "vence": "2026-10-16T06:16:50.000Z", "vencido": false }
]
},
"error": null,
"creditos": { "reservados": 150, "cobrados": 150, "estado": "cobrado" },
"cadena": null
}
Los enlaces de descarga son firmados y vencen a la hora (vence). Para obtener uno nuevo, se vuelve a pedir GET /v1/jobs/{id}. Los archivos se pueden pedir durante 7 días desde que DEP los generó: se recomienda descargarlos y guardarlos en el sistema propio antes de ese plazo.
Download links are signed and expire after one hour (vence). Call GET /v1/jobs/{id} again for a fresh one. Files stay available for 7 days after DEP created them: download and store them on your side before that.
GET/v1/apps
Catálogo con el precio en créditos de cada app (y sus modos) y de cada nivel del chat. Los precios salen del mismo lugar que usa la app: lo que ves acá es lo que se cobra.
Catalog with the credit price of every app (and its modes) and of every chat level. Prices come from the same place the app uses: what you see here is what is charged.
curl https://xjqyajqpaohmchigrikc.supabase.co/functions/v1/dep-api/v1/apps -H "Authorization: Bearer $DEP_API_KEY"
GET/v1/usage
Tu saldo actual y el consumo por API (por defecto, últimos 30 días; ?dias=7 hasta 365): solicitudes, errores, créditos del chat y de las apps, por ruta y por día, y tus límites por minuto.
Your current balance and API usage (last 30 days by default; ?dias=7 up to 365): requests, errors, chat and app credits, by route and by day, and your per-minute limits.
{
"objeto": "uso", "plan": "individual",
"saldo": { "total": 895, "plan": 0, "comprados": 895, "diarios": 0 },
"api": { "dias": 30, "solicitudes": 138, "errores": 3, "creditos_chat": 1, "creditos_apps": 5, "jobs": 1, "por_ruta": { "chat": 4, "apps": 121, "job_nuevo": 1, "job": 13 }, "por_dia": [ … ] },
"limites_por_minuto": { "chat": 60, "jobs": 5, "lectura": 120, "claves": 3 }
}
Webhooks
Si mandás callback_url, cuando el pedido termina (bien o con error) DEP hace un POST con el mismo JSON de GET /v1/jobs/{id} dentro de {"tipo":"job.terminado","job":…}. Respondé con un código 2xx en menos de 10 s. Si falla, DEP reintenta a los 1, 5, 15, 60 y 180 minutos (6 intentos como máximo, durante 3 días). No se siguen redirecciones.
If you send callback_url, when the job finishes (successfully or with an error) DEP makes a POST with the same JSON as GET /v1/jobs/{id} inside {"tipo":"job.terminado","job":…}. Answer with a 2xx code within 10 s. If it fails, DEP retries after 1, 5, 15, 60 and 180 minutes (6 attempts at most, for 3 days). Redirects are not followed.
Cada aviso trae la cabecera DEP-Firma: t=<unix>,v1=<hex>: un HMAC-SHA256 de t + "." + cuerpo con el secreto de webhooks de tu clave (lo ves al crearla o en Ajustes › API). Debe verificarse siempre y rechazá firmas de más de 5 minutos.
Each notification has the DEP-Firma: t=<unix>,v1=<hex> header: an HMAC-SHA256 of t + "." + body with your key’s webhook secret (shown when you create it or in Settings › API). Always verify it and reject signatures older than 5 minutes.
import crypto from "node:crypto";
// cuerpo = el texto crudo del POST (antes de JSON.parse)
function firmaValida(cuerpo, cabecera, secreto) {
const { t, v1 } = Object.fromEntries(cabecera.split(",").map((p) => p.split("=")));
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
const esperada = crypto.createHmac("sha256", secreto).update(`${t}.${cuerpo}`).digest("hex");
return v1.length === esperada.length && crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(esperada));
}
import hmac, hashlib, time
def firma_valida(cuerpo: bytes, cabecera: str, secreto: str) -> bool:
partes = dict(p.split("=", 1) for p in cabecera.split(","))
if abs(time.time() - int(partes["t"])) > 300:
return False
esperada = hmac.new(secreto.encode(), f"{partes['t']}.".encode() + cuerpo, hashlib.sha256).hexdigest()
return hmac.compare_digest(esperada, partes["v1"])
Niveles y preciosLevels and prices
1 crédito = US$0,01. Los precios se leen en vivo de DEP. Lite y Medio cobran un precio fijo (más si DEP busca en la web); de Alto en adelante se cobra el costo real × 2,5 dentro del rango, y el saldo mínimo es lo que hace falta para empezar.
1 credit = US$0.01. Prices are read live from DEP. Lite and Medio charge a fixed price (more if DEP searches the web); from Alto up the real cost × 2.5 is charged within the range, and the minimum balance is what is needed to start.
Chat
Chat
| Nivel | Level | Créditos | Credits | Saldo mínimo | Minimum balance |
|---|---|---|---|---|---|
| Cargando precios…Loading prices… | |||||
Apps
| App | Créditos | Credits | Modos | Modes |
|---|---|---|---|---|
| Cargando precios…Loading prices… | ||||
LímitesLimits
| Qué | What | Individual | Avanzado | Business |
|---|---|---|---|---|
| Chat por minuto (por clave)Chat per minute (per key) | 60 | 60 | 60 | |
| Chat por minuto (toda la cuenta)Chat per minute (whole account) | 60 | 120 | 240 | |
| Pedidos a apps por minutoApp jobs per minute | 5 | 10 | 20 | |
| Consultas por minuto (por clave)Reads per minute (per key) | 120 | 120 | 120 | |
| Claves activasActive keys | 3 | 10 | 25 |
- Al pasar un límite:
429conRetry-After. Cada respuesta traex-ratelimit-limit,x-ratelimit-remainingyx-ratelimit-reset. - Cuerpo: hasta 64 KB en el chat y 16 KB en los pedidos a apps.
- Además rigen los límites de la app: 2 entregas en paralelo, con cola automática para las siguientes, y un tope por hora según el plan.
- El plan Free no incluye la API.
- When you exceed a limit:
429withRetry-After. Every response hasx-ratelimit-limit,x-ratelimit-remainingandx-ratelimit-reset. - Body: up to 64 KB for chat and 16 KB for app jobs.
- The app’s limits also apply: 2 deliveries in parallel, with automatic queuing for additional ones, and an hourly cap depending on the plan.
- The Free plan doesn’t include the API.
ErroresErrors
Todos los errores tienen la misma forma. Se recomienda guardar id_solicitud para pedir ayuda: con ese dato se encuentra la llamada (los registros no guardan el contenido de los mensajes).
Every error has the same shape. Keep id_solicitud if you need help: with it we can find your call (logs don’t store the content of your messages).
{ "error": { "tipo": "creditos", "codigo": "creditos_insuficientes", "mensaje": "…", "saldo": 3, "requeridos": 50 }, "id_solicitud": "req_…" }
| HTTP | Códigos | Codes | Qué significa | Meaning |
|---|---|---|---|---|
| 400 | json_invalido faltan_mensajes nivel_invalido mensaje_largo clave_en_url callback_invalido | La solicitud tiene un problema.The request has a problem. | ||
| 401 | falta_clave clave_invalida clave_revocada | Clave ausente, incorrecta o revocada.Missing, wrong or revoked key. | ||
| 402 | creditos_insuficientes | No alcanza el saldo. No se cobró nada.Not enough balance. Nothing was charged. | ||
| 403 | plan_requerido sin_permiso consentimiento_requerido plan | Tu plan, el permiso de la clave o falta autorizar el envío a proveedores de IA.Your plan, the key’s scope, or the AI-provider authorization is missing. | ||
| 404 | job_no_encontrado app_no_encontrada ruta_no_encontrada | No existe (o no es tuyo).Doesn’t exist (or isn’t yours). | ||
| 405 · 413 · 415 | metodo_no_permitido cuerpo_grande formato | Método, tamaño o formato del cuerpo.Method, body size or body format. | ||
| 422 | app_no_puede falta_adjunto no_es_un_trabajo | La app elegida no hace eso (te sugiere cuál sí) o necesita un archivo.The chosen app can’t do that (it suggests one that can) or needs a file. | ||
| 429 | limite | Pasaste un límite. Esperá lo que dice Retry-After.You exceeded a limit. Wait for Retry-After. | ||
| 5xx | alta_demanda no_disponible error_modelo tiempo_agotado | Problema temporal. No se cobró nada: reintentá con espera creciente.Temporary problem. Nothing was charged: retry with increasing backoff. |
Términos de usoTerms of use
- Usar la API implica aceptar los Términos y Condiciones y la Política de Privacidad de DEP. Los Términos específicos de la API se publican próximamente.
- Es responsabilidad del titular de la clave su uso y su custodia.
- No se puede revender ni ofrecer el acceso a DEP como servicio propio de IA sin un acuerdo por escrito con Next Era Intelligence Corporation, S.A.S., titular de DEP.
- Prohibido usarla para contenido ilegal, para eludir límites o pagos, para probar o atacar la seguridad del servicio o para extraer modelos o datos de forma masiva.
- Los resultados de IA pueden tener errores y no son asesoría profesional.
- Using the API means accepting DEP’s Terms and Conditions and Privacy Policy. The API-specific Terms will be published soon.
- You are responsible for what is done with your keys and for keeping them safe.
- You may not resell or offer access to DEP as your own AI service without a written agreement with Next Era Intelligence Corporation, S.A.S., owner of DEP.
- It is forbidden to use it for illegal content, to bypass limits or payments, to test or attack the service’s security, or to extract models or data in bulk.
- AI results can contain errors and are not professional advice.