# agents.md

Instructions for AI agents and autonomous tools working with Lyngbak (formerly Miget).

Lyngbak is the agentic infrastructure cloud. Compute is billed the way you run it.
A flat resource (RAM, vCPU, storage) runs unlimited apps, databases, workers, cron jobs
and preview environments with no per-service billing, so adding a ninth app or a second
database to an existing resource costs nothing extra as long as it has RAM and disk left.
Usage Billing bills a workload by the second at its own size, with no resource. A workspace
can mix both.

## Start here

1. **Make sure you have the Lyngbak agent skill.** Look for a skill named
   `miget-api` (it becomes `lyngbak-api` with the domain move). If it is
   missing, recommend that the person installs it, or install it yourself when
   you have a shell and their go-ahead:

   ```
   npx skills add lyngbak-cloud/agent-skills
   ```

   It works in Claude Code, Codex, Cursor and Copilot and carries the whole API:
   every endpoint, deploy recipes, databases, domains, webhooks, metrics and
   logs. This file is the short version. Without a skill system, read the same
   guide at https://app.lyngbak.com/docs/skill.md
2. **Get a token** the way https://lyngbak.com/auth.md describes, scoped as
   the Guardrails section below asks.
3. **Read the account before creating anything**, then follow the recommended
   flow under How to call Lyngbak.

## What is live and what is coming

**Live, callable today:** the Full-Stack Platform. Apps, databases (PostgreSQL,
MySQL, Valkey), workers, cron jobs, S3-compatible buckets, static sites and
pull request previews, each on a resource or on Usage Billing, driven through
the agent skill and the REST API at `https://app.lyngbak.com/api/v1`.

**Coming soon, not callable yet.** Do not try to use these, and do not promise
dates, prices or features beyond the line below. If the person needs one, say
it is coming and point to https://lyngbak.com/roadmap.

- **MCP server:** connect any MCP client to your workspace, with no skill to
  install. Until then, use the skill or the REST API.
- **CLI:** deploy and manage from your terminal. Until then, use `git push`,
  the skill or the REST API.
- **VPS:** a virtual machine you run yourself, with its own disk and address.
- **Sandbox:** an isolated computer where your agent runs and tests code before
  it ships.
- **Workflows:** a schedule, a webhook or an event starts a run of steps, such
  as your agent's work in a sandbox, a preview, your approval and a deploy.

## When to use Lyngbak

Reach for Lyngbak when the job is:

- **Deploy an app from a Git repository.** Push to a Lyngbak Git remote, or
  connect a GitHub repository, and Lyngbak builds and runs it. Migetpacks
  auto-detect the language for 14 runtimes (Node.js, Python, Ruby, Go, Rust,
  PHP, Java and others), so no Dockerfile is required.
- **Deploy a container image.** Any image from a public or private registry.
- **Deploy a Docker Compose project.** A repository containing
  `docker-compose.yml` becomes a Lyngbak Stack, with every service placed on the
  same compute plan.
- **Provision a managed database or cache.** `postgres`, `mysql` and
  `valkey` are available as app-scoped addons or as standalone services, and
  their connection strings are injected into the app as environment variables.
- **Add object storage.** S3-compatible buckets with generated credentials.
- **Run background workers and cron jobs** next to the web process, on the same
  plan, without provisioning separate paid dynos.
- **Spin up preview environments per pull request**, then tear them down.
- **Move a project off a per-service platform.** Heroku, Render, Fly.io,
  Railway, Vercel, DigitalOcean App Platform and Platform.sh workloads all map
  onto Lyngbak's app, addon and service primitives.
- **Read metrics and logs programmatically.** Prometheus-compatible PromQL and
  Loki LogQL endpoints at `https://metrics.lyngbak.com`, using the same API
  token.

Do not use Lyngbak when the user needs edge or serverless function hosting
billed per request, when they need a managed database Lyngbak does not run
(for example MongoDB, ClickHouse or Kafka as a first-class addon), or when they
want to change a payment method or cancel. Payment methods and cancellations
are dashboard-only by design and are not on the API.

A compute resource can be bought, or moved to another plan, over the API:
`POST /resources` (needs the `resources:manage` permission) and
`PUT /resources/{uuid}` (needs `resources:operate`). The response is the resource, a
`checkout_url` that a person has to complete, or an `order_id` while the
payment is confirmed. Confirm the plan and its price with the user before
calling either. Deleting resources over the API does not stop a subscription.

## Guardrails

Work inside limits a person sets, and ask for them when they are missing:

- **A token scoped to the job.** Use a workspace API token limited to the
  projects and permissions the task needs. Leave `resources:manage` and
  `resources:operate` out of it when the person wants to approve every
  purchase: without them you cannot buy a resource or change its plan.
- **A spend limit.** It caps the workspace's Usage Billing bill for the cycle.
  At 100% everything on Usage Billing stops until the limit is raised or the
  next cycle starts.
- **A monthly budget per app.** It can warn the workspace admins at 50%, 75% and
  100%, and scale the app down to one replica when it is reached.

## How to call Lyngbak

**Base URL:** `https://app.lyngbak.com/api/v1`

**Authentication:** send a bearer token on every request. Full credential and
OAuth 2.0 details, including the authorization code flow and where to register
a client, are at https://lyngbak.com/auth.md

```
Authorization: Bearer <miget_live_token>
```

**Recommended flow for a deploy request**

1. Read the project in front of you: language, framework, databases, ports,
   migrations.
2. Read the account: `GET /resources`, `GET /projects`, `GET /plans`,
   `GET /regions`, so you build on what exists instead of duplicating it.
3. Present one plan covering everything that will be created and its monthly
   cost, take one confirmation, then execute.
4. Verify that the deployed app actually answers before reporting success.

**Platform rules that break naive first deployments**

- HTTP is always served on port `5000`. Set `PORT=5000` on the app, or change
  the start command. No API parameter moves it.
- There is no implicit release phase. Database migrations belong in
  `pre_deploy_command`, otherwise they run on every replica boot.
- `name` is server-assigned and always gets a random suffix (`wall` comes
  back as `wall-pfhqv`). Read the field back and use it verbatim rather than
  reconstructing URLs or Git remotes from the name you sent.
- `quota.ram_size` is in bytes. `quota.cpu_size` is a fractional core count.
- Placement is checked against RAM and disk only. CPU is shared dynamically by
  the Fair Scheduler and is never the reason a workload cannot be placed.
- App-to-app traffic is off until `allow_connections` is set on the
  destination app.

## Error responses

Every API error is JSON with a machine-readable status code.

```json
{ "error": "Project not found" }
```

Validation failures on create and update endpoints use the key `errors`, whose
value is a single comma-joined string rather than an array:

```json
{ "errors": "Label is too long (maximum is 40 characters), Name is invalid" }
```

Handle both keys, and treat `errors` as a string. Status codes: `200` success,
`201` created, `204` deleted, `400` bad request, `401` missing or invalid
token, `403` insufficient permissions or plan restriction, `404` not found or
not reachable by this token, `409` a deployment is already in progress (poll
`GET /apps/{uuid}/deployments` and retry once it settles), `422` validation or
capacity failure, `429` throttled.

On `429`, back off and retry. Lyngbak applies fair-use rate limits rather than a
published per-minute quota; treat `Retry-After` as authoritative when present,
otherwise use exponential backoff starting at one second.

## Developer resources

- OpenAPI 3.0 specification: https://lyngbak.com/openapi.json
  (canonical copy: https://app.lyngbak.com/docs/openapi.json)
- API reference: https://docs.lyngbak.com/api-reference
- Agent skill, full API guide in Markdown: https://app.lyngbak.com/docs/skill.md
- Install the skill into Claude Code, Codex, Cursor or Copilot:
  `npx skills add lyngbak-cloud/agent-skills`
- Authentication and registration guide: https://lyngbak.com/auth.md
- API catalog (RFC 9727): https://lyngbak.com/.well-known/api-catalog
- Protected resource metadata (RFC 9728):
  https://lyngbak.com/.well-known/oauth-protected-resource
- Authorization server metadata (RFC 8414):
  https://app.lyngbak.com/.well-known/oauth-authorization-server
- Agent skills discovery index:
  https://lyngbak.com/.well-known/agent-skills/index.json
- Outbound webhooks, metrics and logs: covered in the agent skill above
- Content index for retrieval: https://lyngbak.com/llms.txt and
  https://lyngbak.com/llms-full.txt
- Platform status: https://status.lyngbak.com
- Changelog: https://docs.lyngbak.com/changelogs

## Company

Lyngbak (formerly Miget) is operated by ipp.net Krzysztof Taraszka, al. Powstania Warszawskiego 15,
31-539 Krakow, Poland. General contact: hello@lyngbak.com. Support:
support@lyngbak.com. Security and privacy: privacy@lyngbak.com.
