Skip to main content

naos api

The control plane of naos. It owns Runs and the immutable policy each Run is created with, the image catalog, the profiles and the audit trail, and it is the only thing runners talk to: they register, lease Runs, report transitions and push events through it.

The service is FastAPI over SQLModel, with no state of its own besides the database. Operator routes live under /api/v1 behind a bearer token, the runner interface under /api/v1/runners behind a token each runner is issued at registration.

Install

pip install "naos-api[server]"

The server extra adds uvicorn and the psycopg driver, which the library itself does not need. The published image carries both:

docker pull ghcr.io/oberon-systems/naos-api

Configure

Settings are read from NAOS_* environment variables once per process. Both token settings hold a SHA-256, never the token; while one is unset, the routes behind it answer 401.

Variable Default Meaning
NAOS_DATABASE_URL required For example postgresql+psycopg://naos@db.example.com/naos
NAOS_DATABASE_AUTO_MIGRATE false Bring an empty database to the schema on start
NAOS_ALLOWED_MOUNT_ROOTS [] Host directories a mount policy may name
NAOS_OPERATOR_TOKEN_SHA256 unset SHA-256 of the operator token
NAOS_RUNNER_ENROLLMENT_TOKEN_SHA256 unset SHA-256 of the enrollment token
NAOS_LEASE_TTL_SECONDS 60 Lease extension per heartbeat, 5 to 3600

The full table, the endpoints and the runner interface are in docs/03-api-design.md.

Run

export NAOS_DATABASE_URL=postgresql+psycopg://naos@127.0.0.1/naos
export NAOS_OPERATOR_TOKEN_SHA256=$(printf %s "$NAOS_OPERATOR_TOKEN" | sha256sum | cut -d' ' -f1)
naos-api migrate
uvicorn --factory naos_api.app:create_app --host 127.0.0.1

create_app() builds the application and starts the background sweep that expires runner leases. It refuses to start on a database that is not at the schema this package ships; naos-api migrate brings it there, see Schema.

Metadata

Release files for naos-api 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for naos-api 0.2.0
File Size Uploaded Provenance Actions
naos_api-0.2.0.tar.gz 109.5 kB With provenance Details for naos_api-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for naos-api 0.2.0
File Interpreter ABI Platform Actions
naos_api-0.2.0-py3-none-any.whl Python 3 none any Details for naos_api-0.2.0-py3-none-any.whl

Total release size: 190.7 kB

Release files / naos_api-0.2.0.tar.gz

Download URL naos_api-0.2.0.tar.gz
Size 109.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a2d50349a63a515b34c6a582d6db0750a7f1cf8f6dc9ddcaf973ac5b76c1c747
BLAKE2b-256 checksum
How to use checksums
d35282aab550223aff928043dcce9b0054e5bc9123f18a1700ed7d5b9939a89d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / naos_api-0.2.0-py3-none-any.whl

Download URL naos_api-0.2.0-py3-none-any.whl
Size 81.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b69afd32548e4127dba88f81d7d86f41289d0752a60f45d41595e5ef5ccedfcc
BLAKE2b-256 checksum
How to use checksums
29d670bbb26ab603d7b533457d6f11539afc40df78e81bb081bd8bc1f5569b86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Security for naos-api 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for naos_api-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page