https://api.ornn.com from your application using an organization API key. You do not need to install or sign in with the Ornn CLI.
This reference covers every operation an API key can perform: authentication, reservation and node discovery, VM and Bare Metal access, Kubernetes and Slurm clusters, SSH keys, storage volumes and GitHub repositories, private networks, monitoring, buying and selling capacity (Reserve, Market, Spot, and Relist), and billing. Each endpoint includes request parameters, response schemas, and examples in multiple languages. Examples use fictional IDs and credentials; replace them with your own values.
Download OpenAPI
Import the OpenAPI 3.1 contract into Postman, Swagger tools, or a compatible client generator.
Create an API key
Create, use, rotate, and revoke keys, and see what a key can and cannot do.
Kubernetes integration
Create a cluster, retrieve access, run a GPU Job through the Python client, and manage workers.
CLI and REST equivalents
Translate each
ornn command into the REST request that does the same job./commerce and /v1; there is no additional shared path prefix.
Authenticate
Create a key in Account Settings → Developer, then supply it as a bearer token:organizations array contains exactly the key’s organization. You do not need an organization header. A key does not bypass organization approval, reservation ownership, payment, or node eligibility requirements. It cannot manage accounts, teams, or API keys; those routes return 403 with api_key_requires_session.
Keep keys in your server’s secret store; do not embed them in a browser application or a public repository. Browsers on other sites cannot call api.ornn.com directly, so call the API from server code, a job runner, or CI.
Choose the API for the operation
Ornn’s documented customer provisioning interface is REST over HTTPS. This contract does not define a GraphQL endpoint or a public gRPC service. You can use Kubernetes client libraries to manage workloads without shelling out to a command-line tool. If your integration requires a specific gRPC protocol, such as the Kubernetes Cluster Autoscaler’s external gRPC provider, share the client and protocol with Ornn before building against it.
The cluster endpoints create Ornn-managed clusters on capacity your organization already holds. They do not purchase GPUs, attach workers to an existing EKS/GKE cluster, or automatically increase purchased capacity when pods are pending.
Integration sequence
- Check authentication and confirm the returned organization and its
approvedflag. - List reservations and inspect their nodes. Confirm eligible capacity before launch; see the cluster prerequisites.
- For Slurm, VM, or Bare Metal access, add an organization SSH key. Kubernetes API access does not need one.
- Create a cluster with explicit worker IDs, then poll its state.
- Retrieve cluster access. Connect a Kubernetes client using the supplied server, credentials, and namespace; verify worker readiness and run a GPU workload through the cluster’s Kubernetes API, as the Kubernetes REST walkthrough shows.
- Add or remove existing workers as needed. Tear down the cluster when finished; teardown does not cancel the capacity reservation.
Request conventions
Handle asynchronous operations
A202 Accepted response means the request was accepted, not that the cluster or worker is ready. Save the returned ID and poll cluster state. Creation returns the cluster ID as id; worker changes return controller_id and node_id or virtual_machine_id.
The paths use controllers for cluster resources. Use the returned cluster id in those paths, not a reservation ID. Reservation discovery uses reservationId; cluster requests use reservation_id.
SSH-key changes are also asynchronous. A successful assignment or push means delivery is queued. Wait until the key’s fingerprint appears in authorized_key_fingerprints on the reservation’s nodes before you connect.
Poll every five seconds with a deadline. Stop on a terminal failure and preserve the response for diagnosis. A timeout is an unknown outcome: inspect current state before repeating a mutation.
Pagination
List endpoints return one page at a time and an opaque cursor for the next page. Pass the cursor back unchanged, keep the same filters, and stop when it is absent, null, or empty. Don’t build or edit cursors.
Cluster lists have no cursor or lookup by ID. A missing entry does not prove deletion or completed teardown. Stop and contact Ornn if the cluster you are tracking is absent unexpectedly.
Errors
Check the HTTP status first, then read the body. Error bodies come in these shapes:- Customer errors carry a stable
detail.codefor your logic and adetail.messageyou can show to people. - Access denials carry a top-level
code:unauthenticated(401),not_memberornot_approved(403), andsession_contract_unavailable(503) when a route is not available to API callers. Don’t retrysession_contract_unavailable. - Rate limits carry
retry_afterand aRetry-Afterheader. - Some routes return only a string
detail, anerrorstring, or a body that isn’t JSON. Tolerate all of these.
Do not log API keys or cluster credentials when collecting errors.
Rate limits
Ornn limits requests per user and per source IP address in one-minute windows. An API key counts toward its creator’s user budget, shared with that person’s other keys and console sessions. These are the current budgets; they can change, so rely on429 responses rather than hard-coding them.
Exceeding the per-IP write limit under
/commerce blocks that address for those writes for five minutes. Exceeding other limits returns 429 until the window resets. A 429 from the per-IP limits may not include Retry-After.
Spread polling across your fleet, poll every five seconds rather than continuously, and cache reads such as reservation lists between runs.
Retries and idempotency
Retry reads (GET) with exponential backoff and jitter. Before retrying a write that timed out, read current state; the first attempt may have succeeded.
Some writes accept an Idempotency-Key header that makes a retry safe. Generate a new UUID for each logical operation and reuse it only when retrying that exact request. Keys are scoped to your organization and kept for 24 hours.
A
409 on a retry with the same key can also mean the first attempt is still running. Wait, then retry with the same key.