# Luna > Documentation for Luna. ## Docs - [Introduction](https://docs.luna.gdrl.dev/): Documentation for Luna. - [Quickstart](https://docs.luna.gdrl.dev/quickstart): Sign up from the terminal, define your first luna and call it over HTTP. - [Build with an agent](https://docs.luna.gdrl.dev/build-with-an-agent): Give a coding agent what it needs to build on Luna, from the docs as Markdown to a CLI it can script and an environment of its own. - [Thinking in Luna](https://docs.luna.gdrl.dev/thinking-in-luna): How to shape an app as lunas. ## Concepts - [Organisations, projects and environments](https://docs.luna.gdrl.dev/concepts/organisations-projects-and-environments): How Luna arranges your work, from the organisation your team shares down to the environment an app runs in. - [The life of a luna](https://docs.luna.gdrl.dev/concepts/the-life-of-a-luna): When a luna comes to exist, when it sleeps and wakes, how its calls run and when its data is gone. - [Keys and tokens](https://docs.luna.gdrl.dev/concepts/keys-and-tokens): The credentials Luna issues, what each one reaches and which one is safe to ship in an app. - [Rules for lunas](https://docs.luna.gdrl.dev/concepts/rules-for-lunas): Nine rules that keep an app on Luna correct as it grows, each with the way that breaks and the way that holds. ## Lunas - [Define a luna](https://docs.luna.gdrl.dev/lunas/define-a-luna): Define a luna type with defineLuna, choose its key and make it reachable from your app. - [Write handlers](https://docs.luna.gdrl.dev/lunas/write-handlers): Add handlers that read and change a luna's data, return results and answer calls over HTTP. - [Check arguments with types](https://docs.luna.gdrl.dev/lunas/check-arguments-with-types): Declare a handler's arguments with t, so every call is checked before it reaches your code. - [Return errors](https://docs.luna.gdrl.dev/lunas/return-errors): Refuse a call with ctx.fail and a code the caller can act on, and know what callers see when something breaks. - [Call another luna](https://docs.luna.gdrl.dev/lunas/call-another-luna): Call another luna and wait for its answer, send it a message that is delivered later, and list the lunas of a type. - [Use more threads](https://docs.luna.gdrl.dev/lunas/use-more-threads): Hand a luna's data to worker threads with ctx.thread and attach, for work that needs more than one core. - [Write stateless lunas](https://docs.luna.gdrl.dev/lunas/write-stateless-lunas): Define a luna type with no key and no data, whose handlers run many calls at once and reach keyed lunas with ctx.call. - [Share lunas as a package](https://docs.luna.gdrl.dev/lunas/share-lunas-as-a-package): Publish luna types as an npm package with definePackage, and use npm packages in your lunas. - [Write lunas in Python](https://docs.luna.gdrl.dev/lunas/write-lunas-in-python): Define luna types in Python with define_luna and handler decorators, alone or beside TypeScript lunas in one app. ## Data - [Define tables](https://docs.luna.gdrl.dev/data/define-tables): Declare the tables each luna keeps, with their column types, defaults, primary keys, indexes and single-row tables. - [Read and write rows](https://docs.luna.gdrl.dev/data/read-and-write-rows): Find, count, add, change and delete a luna's rows with the typed methods of ctx.db, and page through them. - [Run SQL](https://docs.luna.gdrl.dev/data/run-sql): Run SQL against a luna's own SQLite database with ctx.sql and ctx.exec, undo part of a handler with ctx.transaction, and keep query handlers read-only. - [Change a schema](https://docs.luna.gdrl.dev/data/change-a-schema): Add, rename and remove tables and columns in lunas that already hold data, and move that data with the onMigrate hook. - [Search text](https://docs.luna.gdrl.dev/data/search-text): Find rows by the words they contain with a table's full-text index, with match modes, search as you type, snippets and scores. - [Search vectors](https://docs.luna.gdrl.dev/data/search-vectors): Store embeddings in a vector column and find the rows nearest a vector, exactly or with an index for large tables. - [Search by location](https://docs.luna.gdrl.dev/data/search-by-location): Give a table a spatial index, then find the rows inside a box or nearest a point, on a map or on a plane. - [Walk a graph](https://docs.luna.gdrl.dev/data/walk-a-graph): Keep links between things as rows of a graph table, then find everything reachable from one node and the shortest path between two. - [Query across lunas](https://docs.luna.gdrl.dev/data/query-across-lunas): Keep an index of rows from many lunas' tables or events with defineIndex, read it from handlers and apps, and read your own writes with a bookmark. ## Events and streams - [Emit events](https://docs.luna.gdrl.dev/events/emit-events): Declare an event, emit it from a handler with the handler's writes, and keep it for listeners that come later. - [Listen to events](https://docs.luna.gdrl.dev/events/listen-to-events): Run a handler in one luna of your type for each event, choose which luna by its key, and know how order and retries work. - [React to table changes](https://docs.luna.gdrl.dev/events/react-to-table-changes): Listen to the rows of another luna type's table, pick and filter what arrives, and handle each upsert, delete and clear. - [Keep a stream](https://docs.luna.gdrl.dev/events/keep-a-stream): Append entries to a log in a luna, read it a page at a time by offset, and choose how long entries stay. - [Roll up a stream](https://docs.luna.gdrl.dev/events/roll-up-a-stream): Keep counts, sums and other totals of a stream per hour or day, grouped by a field, for longer than the entries themselves. - [Subscribe to a stream](https://docs.luna.gdrl.dev/events/subscribe-to-a-stream): Run a handler in one luna for each entry of another luna's stream, in order, from where you choose, and stop when you no longer need it. ## Realtime - [Subscribe to a query](https://docs.luna.gdrl.dev/realtime/subscribe-to-a-query): Keep a query's result up to date in an app, as the luna's data changes. - [Open a connection](https://docs.luna.gdrl.dev/realtime/open-a-connection): Keep a WebSocket open between an app and a luna, know who is connected, and run code as apps arrive and leave. - [Push to connected apps](https://docs.luna.gdrl.dev/realtime/push-to-connected-apps): Send typed messages from a luna to the apps connected to it, to all of them or to the ones you tag. - [Follow a stream from an app](https://docs.luna.gdrl.dev/realtime/follow-a-stream-from-an-app): Read a luna's stream in an app from any offset, and follow new entries as they are appended. - [Connect to an outside WebSocket](https://docs.luna.gdrl.dev/realtime/connect-to-an-outside-websocket): Open a WebSocket from a luna to another service, handle each message in a handler, and reopen it when it closes. ## Background work - [Schedule a handler](https://docs.luna.gdrl.dev/background/schedule-a-handler): Run a luna's handler later, at a set time or on a cron, and choose what happens to runs that are missed or overlap. - [Run durable work](https://docs.luna.gdrl.dev/background/run-durable-work): Write handlers whose steps run once each and that carry on after a crash, a restart or a wait of days. - [Wait for a signal](https://docs.luna.gdrl.dev/background/wait-for-a-signal): Pause a durable run until a named signal arrives, send signals to runs, and list, read and cancel a luna's runs. - [Undo steps when a run fails](https://docs.luna.gdrl.dev/background/undo-steps-when-a-run-fails): Give a durable run's steps compensations that undo them, newest first, when the run fails or is cancelled. ## Files and code - [Store files](https://docs.luna.gdrl.dev/files-and-code/store-files): Declare a bucket on a luna type, then store, read, list, copy, move and delete each luna's files from its handlers. - [Upload from an app](https://docs.luna.gdrl.dev/files-and-code/upload-from-an-app): Sign upload and download URLs in a handler, check each upload with onUpload, and serve files from a public bucket. - [Run untrusted code](https://docs.luna.gdrl.dev/files-and-code/run-untrusted-code): Run JavaScript that a customer wrote or a model generated in an isolate, with its own memory, CPU and time limits, and only the tools you give it. - [Run a sandbox](https://docs.luna.gdrl.dev/files-and-code/run-a-sandbox): Give a luna its own Linux machine, run commands in it, read and write its files, size it, and choose what it keeps when it stops. - [Run processes in a sandbox](https://docs.luna.gdrl.dev/files-and-code/run-processes-in-a-sandbox): Start programs in a sandbox that run on after the call that started them, come back to them by name, read their output and send them input and signals. - [Connect to a sandbox](https://docs.luna.gdrl.dev/files-and-code/connect-to-a-sandbox): Open a terminal in a sandbox from an app, reach a port of it, and let people in over SSH, with the luna deciding who may. - [Reach the internet](https://docs.luna.gdrl.dev/files-and-code/reach-the-internet): Call outside APIs from handlers with fetch, turn the internet off for a luna type, give sandboxes and isolates a network, and know which addresses Luna always refuses. ## HTTP - [Serve HTTP routes](https://docs.luna.gdrl.dev/http/serve-http-routes): Give a handler a method and a path of your own, so any HTTP client can call it. - [Stream a response](https://docs.luna.gdrl.dev/http/stream-a-response): Send results while a handler runs, as server-sent events, and read them from an app. - [Receive webhooks](https://docs.luna.gdrl.dev/http/receive-webhooks): Take a signed request from another service, check its signature, answer at once and do the work later, once for each delivery. - [Check who is calling](https://docs.luna.gdrl.dev/http/check-who-is-calling): Check the token your app's users sign in with, and give each call the caller's identity. - [Use your own domain](https://docs.luna.gdrl.dev/http/use-your-own-domain): Serve an environment's HTTP routes on a domain of your own, with a certificate Luna gets and renews. ## Platforms - [Add tenants](https://docs.luna.gdrl.dev/platforms/add-tenants): Give a customer a tenant of their own, with its own code, data, keys and URL, and manage tenants with luna tenants. - [Manage tenants from code](https://docs.luna.gdrl.dev/platforms/manage-tenants-from-code): Create, deploy, limit, copy and delete tenants from a luna with the tenants client, as your customers sign up. - [Call across tenants](https://docs.luna.gdrl.dev/platforms/call-across-tenants): Call a tenant's lunas from your platform, let a tenant call the lunas you grant it, and know what a tenant can never reach. - [Automate with API tokens](https://docs.luna.gdrl.dev/platforms/automate-with-api-tokens): Give CI, scripts and platforms an API token that holds only the scopes, project and environments they need, then rotate or revoke it. - [Read a tenant's API](https://docs.luna.gdrl.dev/platforms/read-a-tenants-api): Fetch the OpenAPI document Luna writes for each tenant from its deployed code, and know what it describes. ## Clients - [TypeScript quickstart](https://docs.luna.gdrl.dev/clients/typescript-quickstart): Add an item to a list and read the list back from a TypeScript program with the Luna client. - [Call lunas from TypeScript](https://docs.luna.gdrl.dev/clients/call-lunas-from-typescript): Create a client, call handlers with typed arguments, read indexes and handle failed calls from a web app or a Node.js program. - [Use Luna with React](https://docs.luna.gdrl.dev/clients/use-luna-with-react): Show a luna's data in React components that re-render when it changes, and show writes before Luna confirms them. - [Work offline](https://docs.luna.gdrl.dev/clients/work-offline): Keep query results on the device, queue writes that survive restarts, and decide what happens to a write the luna refuses. - [Swift quickstart](https://docs.luna.gdrl.dev/clients/swift-quickstart): Add an item to a list and read the list back from a Swift program with the Luna client. - [Call lunas from Swift](https://docs.luna.gdrl.dev/clients/call-lunas-from-swift): Create a Swift client, call handlers, follow live queries in SwiftUI, queue writes offline and handle failed calls. - [Generate a typed client](https://docs.luna.gdrl.dev/clients/generate-a-typed-client): Check handler names, arguments and results at compile time, from your luna types in TypeScript and from a generated file in Swift. - [Call lunas over HTTP](https://docs.luna.gdrl.dev/clients/call-lunas-over-http): Call a handler with a plain HTTP request from any language, read the status and error body, and retry without running a call twice. ## Develop and deploy - [Develop with luna dev](https://docs.luna.gdrl.dev/develop/develop-with-luna-dev): Run your app in an environment of your own that redeploys on every save and prints its log lines as they come. - [Deploy an app](https://docs.luna.gdrl.dev/develop/deploy-an-app): Send your app to an environment with luna deploy, see what a deploy changes before it happens, and confirm a change that could lose data. - [Manage environments](https://docs.luna.gdrl.dev/develop/manage-environments): Create environments, copy code and data into them, point a folder at one, and delete them when you are done. - [Store secrets](https://docs.luna.gdrl.dev/develop/store-secrets): Give an environment's lunas API keys and passwords as secrets, read them with ctx.env, and change them without a redeploy. - [Deploy from CI](https://docs.luna.gdrl.dev/develop/deploy-from-ci): Deploy from a pipeline with a scoped API token, tell the CLI where to deploy with environment variables, and act on its exit codes. - [Restore to an earlier moment](https://docs.luna.gdrl.dev/develop/restore-to-an-earlier-moment): Rewind one luna, every luna of a type or a whole environment to how it was at an earlier moment with luna restore. - [Fork a luna](https://docs.luna.gdrl.dev/develop/fork-a-luna): Copy one luna, as it is now or as it was at an earlier moment, to a new key or into another environment with luna fork. - [Export and import](https://docs.luna.gdrl.dev/develop/export-and-import): Write an environment's lunas to an archive of SQLite files and objects with luna export, and load them into another environment with luna import. - [Browse a luna's data](https://docs.luna.gdrl.dev/develop/browse-a-lunas-data): Find lunas, read and change their rows, manage their files, and look at indexes and sandboxes from the luna CLI. ## Observe - [Check status](https://docs.luna.gdrl.dev/observe/check-status): See an environment's luna types at a glance, or one type in full, with its calls, errors, latency and cost. - [Read logs](https://docs.luna.gdrl.dev/observe/read-logs): Write log lines from a handler, read them with luna logs, narrow them to one luna or call, and follow new lines as they arrive. - [Follow traces](https://docs.luna.gdrl.dev/observe/follow-traces): Follow one request through the lunas it called, find slow and failed calls with luna traces, and add your own spans with OpenTelemetry. - [Track usage](https://docs.luna.gdrl.dev/observe/track-usage): See what your app used and what it cost, from a whole organisation down to one luna, with luna usage and luna billing. ## Organisation - [Invite members](https://docs.luna.gdrl.dev/organisation/invite-members): Invite people to your organisation, give each one a role, and change or remove them later. - [Read the audit log](https://docs.luna.gdrl.dev/organisation/read-the-audit-log): See who changed what in your organisation, filter the record by person, action and time, and read it as JSON. - [Manage billing](https://docs.luna.gdrl.dev/organisation/manage-billing): Read what your organisation has used and spent, see its plan and credit, and set a spending cap and alerts. ## Recipes - [Build a chat room](https://docs.luna.gdrl.dev/recipes/build-a-chat-room): A chat room that apps join under a name, with the latest messages as a live query, pushes when people join and leave, and whispers to one person. - [Build a rate limiter](https://docs.luna.gdrl.dev/recipes/build-a-rate-limiter): A rate limiter with one luna for each thing it limits, allowing a number of calls in each window and saying when to try again, called by a shop before each order. - [Process webhooks reliably](https://docs.luna.gdrl.dev/recipes/process-webhooks-reliably): Receive a payment provider's webhooks on a route, check their signature, ignore repeated deliveries, answer at once and do the work in a durable handler. - [Build a leaderboard](https://docs.luna.gdrl.dev/recipes/build-a-leaderboard): Keep each player's best scores in a luna of their own, rank every player of a game with an index, and show the top ten live in an app. ## Platform - [Limits](https://docs.luna.gdrl.dev/platform/limits): The quotas of the Pay as you go plan and the fixed limits of Luna, with the error each one raises. - [Pricing](https://docs.luna.gdrl.dev/platform/pricing): What Luna bills on the Pay as you go plan, the price of each meter in US dollars, and worked examples of a month. - [Glossary](https://docs.luna.gdrl.dev/platform/glossary): Each term Luna uses in its code, CLI and Console, in one line, with a link to the page that covers it. ## CLI - [The luna CLI](https://docs.luna.gdrl.dev/cli): How every luna command picks the organisation, project and environment it acts on, the settings it reads and the exit codes it ends with. - [luna deploy](https://docs.luna.gdrl.dev/cli/deploy): Deploy the app in this folder to an environment of its project, after checking its types and what the deploy would change. - [luna dev](https://docs.luna.gdrl.dev/cli/dev): Deploy the app in this folder to your own environment, again on every save, and print the environment's log lines. - [luna secrets](https://docs.luna.gdrl.dev/cli/secrets): Set, remove and list the secrets an environment's lunas read as ctx.env. - [luna domains](https://docs.luna.gdrl.dev/cli/domains): Add a domain of your own to an environment, check its DNS records, give it a certificate and remove it. - [luna env](https://docs.luna.gdrl.dev/cli/env): Create, list, select and delete the environments of a project. - [luna tenants](https://docs.luna.gdrl.dev/cli/tenants): Add, list and delete the tenants of an environment, and the host names a tenant answers on. - [luna generate](https://docs.luna.gdrl.dev/cli/generate): Write a typed Swift client for the public luna types of the app in this folder. - [luna sdk](https://docs.luna.gdrl.dev/cli/sdk): Write out Luna's TypeScript, Python or Swift SDK at this CLI's version, and print how to add it to your app. - [luna fork](https://docs.luna.gdrl.dev/cli/fork): Copy a luna, as it is now or as it was at an earlier moment, to a new key or another environment. - [luna export](https://docs.luna.gdrl.dev/cli/export): Write an environment's lunas, as they are now or as they were at an earlier moment, to an archive of SQLite files and file contents. - [luna import](https://docs.luna.gdrl.dev/cli/import): Create lunas in an environment from an archive that luna export wrote. - [luna restore](https://docs.luna.gdrl.dev/cli/restore): Rewind one luna, every luna of a type or a whole environment to an earlier moment. - [luna logs](https://docs.luna.gdrl.dev/cli/logs): Read an environment's log lines, filter them by luna, call, level or text, and follow new ones as they come. - [luna traces](https://docs.luna.gdrl.dev/cli/traces): Read an environment's traces, the spans of its calls with how long each took, filtered by type, handler, errors or duration. - [luna status](https://docs.luna.gdrl.dev/cli/status): See an environment at a glance, a line for each luna type, or one luna type in full with its calls, errors, latency and cost. - [luna indexes](https://docs.luna.gdrl.dev/cli/indexes): List an environment's indexes, see one in full and read the rows of one partition. - [luna data](https://docs.luna.gdrl.dev/cli/data): List a type's lunas, read a page of a luna's table, change, add or delete one row, and let a quarantined luna run again. - [luna files](https://docs.luna.gdrl.dev/cli/files): List, download, upload and delete the files in a luna's buckets, and sign a URL for one. - [luna sandboxes](https://docs.luna.gdrl.dev/cli/sandboxes): List the sandboxes an environment's lunas have, and stop or delete one by hand. - [luna tokens](https://docs.luna.gdrl.dev/cli/tokens): Make, list, rotate and revoke API tokens for CI and platforms, and the account keys that act as you. - [luna keys](https://docs.luna.gdrl.dev/cli/keys): List, make, rotate and revoke the publishable keys and secret tokens that call an environment's lunas. - [luna signup](https://docs.luna.gdrl.dev/cli/signup): Make a Luna account in your browser and log this machine in to it. - [luna login](https://docs.luna.gdrl.dev/cli/login): Log this machine in to your Luna account by approving it in your browser. - [luna logout](https://docs.luna.gdrl.dev/cli/logout): End this machine's login and remove it from the machine. - [luna whoami](https://docs.luna.gdrl.dev/cli/whoami): Show who this machine is logged in as, and the organisation, project and environment commands act on here. - [luna orgs](https://docs.luna.gdrl.dev/cli/orgs): List, make and choose organisations, and invite, change and remove the people in one. - [luna projects](https://docs.luna.gdrl.dev/cli/projects): List, make and delete an organisation's projects, and choose the one a folder uses. - [luna audit](https://docs.luna.gdrl.dev/cli/audit): Read an organisation's audit log, the record of every change made through Luna's API. - [luna usage](https://docs.luna.gdrl.dev/cli/usage): Show what your lunas used and what it cost, a row for each organisation, project, environment, tenant, type or luna. - [luna billing](https://docs.luna.gdrl.dev/cli/billing): Show an organisation's plan, credit and spending limits with a month of usage, and set a spending cap and alerts. - [luna upgrade](https://docs.luna.gdrl.dev/cli/upgrade): Replace the luna CLI with the version Luna runs, or with a version you name. - [luna version](https://docs.luna.gdrl.dev/cli/version): Print the version of the luna CLI. ## SDK - [defineConfig](https://docs.luna.gdrl.dev/sdk/define-config): Name the modules that export your app's luna types, in the app's luna.config.ts. - [defineLuna](https://docs.luna.gdrl.dev/sdk/define-luna): Every option of defineLuna for a keyed or a stateless luna type, its hooks and crons, and the luna type it returns. - [Handler spec](https://docs.luna.gdrl.dev/sdk/handler-spec): The h(spec, run) factory and every field of HandlerSpec, with raw request handlers and streaming handlers. - [t](https://docs.luna.gdrl.dev/sdk/t): The type builders for key fields, columns, handler arguments, results and pushes, their modifiers, and how each value travels as JSON. - [table](https://docs.luna.gdrl.dev/sdk/table): Declare one table of a luna's schema, with its columns, primary key, indexes, and a search, spatial or graph index. - [ctx.db](https://docs.luna.gdrl.dev/sdk/db): Every method of Table and SingleRow, the where operators, and the options and results of find, search, nearest and groupBy. - [ctx](https://docs.luna.gdrl.dev/sdk/ctx): Every member of the ctx a handler or hook receives, grouped by what it does, with its option types and the members of a stateless handler's ctx. - [defineEvent](https://docs.luna.gdrl.dev/sdk/define-event): Declare a typed event that any luna emits with ctx.emit and any luna type hears through its on option. - [defineIndex](https://docs.luna.gdrl.dev/sdk/define-index): Declare an index whose rows Luna keeps from many lunas' tables and events, and read it with ctx.index. - [stream](https://docs.luna.gdrl.dev/sdk/stream): Declare an append-only log in a luna, read and roll it up with ctx.streams, and follow another luna's stream with ctx.subscribe. - [bucket](https://docs.luna.gdrl.dev/sdk/bucket): Declare a bucket of files in a luna, and store, read, list and sign URLs for them with ctx.blobs. - [sandbox](https://docs.luna.gdrl.dev/sdk/sandbox): Declare a Linux sandbox in a luna, and run commands, processes and files in it with ctx.sandboxes. - [isolate](https://docs.luna.gdrl.dev/sdk/isolate): Declare a template for running untrusted JavaScript with limits, and run code in it with ctx.isolates. - [attach](https://docs.luna.gdrl.dev/sdk/attach): Reach a luna's tables from another thread with attach, the Attached object it returns, and the ThreadHandle that ctx.thread() gives. - [definePackage](https://docs.luna.gdrl.dev/sdk/define-package): Mark luna types as coming from an npm package, and the luna field of package.json that makes a deploy carry the package. - [luna/auth](https://docs.luna.gdrl.dev/sdk/auth): Check JWTs, bearer tokens, DPoP proofs, signed cookies, webhook signatures and password hashes in your lunas. - [tenants](https://docs.luna.gdrl.dev/sdk/tenants): Create, deploy, configure, copy and delete the tenants of an environment from a luna's handler. - [Errors](https://docs.luna.gdrl.dev/sdk/errors): The error classes the SDK throws and lets you throw, every kind of system error with its HTTP status, and the codes of JwtError. - [Python SDK](https://docs.luna.gdrl.dev/sdk/python): How each name of the TypeScript SDK maps to the Python SDK, how type hints declare a handler's arguments, and what Python lacks or adds. - [createClient](https://docs.luna.gdrl.dev/sdk/create-client): Make the client an app uses to call lunas, follow live queries and queue writes, from luna/client. - [LunaHandle](https://docs.luna.gdrl.dev/sdk/luna-handle): One luna as an app sees it, with its live queries, writes, pushes, streams and queued writes. - [IndexHandle](https://docs.luna.gdrl.dev/sdk/index-handle): Read one partition of an index live from an app, with find, count, groupBy, search and nearest. - [luna/react](https://docs.luna.gdrl.dev/sdk/react): React hooks over the app client, for live queries, writes, connections, streams and indexes. - [connect](https://docs.luna.gdrl.dev/sdk/connect): Open one raw connection to a luna from Node, to call it, follow queries, hear pushes and send messages to onMessage. - [Swift client](https://docs.luna.gdrl.dev/sdk/swift): Every public type, initialiser and method of the Luna Swift package, for iOS, macOS and the other Apple platforms. - [HTTP calls](https://docs.luna.gdrl.dev/sdk/http-calls): The wire contract for calling a handler without a client, with its path, key encoding, credentials, headers, status codes and error body. ## Errors - [Errors](https://docs.luna.gdrl.dev/errors): The shape of a failed call, how a handler's own errors differ from Luna's, and every error code with its status and whether to retry. - [Cancelled](https://docs.luna.gdrl.dev/errors/cancelled): The durable run your call waited on was cancelled before it finished. - [Closed](https://docs.luna.gdrl.dev/errors/closed): An app's call failed because its connection to the luna, or the client itself, is closed. - [Denied](https://docs.luna.gdrl.dev/errors/denied): A file URL was refused because it has no signature, a wrong or expired one, or one made for something else. - [Internal](https://docs.luna.gdrl.dev/errors/internal): The handler failed with an error it did not declare, so the caller gets no code of its own. - [Invalid](https://docs.luna.gdrl.dev/errors/invalid): The request does not match what the luna type declares, so Luna refused it before any handler ran. - [NoRoom](https://docs.luna.gdrl.dev/errors/no-room): A luna that reserves memory and cores could not open, because no machine had that much free. - [NotFound](https://docs.luna.gdrl.dev/errors/not-found): The luna type, handler, route, file or luna named by the call does not exist for this caller. - [OutOfMemory](https://docs.luna.gdrl.dev/errors/out-of-memory): The luna reached its memory limit during the call, and the same call would fail again. - [OutcomeUnknown](https://docs.luna.gdrl.dev/errors/outcome-unknown): The luna stopped while your call was running, so nobody knows whether its writes were kept. - [Overloaded](https://docs.luna.gdrl.dev/errors/overloaded): Too many calls arrived at once, for one luna, one key, one route or one environment, so Luna turned this one away. - [PaymentRequired](https://docs.luna.gdrl.dev/errors/payment-required): Work in every environment of the organisation is paused until a payment method is added or a payment goes through. - [Quarantined](https://docs.luna.gdrl.dev/errors/quarantined): One luna crashed too often in a short time, so Luna holds it back and refuses calls to it. - [QuotaExceeded](https://docs.luna.gdrl.dev/errors/quota-exceeded): The organisation or tenant reached a quota or its spending cap, so new work stops until a limit changes. - [Suspended](https://docs.luna.gdrl.dev/errors/suspended): Luna suspended the organisation, so every call to its environments is refused. - [Timeout](https://docs.luna.gdrl.dev/errors/timeout): No answer came before the call's deadline, and the call may still run or may have run already. - [Unauthorized](https://docs.luna.gdrl.dev/errors/unauthorized): The call came without a valid publishable key or API token, or with a key that may not be used from there. - [Unavailable](https://docs.luna.gdrl.dev/errors/unavailable): The luna could not run the call right now, and the call never started, so a retry is safe. ## Troubleshooting - [not logged in](https://docs.luna.gdrl.dev/troubleshooting/not-logged-in): A luna command stops with exit code 3 because this machine has no login and no token was given. - [This folder has no environment](https://docs.luna.gdrl.dev/troubleshooting/this-folder-has-no-environment): luna dev stops because the folder's env file names no environment for it to deploy to. - [luna dev never runs in production](https://docs.luna.gdrl.dev/troubleshooting/luna-dev-never-runs-in-production): luna dev and luna deploy --watch refuse the production environment, because they redeploy on every save. - [preflight: nothing was deployed](https://docs.luna.gdrl.dev/troubleshooting/preflight-nothing-was-deployed): A deploy stopped because a schema change cannot apply to the data your lunas already hold. - [preflight: these changes need confirming](https://docs.luna.gdrl.dev/troubleshooting/preflight-these-changes-need-confirming): A deploy that needs your say-so stopped, because nobody was at a terminal to answer. - [is a native addon, which Luna can't deploy](https://docs.luna.gdrl.dev/troubleshooting/native-addon): A deploy stopped because a dependency ships compiled .node code, and lunas run only JavaScript and WebAssembly. - [the app and its dependencies are over the 256 MB limit](https://docs.luna.gdrl.dev/troubleshooting/app-over-the-size-limit): A deploy stopped because the app's code and its installed dependencies together pass 256 MiB. - [Luna needs CPython 3.12 or later](https://docs.luna.gdrl.dev/troubleshooting/luna-needs-cpython-3-12-or-later): A deploy of Python lunas stopped because the CLI found an older Python on this machine. ## Changelog - [Luna 0.0.28 asks before more deploys and lets quarantined lunas out](https://docs.luna.gdrl.dev/changelog/2026-12-01-luna-0-0-28): Deploys confirm more changes and refuse unknown environments, bytes columns read as base64, and a quarantined luna can be released. ## Reference - [Luna API](https://docs.luna.gdrl.dev/reference): The HTTP API of a Luna deployment for developers: accounts, organisations, projects, environments, tenants, deploys, secrets, keys, data, telemetry, usage and… ### Account - [Get sign-in options](https://docs.luna.gdrl.dev/reference/account/auth-options): Returns what a sign-in page can offer before anyone has logged in. No credential is needed. Reference for the GET /_luna/auth/options endpoint in the Luna API. - [Sign up](https://docs.luna.gdrl.dev/reference/account/signup): Creates an account and logs it in. A deployment that is invitation only needs the invite… Reference for the POST /_luna/auth/signup endpoint in the Luna API. - [Log in](https://docs.luna.gdrl.dev/reference/account/login): Starts a session with an email address and a password. No credential is needed. Reference for the POST /_luna/auth/login endpoint in the Luna API. - [Log out](https://docs.luna.gdrl.dev/reference/account/logout): Ends the session the request came with. A key that luna login made is revoked the same… Reference for the POST /_luna/auth/logout endpoint in the Luna API. - [Get the current account](https://docs.luna.gdrl.dev/reference/account/me): Returns who the credential is. An account sees its organisations and its role in each. Reference for the GET /_luna/auth/me endpoint in the Luna API. - [Rename the current account](https://docs.luna.gdrl.dev/reference/account/change-me): Changes the name of the account the credential belongs to. An API key cannot do this. Reference for the PATCH /_luna/auth/me endpoint in the Luna API. - [List account keys](https://docs.luna.gdrl.dev/reference/account/list-account-keys): Lists the keys of your account, newest first. You must be logged in. Key values are never… Reference for the GET /_luna/auth/keys endpoint in the Luna API. - [Create an account key](https://docs.luna.gdrl.dev/reference/account/create-account-key): Creates a key that acts as your account, with the roles you hold when the key is used. You… Reference for the POST /_luna/auth/keys endpoint in the Luna API. - [Revoke an account key](https://docs.luna.gdrl.dev/reference/account/revoke-account-key): Revokes one of your account's keys. It stops working at once. You must be logged in. Reference for the DELETE /_luna/auth/keys/{id} endpoint in the Luna API. - [Start a device login](https://docs.luna.gdrl.dev/reference/account/device-start): Starts a login for a device with no browser, such as the CLI. Show the person userCode… Reference for the POST /_luna/auth/device endpoint in the Luna API. - [Collect a device login](https://docs.luna.gdrl.dev/reference/account/device-token): Polls a device login. Until the person decides, it answers 400 with error.code set… Reference for the POST /_luna/auth/device/token endpoint in the Luna API. - [Accept an invitation by code](https://docs.luna.gdrl.dev/reference/account/accept-invite): Joins the organisation an invitation is for, using the code from its link. The… Reference for the POST /_luna/auth/invites/accept endpoint in the Luna API. - [Accept an invitation](https://docs.luna.gdrl.dev/reference/account/accept-my-invite): Joins the organisation that an open invitation to your email address is for.… Reference for the POST /_luna/auth/invites/{id}/accept endpoint in the Luna API. - [Decline an invitation](https://docs.luna.gdrl.dev/reference/account/decline-my-invite): Turns down an open invitation to your email address. The invitation stops… Reference for the POST /_luna/auth/invites/{id}/decline endpoint in the Luna API. - [List notifications](https://docs.luna.gdrl.dev/reference/account/list-notifications): Lists what happened to your account's place in organisations, with open invitations… Reference for the GET /_luna/auth/notifications endpoint in the Luna API. - [Mark notifications as read](https://docs.luna.gdrl.dev/reference/account/read-notifications): Marks every notification of your account as read. Open invitations stay… Reference for the POST /_luna/auth/notifications/read endpoint in the Luna API. ### Organisations - [List organisations](https://docs.luna.gdrl.dev/reference/organisations/list-orgs): Lists the organisations your account is a member of, with your role in each. An API key cannot… Reference for the GET /_luna/orgs endpoint in the Luna API. - [Create an organisation](https://docs.luna.gdrl.dev/reference/organisations/create-org): Creates an organisation and makes your account its owner. Luna makes the slug from the name.… Reference for the POST /_luna/orgs endpoint in the Luna API. - [Get an organisation](https://docs.luna.gdrl.dev/reference/organisations/get-org): Returns an organisation you are a member of, or one your API key belongs to. Reference for the GET /_luna/orgs/{org} endpoint in the Luna API. - [Delete an organisation](https://docs.luna.gdrl.dev/reference/organisations/delete-org): Deletes an organisation that has no projects left. Only an owner can do this. Reference for the DELETE /_luna/orgs/{org} endpoint in the Luna API. - [Update an organisation](https://docs.luna.gdrl.dev/reference/organisations/change-org): Changes an organisation's name, its slug or both. A new slug changes the organisation's… Reference for the PATCH /_luna/orgs/{org} endpoint in the Luna API. - [Read the audit log](https://docs.luna.gdrl.dev/reference/organisations/read-audit): Returns a page of an organisation's audit log, oldest first. The log records every… Reference for the GET /_luna/orgs/{org}/audit endpoint in the Luna API. ### Members - [List members](https://docs.luna.gdrl.dev/reference/members/list-members): Lists the people in an organisation with the role each one holds. Reference for the GET /_luna/orgs/{org}/members endpoint in the Luna API. - [Change a member's role](https://docs.luna.gdrl.dev/reference/members/set-member): Gives a member a new role. Only an owner can make or change an owner, and… Reference for the PUT /_luna/orgs/{org}/members/{account} endpoint in the Luna API. - [Remove a member](https://docs.luna.gdrl.dev/reference/members/remove-member): Removes a member from an organisation. You can remove yourself without… Reference for the DELETE /_luna/orgs/{org}/members/{account} endpoint in the Luna API. - [List invitations](https://docs.luna.gdrl.dev/reference/members/list-invites): Lists an organisation's open invitations, with the ones that have expired.… Reference for the GET /_luna/orgs/{org}/invites endpoint in the Luna API. - [Invite a member](https://docs.luna.gdrl.dev/reference/members/invite-member): Invites an email address to an organisation. An address has one open invitation at… Reference for the POST /_luna/orgs/{org}/invites endpoint in the Luna API. - [Revoke an invitation](https://docs.luna.gdrl.dev/reference/members/revoke-invite): Withdraws an open invitation. Its link and code stop working. Reference for the DELETE /_luna/orgs/{org}/invites/{id} endpoint in the Luna API. - [Resend an invitation](https://docs.luna.gdrl.dev/reference/members/resend-invite): Replaces an invitation with a new one for the same address and role.… Reference for the POST /_luna/orgs/{org}/invites/{id}/resend endpoint in the Luna API. ### Projects - [List projects](https://docs.luna.gdrl.dev/reference/projects/list-projects): Lists the projects of an organisation that your credential can see. Reference for the GET /_luna/orgs/{org}/projects endpoint in the Luna API. - [Create a project](https://docs.luna.gdrl.dev/reference/projects/create-project): Creates a project in an organisation, with its production environment. Luna makes… Reference for the POST /_luna/orgs/{org}/projects endpoint in the Luna API. - [Get a project](https://docs.luna.gdrl.dev/reference/projects/get-project): Returns one project. Its root is the name of its production tenant. Reference for the GET /_luna/orgs/{org}/projects/{project} endpoint in the Luna API. - [Delete a project](https://docs.luna.gdrl.dev/reference/projects/delete-project): Deletes a project with its environments, its tenants and all their… Reference for the DELETE /_luna/orgs/{org}/projects/{project} endpoint in the Luna API. - [Update a project](https://docs.luna.gdrl.dev/reference/projects/change-project): Changes a project's name, its slug or both. Its tenants keep their… Reference for the PATCH /_luna/orgs/{org}/projects/{project} endpoint in the Luna API. - [Resolve a project path](https://docs.luna.gdrl.dev/reference/projects/resolve): Returns the project that an organisation/project path names. The CLI uses this to find a… Reference for the GET /_luna/resolve endpoint in the Luna API. ### Environments - [List environments](https://docs.luna.gdrl.dev/reference/environments/list-environments): Lists a project's environments. Each one names its default… Reference for the GET /_luna/orgs/{org}/projects/{project}/environments endpoint in the Luna API. - [Create an environment](https://docs.luna.gdrl.dev/reference/environments/create-environment): Creates an environment in a project, empty or as a copy of… Reference for the POST /_luna/orgs/{org}/projects/{project}/environments endpoint in the Luna API. - [Get an environment](https://docs.luna.gdrl.dev/reference/environments/get-environment): Returns one environment with the progress of the data… Reference for the GET /_luna/orgs/{org}/projects/{project}/environments/{env} endpoint in the Luna API. - [Delete an environment](https://docs.luna.gdrl.dev/reference/environments/delete-environment): Deletes an environment with its tenants and all… Reference for the DELETE /_luna/orgs/{org}/projects/{project}/environments/{env} endpoint in the Luna API. - [Retry a data copy](https://docs.luna.gdrl.dev/reference/environments/retry-copy): Goes on with a failed copy of data into an… Reference for the POST /_luna/orgs/{org}/projects/{project}/environments/{env}/copy endpoint in the Luna API. ### Tenants - [List tenants](https://docs.luna.gdrl.dev/reference/tenants/list-tenants): Returns the tenants of an environment, in order of name. Name the environment in parent. Only… Reference for the GET /_luna/tenants endpoint in the Luna API. - [Create a tenant](https://docs.luna.gdrl.dev/reference/tenants/create-tenant): Adds a tenant to an environment. A tenant has its own lunas, data, keys and secrets, apart… Reference for the POST /_luna/tenants endpoint in the Luna API. - [Get a tenant](https://docs.luna.gdrl.dev/reference/tenants/describe-tenant): Returns a tenant: the version it runs, its settings, the limits that hold for it, its… Reference for the GET /_luna/tenants/{tenant} endpoint in the Luna API. - [Replace a tenant's settings](https://docs.luna.gdrl.dev/reference/tenants/configure-tenant): Replaces a tenant's settings with the ones you send: its quotas, custom hostnames,… Reference for the PUT /_luna/tenants/{tenant} endpoint in the Luna API. - [Delete a tenant](https://docs.luna.gdrl.dev/reference/tenants/delete-tenant): Deletes a tenant with its lunas, their data, its versions, keys and secrets. This… Reference for the DELETE /_luna/tenants/{tenant} endpoint in the Luna API. - [Deploy source files to a tenant](https://docs.luna.gdrl.dev/reference/tenants/deploy-tenant): Builds source files and deploys them to a tenant you added to an environment.… Reference for the POST /_luna/tenants/{tenant}/deploy endpoint in the Luna API. - [Restore lunas to an earlier moment](https://docs.luna.gdrl.dev/reference/tenants/restore-tenant): Puts lunas back as they were at a moment in the past: one luna, every luna… Reference for the POST /_luna/tenants/{tenant}/restore endpoint in the Luna API. - [Fork a luna](https://docs.luna.gdrl.dev/reference/tenants/fork-tenant): Makes a new luna that starts from another luna's data, as it is now or as it… Reference for the POST /_luna/tenants/{tenant}/fork endpoint in the Luna API. - [Copy every luna to another tenant](https://docs.luna.gdrl.dev/reference/tenants/fork-all): Copies the lunas of a tenant into another tenant, as they are now or as… Reference for the POST /_luna/tenants/{tenant}/fork-all endpoint in the Luna API. - [Get a tenant's OpenAPI document](https://docs.luna.gdrl.dev/reference/tenants/tenant-openapi): Returns an OpenAPI 3.1 document that describes how to call the tenant's… Reference for the GET /_luna/tenants/{tenant}/openapi.json endpoint in the Luna API. ### Deploys - [Deploy an app](https://docs.luna.gdrl.dev/reference/deploys/deploy): Deploys a built app to a tenant as its next version. The request names the entry modules,… Reference for the POST /_luna/deploy endpoint in the Luna API. - [Preview a deploy](https://docs.luna.gdrl.dev/reference/deploys/preflight): Says what deploying an app would do, without deploying it: every change, what blocks the… Reference for the POST /_luna/preflight endpoint in the Luna API. ### Secrets - [List secrets](https://docs.luna.gdrl.dev/reference/secrets/list-secrets): Returns the names of a tenant's secrets. A secret's value is never read back. Reference for the GET /_luna/secrets/{tenant} endpoint in the Luna API. - [Set a secret](https://docs.luna.gdrl.dev/reference/secrets/put-secret): Sets a secret of a tenant to the text in the body. The tenant's code reads it… Reference for the PUT /_luna/secrets/{tenant}/{name} endpoint in the Luna API. - [Delete a secret](https://docs.luna.gdrl.dev/reference/secrets/delete-secret): Removes a secret from a tenant. This deploys a new version with the same… Reference for the DELETE /_luna/secrets/{tenant}/{name} endpoint in the Luna API. ### Domains - [List domains](https://docs.luna.gdrl.dev/reference/domains/list-domains): Returns a tenant's custom domains: where each stands and the DNS records it needs. Reference for the GET /_luna/domains/{tenant} endpoint in the Luna API. - [Add a domain](https://docs.luna.gdrl.dev/reference/domains/add-domain): Adds a domain of your own to a tenant. Its HTTP routes are served there once the… Reference for the POST /_luna/domains/{tenant} endpoint in the Luna API. - [Remove a domain](https://docs.luna.gdrl.dev/reference/domains/remove-domain): Removes a domain from a tenant. Its requests stop reaching the tenant… Reference for the DELETE /_luna/domains/{tenant}/{name} endpoint in the Luna API. - [Verify a domain](https://docs.luna.gdrl.dev/reference/domains/verify-domain): Looks up the domain's DNS records now, rather than at Luna's next… Reference for the POST /_luna/domains/{tenant}/{name}/verify endpoint in the Luna API. - [Upload a certificate](https://docs.luna.gdrl.dev/reference/domains/upload-certificate): Serves a certificate you supply for the domain, for a deployment… Reference for the PUT /_luna/domains/{tenant}/{name}/certificate endpoint in the Luna API. ### App keys - [List app keys](https://docs.luna.gdrl.dev/reference/app-keys/list-keys): Returns the credentials an app's callers use to reach a tenant: its publishable… Reference for the GET /_luna/tenants/{tenant}/keys endpoint in the Luna API. - [Create an app key](https://docs.luna.gdrl.dev/reference/app-keys/create-key): Makes another publishable key or secret token for a tenant, with its own rules:… Reference for the POST /_luna/tenants/{tenant}/keys endpoint in the Luna API. - [Revoke an app key](https://docs.luna.gdrl.dev/reference/app-keys/revoke-key): Ends a key at once, including for connections that are open with it. A… Reference for the DELETE /_luna/tenants/{tenant}/keys/{id} endpoint in the Luna API. - [Update an app key](https://docs.luna.gdrl.dev/reference/app-keys/change-key): Changes a key's name or rules. Only the fields you send change. The main… Reference for the PATCH /_luna/tenants/{tenant}/keys/{id} endpoint in the Luna API. - [Rotate an app key](https://docs.luna.gdrl.dev/reference/app-keys/rotate-key): Makes a replacement for a key or token. The old one keeps working… Reference for the POST /_luna/tenants/{tenant}/keys/{id}/rotate endpoint in the Luna API. ### API keys - [List API keys](https://docs.luna.gdrl.dev/reference/api-keys/list-tokens): Returns the API keys you manage, without the keys themselves. Each one says what it can do,… Reference for the GET /_luna/tokens endpoint in the Luna API. - [Create an API key](https://docs.luna.gdrl.dev/reference/api-keys/create-token): Makes a key for a program to use, such as a deploy from CI. The key holds only the permissions… Reference for the POST /_luna/tokens endpoint in the Luna API. - [Revoke an API key](https://docs.luna.gdrl.dev/reference/api-keys/revoke-token): Ends an API key at once. Requests that send it are refused from then on. Reference for the DELETE /_luna/tokens/{id} endpoint in the Luna API. - [Rotate an API key](https://docs.luna.gdrl.dev/reference/api-keys/rotate-token): Makes a replacement for an API key, with the same permissions and reach. The old… Reference for the POST /_luna/tokens/{id}/rotate endpoint in the Luna API. ### Data - [List the lunas of a type](https://docs.luna.gdrl.dev/reference/data/list-lunas): Returns a page of the lunas of one type, by their keys. With search, the… Reference for the GET /_luna/tenants/{tenant}/lunas/{type} endpoint in the Luna API. - [Let a quarantined luna run again](https://docs.luna.gdrl.dev/reference/data/release-luna): A luna that crashes again and again is quarantined: it refuses… Reference for the POST /_luna/tenants/{tenant}/lunas/{type}/release endpoint in the Luna API. - [List the rows of a table](https://docs.luna.gdrl.dev/reference/data/list-rows): Returns a page of one table of one luna, in rowid order. Each… Reference for the GET /_luna/tenants/{tenant}/data/{type}/{table} endpoint in the Luna API. - [Add a row](https://docs.luna.gdrl.dev/reference/data/insert-row): Adds a row to one table of one luna and returns it. The table… Reference for the POST /_luna/tenants/{tenant}/data/{type}/{table} endpoint in the Luna API. - [Delete a row](https://docs.luna.gdrl.dev/reference/data/delete-row): Deletes one row of one table of one luna. You cannot… Reference for the DELETE /_luna/tenants/{tenant}/data/{type}/{table}/{rowid} endpoint in the Luna API. - [Change a value in a row](https://docs.luna.gdrl.dev/reference/data/update-row): Sets one column of one row and returns the row. You… Reference for the PATCH /_luna/tenants/{tenant}/data/{type}/{table}/{rowid} endpoint in the Luna API. - [List the files in a folder](https://docs.luna.gdrl.dev/reference/data/list-files): Returns one folder of one bucket of one luna: the folders… Reference for the GET /_luna/tenants/{tenant}/files/{type}/{bucket} endpoint in the Luna API. - [Delete a file](https://docs.luna.gdrl.dev/reference/data/delete-file): Deletes one file from a bucket of one luna. Reference for the DELETE /_luna/tenants/{tenant}/files/{type}/{bucket} endpoint in the Luna API. - [Sign a URL for a file](https://docs.luna.gdrl.dev/reference/data/sign-file): Returns a signed URL that downloads one file or, with… Reference for the POST /_luna/tenants/{tenant}/files/{type}/{bucket}/sign endpoint in the Luna API. - [Read an index](https://docs.luna.gdrl.dev/reference/data/read-index): Reads one partition of an index through the index's own read handler,… Reference for the GET /_luna/tenants/{tenant}/indexes/{index} endpoint in the Luna API. - [List the sandboxes](https://docs.luna.gdrl.dev/reference/data/list-sandboxes): Returns every sandbox the tenant's lunas have: those running on any node,… Reference for the GET /_luna/tenants/{tenant}/sandboxes endpoint in the Luna API. - [Delete a sandbox](https://docs.luna.gdrl.dev/reference/data/delete-sandbox): Stops a sandbox if it is running and deletes it with its… Reference for the DELETE /_luna/tenants/{tenant}/sandboxes/{type}/{name} endpoint in the Luna API. - [Stop a sandbox](https://docs.luna.gdrl.dev/reference/data/stop-sandbox): Powers a running sandbox off and keeps its disks, as… Reference for the POST /_luna/tenants/{tenant}/sandboxes/{type}/{name}/stop endpoint in the Luna API. ### Telemetry - [Query logs](https://docs.luna.gdrl.dev/reference/telemetry/query-logs): Returns a tenant's log lines over a span of time, oldest first: the lines your… Reference for the GET /_luna/telemetry/{tenant}/logs endpoint in the Luna API. - [Tail logs](https://docs.luna.gdrl.dev/reference/telemetry/tail-logs): Returns the log lines written since a cursor, oldest first, and a new… Reference for the GET /_luna/telemetry/{tenant}/logs/tail endpoint in the Luna API. - [Query traces](https://docs.luna.gdrl.dev/reference/telemetry/query-traces): Returns the spans of a tenant's calls over a span of time, oldest first.… Reference for the GET /_luna/telemetry/{tenant}/traces endpoint in the Luna API. - [Query metrics](https://docs.luna.gdrl.dev/reference/telemetry/query-metrics): Returns a tenant's metrics over a span of time: calls, errors and latency,… Reference for the GET /_luna/telemetry/{tenant}/metrics endpoint in the Luna API. ### Usage - [Get usage and its cost](https://docs.luna.gdrl.dev/reference/usage/get-usage): Returns what was used and what it cost in US dollars, from a whole organisation down to one… Reference for the GET /_luna/usage endpoint in the Luna API. - [Get a tenant's usage](https://docs.luna.gdrl.dev/reference/usage/get-tenant-usage): Returns what one tenant used hour by hour, with the hour in progress and the… Reference for the GET /_luna/tenants/{tenant}/usage endpoint in the Luna API. - [Get an organisation's usage](https://docs.luna.gdrl.dev/reference/usage/get-organisation-usage): Returns what an organisation used hour by hour and what each hour cost in US dollars,… Reference for the GET /_luna/orgs/{org}/usage endpoint in the Luna API. ### Billing - [Get the billing summary](https://docs.luna.gdrl.dev/reference/billing/get-billing): Returns an organisation's plan with its prices and limits, its credit, what this… Reference for the GET /_luna/orgs/{org}/billing endpoint in the Luna API. - [Set spending limits](https://docs.luna.gdrl.dev/reference/billing/set-billing-limits): Replaces the limits an organisation sets on its own spending: a cap for the… Reference for the PUT /_luna/orgs/{org}/billing/limits endpoint in the Luna API. - [Get what is in use now](https://docs.luna.gdrl.dev/reference/billing/get-billing-in-use): Returns what an organisation is using right now against what its plan… Reference for the GET /_luna/orgs/{org}/billing/in-use endpoint in the Luna API. - [Get a month's bill](https://docs.luna.gdrl.dev/reference/billing/get-billing-month): Returns one month of an organisation meter by meter: what it used, what its… Reference for the GET /_luna/orgs/{org}/billing/usage endpoint in the Luna API. - [Start a checkout](https://docs.luna.gdrl.dev/reference/billing/start-checkout): Starts a Stripe Checkout session that puts a card on file for the plan… Reference for the POST /_luna/orgs/{org}/billing/checkout endpoint in the Luna API. - [Open the billing portal](https://docs.luna.gdrl.dev/reference/billing/open-billing-portal): Starts a Stripe billing portal session, where the organisation changes its… Reference for the POST /_luna/orgs/{org}/billing/portal endpoint in the Luna API. - [Get the payment details](https://docs.luna.gdrl.dev/reference/billing/get-payment-details): Returns the card on file and who is billed, as Stripe has them. Luna keeps… Reference for the GET /_luna/orgs/{org}/billing/details endpoint in the Luna API. - [List the plans](https://docs.luna.gdrl.dev/reference/billing/list-plans): Returns the plans an organisation may choose, in the order they are offered, with the… Reference for the GET /_luna/orgs/{org}/plans endpoint in the Luna API. - [Choose a plan](https://docs.luna.gdrl.dev/reference/billing/choose-plan): Moves an organisation to another plan. The change takes effect at once and… Reference for the POST /_luna/orgs/{org}/billing/plan endpoint in the Luna API. ### General - [List permissions](https://docs.luna.gdrl.dev/reference/general/list-permissions): Returns every permission, the roles a person can hold and the presets an API key can start… Reference for the GET /_luna/permissions endpoint in the Luna API. - [Get the OpenAPI document](https://docs.luna.gdrl.dev/reference/general/openapi-json): Returns this API as an OpenAPI 3.1 document. No credential is needed. Reference for the GET /_luna/openapi.json endpoint in the Luna API. ## Releases - [Releases](https://docs.luna.gdrl.dev/releases): Every version of Luna, newest first. - [Luna 0.0.27](https://docs.luna.gdrl.dev/releases/v0-0-27): Luna 0.0.27 - [Luna 0.0.26](https://docs.luna.gdrl.dev/releases/v0-0-26): Luna 0.0.26 - [Luna 0.0.25](https://docs.luna.gdrl.dev/releases/v0-0-25): Luna 0.0.25 - [Luna 0.0.24](https://docs.luna.gdrl.dev/releases/v0-0-24): Luna 0.0.24 - [Luna 0.0.23](https://docs.luna.gdrl.dev/releases/v0-0-23): Luna 0.0.23 - [Luna 0.0.22](https://docs.luna.gdrl.dev/releases/v0-0-22): Luna 0.0.22 - [Luna 0.0.21](https://docs.luna.gdrl.dev/releases/v0-0-21): Luna 0.0.21 - [Luna 0.0.20](https://docs.luna.gdrl.dev/releases/v0-0-20): Luna 0.0.20 - [Luna 0.0.19](https://docs.luna.gdrl.dev/releases/v0-0-19): Luna 0.0.19 - [Luna 0.0.18](https://docs.luna.gdrl.dev/releases/v0-0-18): Luna 0.0.18 - [Luna 0.0.17](https://docs.luna.gdrl.dev/releases/v0-0-17): Luna 0.0.17 - [Luna 0.0.16](https://docs.luna.gdrl.dev/releases/v0-0-16): Luna 0.0.16 - [Luna 0.0.11](https://docs.luna.gdrl.dev/releases/v0-0-11): Luna 0.0.11 - [Luna 0.0.10](https://docs.luna.gdrl.dev/releases/v0-0-10): Luna 0.0.10 - [Luna 0.0.9](https://docs.luna.gdrl.dev/releases/v0-0-9): Luna 0.0.9 - [Luna 0.0.8](https://docs.luna.gdrl.dev/releases/v0-0-8): Luna 0.0.8 - [Luna 0.0.7](https://docs.luna.gdrl.dev/releases/v0-0-7): Luna 0.0.7 - [Luna 0.0.6](https://docs.luna.gdrl.dev/releases/v0-0-6): Luna 0.0.6 - [Luna 0.0.5](https://docs.luna.gdrl.dev/releases/v0-0-5): Luna 0.0.5 - [Luna 0.0.4](https://docs.luna.gdrl.dev/releases/v0-0-4): Luna 0.0.4 - [Luna 0.0.3](https://docs.luna.gdrl.dev/releases/v0-0-3): Luna 0.0.3 - [Luna 0.0.2](https://docs.luna.gdrl.dev/releases/v0-0-2): Luna 0.0.2 - [Luna 0.0.14](https://docs.luna.gdrl.dev/releases/v0-0-14): Luna 0.0.14 - [Luna 0.0.1](https://docs.luna.gdrl.dev/releases/v0-0-1): Luna 0.0.1 ## RSS Feeds - [Luna — Changelog](https://docs.luna.gdrl.dev/changelog/rss.xml) ## Agent skills - [luna](https://docs.luna.gdrl.dev/.well-known/agent-skills/luna/SKILL.md): Read the Luna docs instead of answering from memory. Documentation for Luna. Use when a task involves Luna: how it works, how to set it up or configure it, or its API. ## Agent resources - [llms-full.txt](https://docs.luna.gdrl.dev/llms-full.txt): The full Markdown of every page in one file. - [Page Markdown](https://docs.luna.gdrl.dev/index.md): Append `.md` to any page URL to fetch that page as raw Markdown. - [JSON API](https://docs.luna.gdrl.dev/api/docs/pages.json): Page index of the JSON docs API; each entry links the page's JSON and Markdown forms. Described by the OpenAPI document at https://docs.luna.gdrl.dev/openapi.json. - [Agent skills](https://docs.luna.gdrl.dev/.well-known/agent-skills/index.json): Agent Skills discovery index of the skills this site publishes. - [API catalog](https://docs.luna.gdrl.dev/.well-known/api-catalog): RFC 9727 linkset of the APIs documented here. - [AI catalog](https://docs.luna.gdrl.dev/.well-known/ai-catalog.json): ARD manifest of the agent-facing resources on this site (MCP server, skills, APIs). - [agent-readability.json](https://docs.luna.gdrl.dev/agent-readability.json): Manifest of every agent-facing artifact on this site. - [Sitemap](https://docs.luna.gdrl.dev/sitemap.xml): Every indexable page URL with its last-modified date.