Documentación
Todo lo que necesitas para usar koigrid — a mano o con un agente de IA.
Primeros pasos
koigrid es cloud gestionado API-first. Crea una cuenta, genera una API key y gestiónalo todo desde tu terminal o tu agente de IA.
- Crea una cuenta — Google o email.
- Crea una API key en el dashboard.
- Llama a la API REST, o pega el prompt del agente en Claude Code.
Autenticación
Cada endpoint /api/v1 se autentica con un Bearer token. Crea uno en Dashboard → API keys (se muestra una vez).
curl https://koigrid.com/api/v1/me \ -H "Authorization: Bearer koi_YOUR_KEY"
Mint scoped tokens by API (agent-native)
An agent can mint short-lived, scope-limited tokens by API — no dashboard needed. A token can never create another with more scopes than itself (no privilege escalation).
# mint a token that can only read apps + trigger deploys, expiring in 1h
curl -X POST https://koigrid.com/api/v1/tokens -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"ci deploy","scopes":["apps:read","apps:deploy"],"expiresInSeconds":3600}'
# → { "token": { "id":"…", "token":"koi_…" } } (the secret is shown ONCE)
# list + revoke
curl https://koigrid.com/api/v1/tokens -H "Authorization: Bearer koi_YOUR_KEY"
curl -X DELETE https://koigrid.com/api/v1/tokens/<id> -H "Authorization: Bearer koi_YOUR_KEY"
# CLI: koigrid tokens create "ci deploy" --scopes apps:read,apps:deploy --expires 3600Forma de la respuesta
Las respuestas de éxito ENVUELVEN el recurso bajo su clave de tipo — no son planas. Un recurso llega como {"bucket":{…}}, {"database":{…}}, {"credential":{…}}, {"connection":{…}}; las colecciones como {"buckets":[…]}. Lee resp.credential.accessKey y resp.connection.uri — no resp.accessKey. Los errores son {"error","detail"}. Consejo: el CLI te desenvuelve todo esto.
Proyectos
Un proyecto agrupa recursos relacionados (una app + su base de datos + caché + bucket + crons) dentro de tu organización — como los proyectos de Vercel o de Google Cloud. La org es el límite de facturación + equipo; el proyecto es el ámbito de trabajo. Cada cuenta tiene un proyecto Default; cambia o crea proyectos desde el selector arriba en el dashboard. Crea un recurso dentro de un proyecto pasando projectId (por defecto: tu proyecto Default).
# create a project and put resources in it
koigrid projects create prod
curl https://koigrid.com/api/v1/apps -H "Authorization: Bearer koi_YOUR_KEY" \
-d '{"name":"web","projectId":"<project-id>"}'Interfaz de línea de comandos (CLI)
Despliega y gestiona todo desde tu terminal, tu CI/CD o tu agente de IA. El CLI es un cliente fino sobre la misma API — instálalo con npm:
npm i -g koigrid koigrid login koigrid apps deploy web --image nginx:alpine --port 80 koigrid db create prod --replicas 1 koigrid apps ls --json # machine-readable, for scripts or AI agents
Cada comando acepta --json (salida legible por máquina) y --token / KOIGRID_TOKEN (auth no interactiva). Un agente de IA (Claude Code, Cursor) puede ejecutar los comandos koigrid directamente — corre `koigrid help --json` para introspeccionar todos los comandos.
Apps (deploy por API)
Despliega un contenedor o un repo git y obtén una URL HTTPS en vivo — la alternativa a Lambda/Railway. Deploys sin downtime, dominios propios, env vars (cifradas), rollback, logs. Crea la app y luego dispara un deployment.
Crear una app
curl -X POST https://koigrid.com/api/v1/apps \
-H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"my-app"}'Desplegar desde un repo git (o una imagen)
curl -X POST https://koigrid.com/api/v1/apps/:id/deployments \
-H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"sourceType":"git","repo":"https://github.com/you/app"}'
# → queued → live at https://<slug>.apps.koigrid.com (Dockerfile or nixpacks)
# Local code (private, no git/Docker needed): koigrid apps deploy myapp --dir ./
# Private git repo: koigrid apps deploy myapp --repo <url> --repo-token <token>¿Despliegas Next.js? Pon output:"standalone" en next.config y añade un Dockerfile — koigrid lo construye en sandbox. Nixpacks vale para apps simples sin Dockerfile. Nota: deploy --dir excluye .git, así que si tu script "prepare" del package.json corre husky/git, pon HUSKY=0 (o protégelo) para que el install no falle.
Poner env vars (cifradas, inyectadas al redeploy)
curl -X POST https://koigrid.com/api/v1/apps/:id/env \
-H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"DATABASE_URL":"postgres://...","API_KEY":"..."}'Dimensionar (RAM/CPU por app, hasta el máx del plan)
curl -X PUT https://koigrid.com/api/v1/apps/:id/resources \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"memoryMb":2048,"cpus":1}' # RAM/CPU per app, up to your plan max
# CLI: koigrid apps resize <id> --memory 2048 --cpus 1Bases de datos (Postgres gestionado, HA)
Postgres de producción con failover automático, pooling PgBouncer y backups PITR — la alternativa a RDS. Crea un cluster, obtén una connection string TLS, respalda on-demand o restaura a un punto en el tiempo.
Crear una base de datos (HA = líder + réplica en planes de pago)
curl -X POST https://koigrid.com/api/v1/databases \
-H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"prod","version":"16","replicas":1}'Obtener la connection string — uri (escrituras → líder) y, en HA, readUri (lecturas → réplicas)
curl https://koigrid.com/api/v1/databases/:id/connection \
-H "Authorization: Bearer koi_YOUR_KEY"
# → { connection: { uri, host, port, database, username, caCert, sslVerifiedUri } }
# port is dynamic per cluster; readUri exists only on HA plans (Free = no read replica)Backup ahora / restaurar a un punto en el tiempo
curl -X POST https://koigrid.com/api/v1/databases/:id/backups -H "Authorization: Bearer koi_YOUR_KEY"
curl -X POST https://koigrid.com/api/v1/databases/:id/restore \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"targetTime":"2026-07-03T10:00:00Z"}' # PITR → new clusterVersiones y capacidades de PostgreSQL
- PostgreSQL:
- 15, 16, 17 (default 17)
- pgvector:
- pre-installed — embeddings / búsqueda vectorial — CREATE EXTENSION vector; columnas vector(N). AI-native.
- Extensions:
- pg_trgm, unaccent, uuid-ossp, pgcrypto, citext, hstore, pg_stat_statements (CREATE EXTENSION)
- Logical replication / CDC:
- enabled — CREATE SUBSCRIPTION (in) + publications (out)
- Pooling:
- PgBouncer (incluido) · PITR · read replicas (HA)
- TLS:
- verificado (sslmode=verify-ca con CA propia — sin rejectUnauthorized:false)
Migra tu esquema
¿Vienes de RDS/Neon/Supabase? Apunta DATABASE_URL a tu base de datos koigrid y corre tus migraciones tal cual — drizzle-kit migrate, prisma migrate deploy, etc. Un esquema real de 99 tablas aplicó a la primera.
# Point your ORM at koigrid and run your existing migrations unchanged:
DATABASE_URL="$(koigrid db connection <id> --json | jq -r .connection.uri)" \
npx drizzle-kit migrate # or: prisma migrate deploy, atlas, etc.
# TLS verified out of the box: ssl:{ ca: caCert } on sslVerifiedUri (no rejectUnauthorized:false)Cron jobs (tareas programadas)
Ejecuta cualquier contenedor en un cron — la alternativa a EventBridge. Límites, logs, reintentos con backoff y aislamiento gVisor. Crea el job; un tick lo ejecuta según su horario (o dispáralo manualmente).
Crear un job programado
curl -X POST https://koigrid.com/api/v1/jobs \
-H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"nightly","schedule":"0 3 * * *","image":"alpine:3","command":"echo hi","maxRetries":2}'Disparar una ejecución ahora / leer los logs
curl -X POST https://koigrid.com/api/v1/jobs/:id/trigger -H "Authorization: Bearer koi_YOUR_KEY" curl https://koigrid.com/api/v1/jobs/:id/runs -H "Authorization: Bearer koi_YOUR_KEY" # logs + exit code
Checks (Uptime & Synthetic Monitoring)
Crea un check para vigilar un endpoint desde fuera. koigrid le pega en un intervalo y comprueba status, latencia y body, y te avisa (email + webhook) al caer y al recuperarse. Run-once para probar al instante. El sustituto de CloudWatch Synthetics, gestionado por API.
# create a check: URL + assertions (status, latency, body) + alert webhook
curl -X POST https://koigrid.com/api/v1/checks \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"name":"api-health","target":"https://my.app/api/health","intervalSeconds":60,
"assertions":[{"type":"status","value":"2xx"},{"type":"latency","value":800},{"type":"body_contains","value":"ok"}],
"webhookUrl":"https://hooks.slack.com/…","alertAfter":2}'
# run it now (run-once) + see history/metrics
curl -X POST https://koigrid.com/api/v1/checks/:id/run -H "Authorization: Bearer koi_YOUR_KEY"
curl https://koigrid.com/api/v1/checks/:id/runs -H "Authorization: Bearer koi_YOUR_KEY" # uptime % + p95Feature Flags
Activa/desactiva features y despliégalas gradualmente por porcentaje, con evaluación estable por usuario (el mismo usuario ve siempre la misma variante). Una llamada de evaluación devuelve cada flag como booleano. La alternativa a LaunchDarkly, gestionada por API o tu agente de IA.
# create a flag, turn it on, and roll it out to 10%
curl -X POST https://koigrid.com/api/v1/flags \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"key":"checkout-v2","enabled":true,"rolloutPercent":10}'
# evaluate ALL flags for a user (stable per user) — the SDK call
curl -X POST https://koigrid.com/api/v1/flags/evaluate \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"context":"user-42"}' # → {"flags":{"checkout-v2":true}}Status Pages
Una página de estado pública para tus usuarios, generada de tus Checks (cada check = un componente con su estado en vivo y uptime). Comparte una URL en /status/<slug>. La alternativa a Atlassian Statuspage.
# create a public status page — it shows this project's Checks (name + status + uptime)
curl -X POST https://koigrid.com/api/v1/status-pages \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"slug":"acme","name":"Acme Status"}'
# → public, no auth, at https://koigrid.com/status/acmeHeartbeats (Cron Monitoring)
Un dead-man’s switch para tus crons: hacen ping a una URL al terminar, y si koigrid no los oye en period+grace, te avisa (email + webhook). La alternativa a Healthchecks.io, gestionada por API.
# create a heartbeat (dead-man's switch) — expects a ping every hour
curl -X POST https://koigrid.com/api/v1/heartbeats \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"name":"Nightly backup","periodSeconds":86400,"graceSeconds":600}'
# → returns pingUrl; add it to the end of your cron:
# 0 3 * * * /backup.sh && curl -fsS https://koigrid.com/ping/<token>Config & Secrets
Configuración compartida y cifrada para todo el proyecto: pon un valor una vez y cada app o agente lo tira. Los valores se cifran en reposo y nunca se muestran en el dashboard ni en logs. La alternativa a Doppler.
# set a shared, encrypted value for the whole project
curl -X PUT https://koigrid.com/api/v1/config \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"key":"DATABASE_URL","value":"postgres://…"}'
# pull all config into your app (or: koigrid config pull > .env)
curl https://koigrid.com/api/v1/config/pull -H "Authorization: Bearer koi_YOUR_KEY" # → {"config":{"DATABASE_URL":"…"}}Web Analytics
Analytics de tráfico privacy-first: añade un script pequeño y ve páginas vistas, visitantes únicos, top páginas y referrers — sin cookies, sin datos personales, sin banner de consentimiento. La alternativa a Plausible, gestionada por API.
# create a site → returns a beacon snippet for your <head>
curl -X POST https://koigrid.com/api/v1/analytics/sites \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"name":"my-site.com"}'
# snippet: <script defer src="https://koigrid.com/a.js" data-site="TOKEN"></script>
# read stats (no cookies, GDPR-friendly)
curl "https://koigrid.com/api/v1/analytics/sites/<id>/stats?days=30" -H "Authorization: Bearer koi_YOUR_KEY"Error Tracking
Captura excepciones de tu app y agrúpalas por fingerprint (mensaje + primer frame) para que un bug sea una línea con su contador. POST desde tu error handler con el token de ingesta. La alternativa a Sentry.
# get your ingest token (auto-created per project)
curl https://koigrid.com/api/v1/errors -H "Authorization: Bearer koi_YOUR_KEY" # → { ingestToken, groups: [...] }
# capture an error from your app's error handler (public, by token)
curl -X POST https://koigrid.com/api/errors -H "Content-Type: application/json" \
-d '{"token":"INGEST_TOKEN","message":"TypeError: x is undefined","stack":"at foo (a.js:1)","level":"error"}'Firewall (WAF)
Reglas allow/block por IP, CIDR, país, prefijo de ruta, método o user-agent. Añade reglas con la API; tu edge/middleware llama a POST /waf/evaluate por petición para obtener una decisión allow/block (gana la primera que casa). La alternativa a Cloudflare WAF.
# add a block rule (blocks a whole country)
curl -X POST https://koigrid.com/api/v1/waf/rules -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"action":"block","matchType":"country","matchValue":"RU"}'
# your edge/middleware evaluates each request → { "action":"block", "ruleId":"…" }
curl -X POST https://koigrid.com/api/v1/waf/evaluate -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"ip":"1.2.3.4","country":"RU","path":"/api"}'Webhooks
Suscribe una URL a los eventos de tu plataforma. koigrid hace POST de un payload JSON firmado (verifica la cabecera X-Koigrid-Signature HMAC-SHA256 con el secreto de tu webhook) y reintenta con backoff (5 intentos, ~2h) si la entrega falla. Suscríbete a tipos exactos, a un prefijo de dominio (app.*) o a todo (*). Los destinos se validan contra SSRF. La alternativa a Svix/webhooks de Vercel.
# 1) subscribe a URL to events (returns the signing secret ONCE)
curl -X POST https://koigrid.com/api/v1/webhooks -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://api.example.com/koi-hook","events":["app.*","db.failover"]}'
# → { "webhook": { "id":"…", "secret":"whsec_…" } } ← save the secret
# 2) verify the signature on your endpoint (Node)
# const expected = 'sha256=' + crypto.createHmac('sha256', SECRET).update(rawBody).digest('hex')
# timingSafeEqual(expected, req.headers['x-koigrid-signature'])
# 3) inspect delivery history
curl https://koigrid.com/api/v1/webhooks/WEBHOOK_ID/deliveries -H "Authorization: Bearer koi_YOUR_KEY"Log Drains
Reenvía tus logs a un sink externo. Crea un drain (tipo http o datadog) con un conjunto opcional de cabeceras (cifradas) y un filtro de source. koigrid bufferiza los records y el tick entrega los nuevos en lotes; cada drain lleva un cursor así que un sink caído un momento reanuda sin pérdida. Cualquier app o agente puede empujar sus propios logs estructurados a POST /logs. Los destinos se validan contra SSRF. La alternativa a Vercel Log Drains.
# 1) create a drain to an HTTP sink (extra headers are encrypted)
curl -X POST https://koigrid.com/api/v1/log-drains -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Better Stack","url":"https://in.logs.betterstack.com","headers":{"Authorization":"Bearer SOURCE_TOKEN"},"sources":["runtime","app"]}'
# Datadog: {"name":"DD","type":"datadog","headers":{"DD-API-KEY":"…"}} (url defaults to DD intake)
# 2) push your own structured logs (any app or agent)
curl -X POST https://koigrid.com/api/v1/logs -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"records":[{"level":"error","message":"checkout failed","appId":"shop","source":"app"}]}'
# 3) query recent buffered logs
curl "https://koigrid.com/api/v1/logs?source=app&limit=50" -H "Authorization: Bearer koi_YOUR_KEY"Spend Management
Pon un tope de gasto mensual para tu organización. GET /spend devuelve el gasto del mes, tu tope y el porcentaje usado; PUT /spend fija amountCents, los umbrales de aviso (porcentajes) y hardStop. Cada vez que se cruza un umbral se manda email al owner y se emite un evento (un webhook lo puede reenviar). Con hardStop activo, crear nuevos recursos de pago (apps, bases de datos, cachés) se bloquea al llegar al tope — las lecturas y los servicios en marcha siguen. El gasto se mide de tu ledger de uso. La alternativa a Vercel Spend Management.
# set a $50/month limit, warn at 80% and 100%, hard-stop new paid resources at 100%
curl -X PUT https://koigrid.com/api/v1/spend -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"amountCents":5000,"thresholds":[80,100],"hardStop":true}'
# check where you stand this month
curl https://koigrid.com/api/v1/spend -H "Authorization: Bearer koi_YOUR_KEY"
# → { "spendCents":3120, "limit":{"amountCents":5000,…}, "pct":62, "over":false, "blocked":false }Bot Management
Clasifica el user-agent (crawler verificado / automatizado / probable humano) y obtén una decisión allow, challenge o block. Fija la política por proyecto con PUT /bots/policy (mode off|log|challenge|block, allowVerified). Tu edge llama a POST /bots/evaluate por petición. En modo challenge, POST /bots/challenge emite un puzzle proof-of-work firmado y POST /bots/verify comprueba la solución. Los bots verificados como Googlebot están en la allowlist, así tu SEO nunca se rompe. La alternativa a Cloudflare Bot Management / Vercel BotID.
# 1) set the policy (challenge automated traffic; verified crawlers always pass)
curl -X PUT https://koigrid.com/api/v1/bots/policy -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"mode":"challenge","allowVerified":true}'
# 2) your edge evaluates each request → { "action":"allow"|"challenge"|"block", "category":"…" }
curl -X POST https://koigrid.com/api/v1/bots/evaluate -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"userAgent":"python-requests/2.31","path":"/api"}'
# 3) challenge flow: issue → client solves the proof-of-work → verify
curl -X POST https://koigrid.com/api/v1/bots/challenge -H "Authorization: Bearer koi_YOUR_KEY"
# → { "challenge":"<token>", "difficulty":4 } # find solution s.t. sha256(salt+solution) starts with N zeros
curl -X POST https://koigrid.com/api/v1/bots/verify -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"challenge":"<token>","solution":"<n>"}' # → { "ok":true }Export de OpenTelemetry
Exporta las métricas de uso y coste de koigrid en OTLP nativo a cualquier backend de OpenTelemetry. PUT /otel fija el endpoint OTLP de métricas y las cabeceras de auth opcionales (se guardan cifradas); el endpoint se valida contra SSRF. Cada pocos minutos koigrid envía tus métricas como OTLP/JSON para que lleguen a Grafana Cloud, Honeycomb, Datadog, Tempo o tu propio collector — protocolo abierto, sin lock-in. La alternativa a Vercel OpenTelemetry.
# point koigrid at your OTLP metrics endpoint (auth header stored encrypted)
curl -X PUT https://koigrid.com/api/v1/otel -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"endpoint":"https://otlp.grafana.net/v1/metrics","headers":{"Authorization":"Basic <token>"}}'
# koigrid pushes OTLP/JSON every few minutes: koigrid.usage{metric=…} and koigrid.cost
curl https://koigrid.com/api/v1/otel -H "Authorization: Bearer koi_YOUR_KEY"
# → { "exporter":{"endpoint":"…","enabled":true,"lastExportAt":"…","lastError":null} }Gestión de DNS
Trae tu propio proveedor DNS: conecta la zona que ya tienes con POST /dns/zones (provider, domain, zoneId, apiToken — el token se guarda cifrado). Luego CRUD de records: GET/POST /dns/zones/:id/records y PUT/DELETE /dns/zones/:id/records/:recordId, para A/AAAA/CNAME/TXT/MX/NS/CAA. Los records se validan antes de llegar a tu proveedor. v1 soporta Cloudflare (seam listo para más). Tu zona sigue en tu cuenta — sin lock-in. La alternativa a Vercel DNS / Cloudflare DNS.
# 1) connect your zone (BYO provider — the token is stored encrypted)
curl -X POST https://koigrid.com/api/v1/dns/zones -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"provider":"cloudflare","domain":"example.com","zoneId":"<cf-zone-id>","apiToken":"<cf-token>"}'
# → { "zone": { "id":"…","domain":"example.com" } }
# 2) create a record
curl -X POST https://koigrid.com/api/v1/dns/zones/ZONE_ID/records -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"type":"A","name":"www","content":"1.2.3.4","proxied":false}'
# 3) list / delete
curl https://koigrid.com/api/v1/dns/zones/ZONE_ID/records -H "Authorization: Bearer koi_YOUR_KEY"
curl -X DELETE https://koigrid.com/api/v1/dns/zones/ZONE_ID/records/RECORD_ID -H "Authorization: Bearer koi_YOUR_KEY"Queues
Durable message queue (SQS-like): send, receive with a visibility timeout, ack to delete, dead-letter after maxReceives. Scopes: queues:read / queues:write.
# 1) create a queue
curl -X POST https://koigrid.com/api/v1/queues -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"name":"tasks","visibilityTimeoutSec":30,"maxReceives":5}'
# → { "queue": { "id":"…","name":"tasks" } }
# 2) send a message (optional delaySeconds / dedupeId)
curl -X POST https://koigrid.com/api/v1/queues/QUEUE_ID/messages -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"body":"{\"job\":1}","delaySeconds":0}'
# 3) receive (claims + hides the message for visibilityTimeoutSec), then ack to delete
curl -X POST https://koigrid.com/api/v1/queues/QUEUE_ID/receive -H "Authorization: Bearer koi_YOUR_KEY" -d '{"max":1}'
# → { "messages": [ { "id":"…","body":"…","receiptHandle":"…:1" } ] }
curl -X POST https://koigrid.com/api/v1/queues/QUEUE_ID/ack -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"receiptHandle":"MSG_ID:1"}'
# CLI: koigrid queues create tasks · send · receive · ack · showManaged WordPress
1-click WordPress hosting: a hosting account is an isolated OpenLiteSpeed container holding unlimited sites; each site gets its own database on a managed MariaDB Galera cluster. Scopes: wordpress:read / wordpress:write.
# 1) create a hosting account (isolated OLS container)
curl -X POST https://koigrid.com/api/v1/wordpress/accounts -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"name":"Acme","slug":"acme","planTier":"pro"}'
# → { "account": { "id":"…","slug":"acme" } }
# 2) 1-click install a WordPress site (wired to the managed DB, admin ready)
curl -X POST https://koigrid.com/api/v1/wordpress/accounts/ACCOUNT_ID/sites -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"slug":"blog","title":"Acme Blog","adminUser":"admin","adminEmail":"[email protected]"}'
# → { "site": { "id":"…","domainDefault":"blog.acme.sites.koigrid.com","adminPassword":"… (shown once)" } }
# 3) manage it by API with WP-CLI (AI-first; sanitized, allowlist, no shell)
curl -X POST https://koigrid.com/api/v1/wordpress/sites/SITE_ID/wp-cli -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"command":"plugin install woocommerce --activate"}'
# 4) back up the site (DB dump + files → S3)
curl -X POST https://koigrid.com/api/v1/wordpress/sites/SITE_ID/backups -H "Authorization: Bearer koi_YOUR_KEY"
# CLI: koigrid wp create acme --name "Acme" · wp install <acct> blog --title "Blog" · wp cli <site> plugin list · wp backup <site>Workflows
Durable execution (Step-Functions-like): ordered steps, journaled outputs (a run survives crashes/redeploys), durable sleep + retries. Scopes: workflows:read / workflows:write.
# 1) define a workflow (ordered steps)
curl -X POST https://koigrid.com/api/v1/workflows -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"name":"order","steps":["charge","ship","notify"]}'
# 2) start a run
curl -X POST https://koigrid.com/api/v1/workflows/WF_ID/runs -H "Authorization: Bearer koi_YOUR_KEY" -d '{"input":"{\"orderId\":42}"}'
# → { "run": { "id":"RUN_ID","status":"running","currentStep":0 } }
# 3) worker loop: claim next step → run it → report result (completed steps never re-run)
curl -X POST https://koigrid.com/api/v1/workflows/WF_ID/runs/RUN_ID/next -H "Authorization: Bearer koi_YOUR_KEY"
# → { "step":"charge","context":{...},"input":"..." }
curl -X POST https://koigrid.com/api/v1/workflows/WF_ID/runs/RUN_ID/complete -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"step":"charge","output":{"chargeId":"ch_1"}}'
# durable sleep between steps: POST .../sleep {"seconds":3600} · retry on failure: POST .../fail {"step":"...","error":"..."}
# CLI: koigrid workflows create order --steps charge,ship,notify · start · next · complete · sleepContainer Registry
Private OCI registry (ECR-like): docker push/pull to koigrid, images on koigrid Storage. Auth = Basic with a koigrid token carrying registry:read/registry:write. List repos: scope registry:read.
# 1) log in with a scoped koigrid token (password = the token)
docker login koigrid.com -u token -p koi_YOUR_TOKEN_WITH_registry_scope
# 2) tag + push
docker tag myapp:latest koigrid.com/myteam/myapp:v1
docker push koigrid.com/myteam/myapp:v1
# 3) pull from anywhere (any OCI client)
docker pull koigrid.com/myteam/myapp:v1
# list your repositories (management API / CLI)
curl https://koigrid.com/api/v1/registry/repositories -H "Authorization: Bearer koi_YOUR_KEY"
# → { "repositories": [ { "name":"myteam/myapp", "tags": 1 } ] }
# CLI: koigrid registry reposAudit Log
Who did what — a curated, filterable record of every security/config change in your org, with the actor (user or API-token agent) and their source IP (CloudTrail-like). Owners/admins only, scope audit:read. Categories: auth, members, tokens, resources, deploy, network, security, billing, config.
# list audit entries (filter by category, action type, actor, date)
curl "https://koigrid.com/api/v1/audit?categories=members,security&sinceDays=30&limit=100" \
-H "Authorization: Bearer koi_YOUR_KEY"
# → { "categories":[…], "entries":[ { "at":…, "action":"token.created", "label":"API token created",
# "category":"tokens", "actorType":"user", "actor":"[email protected]", "ip":"1.2.3.4" }, … ] }
# export to CSV (same filters) for compliance / SIEM
curl "https://koigrid.com/api/v1/audit/export?sinceDays=90" -H "Authorization: Bearer koi_YOUR_KEY" -o audit.csv
# CLI
koigrid audit ls --category security --since 30
koigrid audit export --since 90 > audit.csvOptimización de imágenes
Redimensiona y re-encoda imágenes al vuelo. Allowlista tus hosts fuente (anti-SSRF) y apunta un <img> a /img?token=…&url=…&w=…&fmt=webp — koigrid coge, convierte a WebP/AVIF, cachea y sirve. La alternativa a Cloudinary/imgix/Vercel Images.
# 1) allowlist your source hosts (anti-SSRF)
curl -X PUT https://koigrid.com/api/v1/images/config -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" -d '{"allowedHosts":["cdn.example.com","*.mybucket.s3.koigrid.com"]}'
# → { "publicToken":"…", "allowedHosts":[…], "imgBase":"https://koigrid.com/img" }
# 2) point your <img> at the optimized URL (public, cached)
<img src="https://koigrid.com/img?token=TOKEN&url=https://cdn.example.com/hero.jpg&w=800&fmt=webp" />Sandboxes
Compute efímero: ejecuta una imagen de contenedor + comando una vez y recibe el exit code y la salida. Una llamada a la API — ideal para agentes de IA que corren código no confiable, tareas puntuales y pasos de build. Con límites de memoria/tiempo y aislado. La alternativa a e2b/Modal/Vercel Sandboxes.
# run a container image + command once → get exit code + logs (one API call)
curl -X POST https://koigrid.com/api/v1/sandboxes -H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"image":"alpine:3.19","command":"echo hello from koigrid"}'
# → { "sandbox": { "status":"completed", "exitCode":0, "logs":"hello from koigrid", "durationMs": 812 } }Speed Insights
Core Web Vitals (LCP, CLS, FCP, TTFB) de visitantes reales — en p75, la métrica por la que Google rankea. Añade el beacon /v.js junto a tu tag de analytics (mismo token del site) y lee los números por la API. La alternativa a Vercel Speed Insights.
# add the vitals beacon next to your analytics tag (same site token) <script defer src="https://koigrid.com/v.js" data-site="YOUR_SITE_TOKEN"></script> # read Core Web Vitals (p75) from the API curl https://koigrid.com/api/v1/speed-insights -H "Authorization: Bearer koi_YOUR_KEY" # all sites curl "https://koigrid.com/api/v1/speed-insights/<siteId>?days=30" -H "Authorization: Bearer koi_YOUR_KEY"
Caché / Redis (HA)
Redis gestionado con master + réplica + quórum de Sentinel tras un endpoint estable — la alternativa a ElastiCache. Snapshots y restore incluidos. Crea la caché y obtén una URL rediss://.
Crear una caché Redis
curl -X POST https://koigrid.com/api/v1/redis \
-H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"sessions","version":"7"}'Obtener la connection string / snapshot
curl https://koigrid.com/api/v1/redis/:id/connection -H "Authorization: Bearer koi_YOUR_KEY"
# → { connection: { uri: "rediss://:pass@rds-<slug>.dbs.koigrid.com:PORT" } } (follows the master)Almacenamiento (S3)
Almacenamiento de objetos compatible con S3. Crea buckets, acuña claves limitadas solo a tus buckets, y usa cualquier herramienta S3.
Crear un bucket
curl -X POST https://koigrid.com/api/v1/buckets \
-H "Authorization: Bearer koi_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"backups"}'Obtener una access key S3 (limitada a tus buckets)
curl -X POST https://koigrid.com/api/v1/storage/keys \
-H "Authorization: Bearer koi_YOUR_KEY"
# → { credential: { accessKey, secretKey, endpoint } } (secret shown once)
# S3 client: use the bucket's bucketName (not its friendly name) + forcePathStyle:trueÚsala con aws-cli
aws configure set aws_access_key_id YOUR_ACCESS_KEY aws configure set aws_secret_access_key YOUR_SECRET_KEY aws s3 ls --endpoint-url https://s3.koigrid.com aws s3 cp ./file.txt s3://YOUR_BUCKET/ --endpoint-url https://s3.koigrid.com
O con rclone (~/.config/rclone/rclone.conf)
[koigrid] type = s3 provider = Other access_key_id = YOUR_ACCESS_KEY secret_access_key = YOUR_SECRET_KEY endpoint = https://s3.koigrid.com # then: rclone ls koigrid:YOUR_BUCKET
Observabilidad (eventos, métricas, alarmas)
Consulta tu línea de tiempo de eventos, métricas de consumo y de salud del recurso, y crea alarmas por umbral notificadas por email — la alternativa a CloudWatch. Todo por API.
Leer la línea de tiempo de eventos / métricas
curl "https://koigrid.com/api/v1/events?sinceHours=24" -H "Authorization: Bearer koi_YOUR_KEY" curl "https://koigrid.com/api/v1/metrics?days=30" -H "Authorization: Bearer koi_YOUR_KEY"
Crear una alarma (sobre consumo o salud del recurso)
curl -X POST https://koigrid.com/api/v1/alarms \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"name":"redis-mem","resourceType":"redis","resourceId":"<id>","metric":"redis_used_memory_pct","comparator":"gt","threshold":80}'Email (trae tu propio SMTP)
Email transaccional a través de tu propio proveedor SMTP (Resend, SES, Postmark, tu propio servidor) — la alternativa a SES, sin límites por dominio. Configura tu proveedor una vez y envía.
Configurar tu proveedor SMTP (verificado al guardar)
curl -X PUT https://koigrid.com/api/v1/email/config \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"smtp":"smtp://user:[email protected]:587","fromDefault":"Acme <[email protected]>"}'Enviar un email
curl -X POST https://koigrid.com/api/v1/email/send \
-H "Authorization: Bearer koi_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"to":"[email protected]","subject":"Hello","text":"Sent through your own SMTP."}'Links y QR (links cortos + códigos QR)
Acorta URLs y genera códigos QR desde tu terminal o agente de IA. Con tu token, los links son permanentes y editables — cambia a dónde apunta un link y su QR sigue funcionando (QR dinámico).
Acortar una URL
curl -H "Authorization: Bearer koi_YOUR_KEY" \ -d "https://example.com/very/long/url" https://koigrid.com/api/links # → https://koigrid.com/l/ab12cd
Código QR de cualquier URL o texto
<img src="https://koigrid.com/api/qr?data=https://koigrid.com&size=512" />
Agentes IA
koigrid está hecho para que lo manejen LLMs. Apunta tu agente a /llms.txt y a la API, o pega el prompt del dashboard. Luego pídele crear buckets, acuñar claves, etc.
https://koigrid.com/llms.txt
Referencia de la API
Todos los endpoints requieren la cabecera: Authorization: Bearer koi_TU_KEY
Base URL
https://koigrid.com/api/v1Spec de la API legible por máquina (OpenAPI 3.1) y guía para LLMs: https://koigrid.com/api/v1/openapi.json · /llms.txt
- GET/me
- GET/usage
- GET/POST/tokens
- DELETE/tokens/:id
- GET/PUT/notifications/preferences
- GET/POST/connect/grants
- PATCH/DELETE/connect/grants/:id
- POST/connect/token
- POST/manifest
- POST/manifest/plan
- GET/POST/rewards
- GET/rewards/lines
- GET/rewards/referral
- POST/rewards/redeem
- POST/rewards/submissions/:id/review
- GET/changelog
- GET/POST/projects
- DELETE/projects/:id
- GET/POST/apps
- GET/PATCH/DELETE/apps/:id
- GET/POST/apps/:id/deployments
- POST/apps/:id/source-upload
- GET/apps/:id/logs
- GET/PUT/apps/:id/scale
- GET/PUT/apps/:id/resources
- GET/PUT/apps/:id/autoscale
- GET/PUT/apps/:id/scale-out
- GET/POST/DELETE/apps/:id/env
- GET/apps/:id/env/verify
- GET/POST/DELETE/apps/:id/domains
- POST/apps/:id/domains/verify
- GET/POST/apps/:id/volumes
- DELETE/apps/:id/volumes/:volId
- GET/POST/apps/:id/volumes/:volId/backups
- POST/apps/:id/volumes/:volId/backups/:backupId/restore
- GET/PUT/apps/:id/cdn
- GET/PUT/apps/:id/github
- POST/apps/:id/rollback
- POST/apps/:id/pause
- POST/apps/:id/resume
- POST/apps/:id/migrate
- GET/POST/apps/:id/previews
- GET/POST/apps/:id/rules
- PATCH/DELETE/apps/:id/rules/:ruleId
- POST/apps/:id/restore
- GET/POST/databases
- GET/PATCH/DELETE/databases/:id
- GET/databases/:id/connection
- GET/POST/databases/:id/backups
- POST/databases/:id/restore
- GET/POST/databases/:id/restore-dump
- POST/databases/:id/fix-ownership
- POST/databases/:id/restore-dump/upload-url
- GET/databases/:id/restore-dump/:jobId
- GET/databases/:id/metrics
- GET/databases/:id/logs
- GET/POST/databases/:id/extensions
- GET/POST/databases/:id/query
- GET/POST/databases/:id/replicas
- GET/POST/DELETE/databases/:id/publications
- POST/databases/:id/apply-config
- GET/POST/DELETE/databases/:id/subscriptions
- GET/POST/databases/:id/branches
- GET/PATCH/DELETE/databases/:id/branches/:branchId
- POST/databases/:id/branches/:branchId/reset
- GET/POST/databases/:id/roles
- PATCH/DELETE/databases/:id/roles/:roleName
- GET/PUT/databases/:id/rotation
- POST/databases/:id/rotation/rotate
- POST/databases/:id/rotation/migrate
- POST/databases/:id/rpc/:fn
- GET/POST/PATCH/DELETE/databases/:id/data/:table
- GET/POST/redis
- GET/PATCH/DELETE/redis/:id
- GET/redis/:id/connection
- GET/POST/redis/:id/backups
- POST/redis/:id/apply-config
- POST/redis/:id/restore
- GET/redis/:id/metrics
- GET/POST/buckets
- DELETE/buckets/:id
- GET/POST/buckets/:id/versions
- GET/DELETE/buckets/:id/objects
- POST/buckets/:id/objects/upload-url
- GET/buckets/:id/objects/download-url
- GET/POST/storage/keys
- DELETE/storage/keys/:id
- GET/POST/jobs
- GET/PATCH/DELETE/jobs/:id
- GET/jobs/:id/runs
- POST/jobs/:id/trigger
- GET/events
- GET/metrics
- GET/POST/alarms
- DELETE/alarms/:id
- GET/POST/anomalies
- DELETE/anomalies/:id
- POST/email/send
- GET/email/messages
- GET/PUT/DELETE/email/config
- GET/POST/checks
- GET/PATCH/DELETE/checks/:id
- POST/checks/:id/run
- GET/checks/:id/runs
- GET/POST/webhooks
- PATCH/DELETE/webhooks/:id
- GET/webhooks/:id/deliveries
- GET/POST/log-drains
- PATCH/DELETE/log-drains/:id
- GET/POST/logs
- GET/PUT/DELETE/spend
- GET/PUT/bots/policy
- POST/bots/evaluate
- POST/bots/challenge
- POST/bots/verify
- GET/PUT/DELETE/otel
- GET/POST/dns/zones
- DELETE/dns/zones/:id
- GET/POST/dns/zones/:id/records
- PUT/DELETE/dns/zones/:id/records/:recordId
- GET/POST/queues
- GET/PATCH/DELETE/queues/:id
- POST/queues/:id/messages
- POST/queues/:id/receive
- POST/queues/:id/ack
- GET/POST/workflows
- GET/PATCH/DELETE/workflows/:id
- GET/POST/workflows/:id/runs
- GET/workflows/:id/runs/:runId
- POST/workflows/:id/runs/:runId/next
- POST/workflows/:id/runs/:runId/complete
- POST/workflows/:id/runs/:runId/fail
- POST/workflows/:id/runs/:runId/sleep
- GET/POST/wordpress/accounts
- GET/DELETE/wordpress/accounts/:id
- GET/POST/wordpress/accounts/:id/sites
- GET/DELETE/wordpress/sites/:id
- POST/wordpress/sites/:id/wp-cli
- GET/POST/wordpress/sites/:id/backups
- GET/POST/wordpress/sites/:id/domains
- POST/PATCH/DELETE/wordpress/domains/:id
- GET/PUT/apps/:id/protection
- GET/PUT/apps/:id/retention
- PUT/apps/:id/registry
- POST/apps/:id/loadtest
- POST/apps/:id/protection/evaluate
- GET/POST/apps/:id/deploy-hooks
- DELETE/apps/:id/deploy-hooks/:hookId
- GET/registry/repositories
- GET/registry/repositories/:name/tags
- DELETE/registry/repositories/:name/tags/:tag
- POST/databases/:id/pause
- POST/databases/:id/resume
- POST/registry/gc
- GET/audit
- GET/audit/export
- GET/POST/members
- GET/PUT/members/two-factor
- PATCH/DELETE/members/:userId
- DELETE/members/invitations/:id
- GET/POST/flags
- GET/PATCH/DELETE/flags/:key
- POST/flags/evaluate
- GET/POST/status-pages
- GET/PATCH/DELETE/status-pages/:id
- GET/POST/status-pages/:id/incidents
- PATCH/status-pages/:id/incidents/:incidentId
- GET/POST/heartbeats
- GET/PATCH/DELETE/heartbeats/:id
- GET/PUT/config
- GET/config/pull
- DELETE/config/:key
- GET/POST/analytics/sites
- GET/DELETE/analytics/sites/:id
- GET/analytics/sites/:id/stats
- GET/errors
- PATCH/DELETE/errors/groups/:id
- GET/speed-insights
- GET/speed-insights/:id
- GET/POST/sandboxes
- GET/sandboxes/:id
- GET/PUT/images/config
- GET/images/usage
- GET/POST/waf/rules
- PATCH/DELETE/waf/rules/:id
- POST/waf/evaluate