Create a Environment
const url = 'https://example.com/apis/nodus.dev/v1/namespaces/example/environments';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"apiVersion":"example","kind":"example","metadata":{"annotations":{"additionalProperty":"example"},"creationTimestamp":"example","deletionGracePeriodSeconds":1,"deletionTimestamp":"example","finalizers":["example"],"generateName":"example","generation":1,"labels":{"additionalProperty":"example"},"managedFields":[{"apiVersion":"example","fieldsType":"example","fieldsV1":{"additionalProperty":"example"},"manager":"example","operation":"example","subresource":"example","time":"example"}],"name":"example","namespace":"example","ownerReferences":[{"apiVersion":"example","blockOwnerDeletion":true,"controller":true,"kind":"example","name":"example","uid":"example"}],"resourceVersion":"example","selfLink":"example","uid":"example"},"spec":{"category":"example","examples":[{"baseline":{"passRate":1},"changePP":1,"measuredOn":{"date":"example","offering":"example"},"mode":"example","model":"example","name":"example","parameters":"example","runtime":"example","runtimeSeconds":1,"tasks":1,"trained":{"passRate":1}}],"graders":[{"description":"example","kind":"example","name":"example"}],"heldOutMeasures":["example"],"licenses":{"code":"example","data":"example"},"modes":["example"],"package":{"image":"example","loader":"example","pip":{"index":"example","name":"example","version":"example"}},"publisher":"example","readiness":"example","requirements":{"gpu":"example","memory":"example"},"rewardType":"example","sampleTask":"example","sandbox":{"cpu":"example","image":"example","memory":"example","timeout":"example"},"sourceURL":"example","splits":{"test":{"size":1},"train":{"size":1}},"summary":"example","version":"example"},"status":{"conditions":[{"lastTransitionTime":"example","message":"example","observedGeneration":1,"reason":"example","status":"example","type":"example"}],"digest":"example","observedGeneration":1,"phase":"example","splits":{"test":1,"train":1}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/apis/nodus.dev/v1/namespaces/example/environments \ --header 'Content-Type: application/json' \ --data '{ "apiVersion": "example", "kind": "example", "metadata": { "annotations": { "additionalProperty": "example" }, "creationTimestamp": "example", "deletionGracePeriodSeconds": 1, "deletionTimestamp": "example", "finalizers": [ "example" ], "generateName": "example", "generation": 1, "labels": { "additionalProperty": "example" }, "managedFields": [ { "apiVersion": "example", "fieldsType": "example", "fieldsV1": { "additionalProperty": "example" }, "manager": "example", "operation": "example", "subresource": "example", "time": "example" } ], "name": "example", "namespace": "example", "ownerReferences": [ { "apiVersion": "example", "blockOwnerDeletion": true, "controller": true, "kind": "example", "name": "example", "uid": "example" } ], "resourceVersion": "example", "selfLink": "example", "uid": "example" }, "spec": { "category": "example", "examples": [ { "baseline": { "passRate": 1 }, "changePP": 1, "measuredOn": { "date": "example", "offering": "example" }, "mode": "example", "model": "example", "name": "example", "parameters": "example", "runtime": "example", "runtimeSeconds": 1, "tasks": 1, "trained": { "passRate": 1 } } ], "graders": [ { "description": "example", "kind": "example", "name": "example" } ], "heldOutMeasures": [ "example" ], "licenses": { "code": "example", "data": "example" }, "modes": [ "example" ], "package": { "image": "example", "loader": "example", "pip": { "index": "example", "name": "example", "version": "example" } }, "publisher": "example", "readiness": "example", "requirements": { "gpu": "example", "memory": "example" }, "rewardType": "example", "sampleTask": "example", "sandbox": { "cpu": "example", "image": "example", "memory": "example", "timeout": "example" }, "sourceURL": "example", "splits": { "test": { "size": 1 }, "train": { "size": 1 } }, "summary": "example", "version": "example" }, "status": { "conditions": [ { "lastTransitionTime": "example", "message": "example", "observedGeneration": 1, "reason": "example", "status": "example", "type": "example" } ], "digest": "example", "observedGeneration": 1, "phase": "example", "splits": { "test": 1, "train": 1 } } }'Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The project.
Query Parameters
Section titled “ Query Parameters ”Header Parameters
Section titled “ Header Parameters ”Request Bodyrequired
Section titled “ Request Bodyrequired ”Environment is an RL and evaluation environment: an OCI image with two entrypoints. nodus-env tasks --split <train|test> --seed N writes JSONL {taskId, prompt, metadata} with no answers, and nodus-env grade reads {taskId, completion} lines on stdin and writes {taskId, verdict, reward, evidence}. Every Environment has a grader, run on the one platform grading path shared by agent evals and TrainingJobs.
object
object
object
object
object
object
object
EnvironmentSpec describes an environment package and its task contract.
object
Category is Reasoning, Math, Code, Games, Control or Custom.
Examples are TrainingJob templates with measured results; TrainingJob.from_example starts from one.
EnvironmentExample is a TrainingJob template with measured results. It has no shell strings and installs nothing at run time.
object
ExampleScore is a measured pass rate in [0, 1].
object
PassRate is passed divided by scored tasks.
ChangePP is the measured change in percentage points.
ExampleMeasurement says where and when an example was measured.
object
Date is the measurement date (YYYY-MM-DD).
Offering is the offering id.
Mode is Train or Evaluate.
Model is a pinned model URI (hf://
Name is unique within the environment; from_example("nodus/gsm8k:<name>") selects it.
Parameters are the runtime parameters.
Runtime is the TrainingRuntime the example runs on, for example nodus/grpo-lora.
RuntimeSeconds is the measured wall time.
Tasks is the number of held-out tasks the example measures.
ExampleScore is a measured pass rate in [0, 1].
object
PassRate is passed divided by scored tasks.
Graders lists the environment’s graders (default: the image’s own Program grader).
EnvironmentGrader is one grader.
object
Description says what it checks.
Kind is Program or ExactMatch.
Name identifies the grader in verdicts.
HeldOutMeasures lists TrainedTask (default) and Transfer.
EnvironmentLicenses are SPDX license ids.
object
Code is the code license.
Data is the data license.
Modes lists Train and Evaluate (default [Evaluate]).
EnvironmentPackage is exactly one of image and pip.
object
Image is a digest-pinned OCI image reference.
Loader is the function the generated nodus-env shim calls for verifiers packages (default load_environment).
PipPackage names a pip package.
object
Index is an optional package index URL.
Name is the distribution name.
Version is the exact version.
Publisher names who maintains the environment.
Readiness is Research (default) or Stable.
EnvironmentRequirements are hints for choosing a model and GPU.
object
GPU is the smallest useful GPU type.
Memory is the GPU memory a typical model needs.
RewardType is Binary (default) or Scalar.
SampleTask is one example task for the catalog (at most 4 KiB).
GradingSandbox configures the grading Sandboxes. Egress is always denied and candidate code runs as an unprivileged user that cannot read the answers.
object
CPU is the CPU limit of one grading Sandbox (default 1).
Image overrides the grading image (default: the environment image).
Memory is the memory limit of one grading Sandbox (default 1Gi).
Timeout bounds one grading batch (default 60s, at most 10m).
SourceURL links the environment’s source.
EnvironmentSplits declares split sizes.
object
SplitSize is the number of tasks in a split.
object
Size is the task count.
SplitSize is the number of tasks in a split.
object
Size is the task count.
Summary is one sentence for the catalog.
Version is a SemVer version; references use nodus/
EnvironmentStatus is written by the Environment controller.
object
Conditions include Verified (digest resolved; managed environments signature-checked).
object
Digest is the resolved (or built) image digest.
ObservedGeneration is the generation the status describes.
Phase is Pending while the image is resolved or built and the manifests are materialized, Ready or Failed.
EnvironmentSplitCounts are materialized task counts.
object
Test is the number of held-out tasks.
Train is the number of training tasks.
Example generated
{ "apiVersion": "example", "kind": "example", "metadata": { "annotations": { "additionalProperty": "example" }, "creationTimestamp": "example", "deletionGracePeriodSeconds": 1, "deletionTimestamp": "example", "finalizers": [ "example" ], "generateName": "example", "generation": 1, "labels": { "additionalProperty": "example" }, "managedFields": [ { "apiVersion": "example", "fieldsType": "example", "fieldsV1": { "additionalProperty": "example" }, "manager": "example", "operation": "example", "subresource": "example", "time": "example" } ], "name": "example", "namespace": "example", "ownerReferences": [ { "apiVersion": "example", "blockOwnerDeletion": true, "controller": true, "kind": "example", "name": "example", "uid": "example" } ], "resourceVersion": "example", "selfLink": "example", "uid": "example" }, "spec": { "category": "example", "examples": [ { "baseline": { "passRate": 1 }, "changePP": 1, "measuredOn": { "date": "example", "offering": "example" }, "mode": "example", "model": "example", "name": "example", "parameters": "example", "runtime": "example", "runtimeSeconds": 1, "tasks": 1, "trained": { "passRate": 1 } } ], "graders": [ { "description": "example", "kind": "example", "name": "example" } ], "heldOutMeasures": [ "example" ], "licenses": { "code": "example", "data": "example" }, "modes": [ "example" ], "package": { "image": "example", "loader": "example", "pip": { "index": "example", "name": "example", "version": "example" } }, "publisher": "example", "readiness": "example", "requirements": { "gpu": "example", "memory": "example" }, "rewardType": "example", "sampleTask": "example", "sandbox": { "cpu": "example", "image": "example", "memory": "example", "timeout": "example" }, "sourceURL": "example", "splits": { "test": { "size": 1 }, "train": { "size": 1 } }, "summary": "example", "version": "example" }, "status": { "conditions": [ { "lastTransitionTime": "example", "message": "example", "observedGeneration": 1, "reason": "example", "status": "example", "type": "example" } ], "digest": "example", "observedGeneration": 1, "phase": "example", "splits": { "test": 1, "train": 1 } }}Responses
Section titled “ Responses ”OK
Environment is an RL and evaluation environment: an OCI image with two entrypoints. nodus-env tasks --split <train|test> --seed N writes JSONL {taskId, prompt, metadata} with no answers, and nodus-env grade reads {taskId, completion} lines on stdin and writes {taskId, verdict, reward, evidence}. Every Environment has a grader, run on the one platform grading path shared by agent evals and TrainingJobs.
object
object
object
object
object
object
object
EnvironmentSpec describes an environment package and its task contract.
object
Category is Reasoning, Math, Code, Games, Control or Custom.
Examples are TrainingJob templates with measured results; TrainingJob.from_example starts from one.
EnvironmentExample is a TrainingJob template with measured results. It has no shell strings and installs nothing at run time.
object
ExampleScore is a measured pass rate in [0, 1].
object
PassRate is passed divided by scored tasks.
ChangePP is the measured change in percentage points.
ExampleMeasurement says where and when an example was measured.
object
Date is the measurement date (YYYY-MM-DD).
Offering is the offering id.
Mode is Train or Evaluate.
Model is a pinned model URI (hf://
Name is unique within the environment; from_example("nodus/gsm8k:<name>") selects it.
Parameters are the runtime parameters.
Runtime is the TrainingRuntime the example runs on, for example nodus/grpo-lora.
RuntimeSeconds is the measured wall time.
Tasks is the number of held-out tasks the example measures.
ExampleScore is a measured pass rate in [0, 1].
object
PassRate is passed divided by scored tasks.
Graders lists the environment’s graders (default: the image’s own Program grader).
EnvironmentGrader is one grader.
object
Description says what it checks.
Kind is Program or ExactMatch.
Name identifies the grader in verdicts.
HeldOutMeasures lists TrainedTask (default) and Transfer.
EnvironmentLicenses are SPDX license ids.
object
Code is the code license.
Data is the data license.
Modes lists Train and Evaluate (default [Evaluate]).
EnvironmentPackage is exactly one of image and pip.
object
Image is a digest-pinned OCI image reference.
Loader is the function the generated nodus-env shim calls for verifiers packages (default load_environment).
PipPackage names a pip package.
object
Index is an optional package index URL.
Name is the distribution name.
Version is the exact version.
Publisher names who maintains the environment.
Readiness is Research (default) or Stable.
EnvironmentRequirements are hints for choosing a model and GPU.
object
GPU is the smallest useful GPU type.
Memory is the GPU memory a typical model needs.
RewardType is Binary (default) or Scalar.
SampleTask is one example task for the catalog (at most 4 KiB).
GradingSandbox configures the grading Sandboxes. Egress is always denied and candidate code runs as an unprivileged user that cannot read the answers.
object
CPU is the CPU limit of one grading Sandbox (default 1).
Image overrides the grading image (default: the environment image).
Memory is the memory limit of one grading Sandbox (default 1Gi).
Timeout bounds one grading batch (default 60s, at most 10m).
SourceURL links the environment’s source.
EnvironmentSplits declares split sizes.
object
SplitSize is the number of tasks in a split.
object
Size is the task count.
SplitSize is the number of tasks in a split.
object
Size is the task count.
Summary is one sentence for the catalog.
Version is a SemVer version; references use nodus/
EnvironmentStatus is written by the Environment controller.
object
Conditions include Verified (digest resolved; managed environments signature-checked).
object
Digest is the resolved (or built) image digest.
ObservedGeneration is the generation the status describes.
Phase is Pending while the image is resolved or built and the manifests are materialized, Ready or Failed.
EnvironmentSplitCounts are materialized task counts.
object
Test is the number of held-out tasks.
Train is the number of training tasks.
Example generated
{ "apiVersion": "example", "kind": "example", "metadata": { "annotations": { "additionalProperty": "example" }, "creationTimestamp": "example", "deletionGracePeriodSeconds": 1, "deletionTimestamp": "example", "finalizers": [ "example" ], "generateName": "example", "generation": 1, "labels": { "additionalProperty": "example" }, "managedFields": [ { "apiVersion": "example", "fieldsType": "example", "fieldsV1": { "additionalProperty": "example" }, "manager": "example", "operation": "example", "subresource": "example", "time": "example" } ], "name": "example", "namespace": "example", "ownerReferences": [ { "apiVersion": "example", "blockOwnerDeletion": true, "controller": true, "kind": "example", "name": "example", "uid": "example" } ], "resourceVersion": "example", "selfLink": "example", "uid": "example" }, "spec": { "category": "example", "examples": [ { "baseline": { "passRate": 1 }, "changePP": 1, "measuredOn": { "date": "example", "offering": "example" }, "mode": "example", "model": "example", "name": "example", "parameters": "example", "runtime": "example", "runtimeSeconds": 1, "tasks": 1, "trained": { "passRate": 1 } } ], "graders": [ { "description": "example", "kind": "example", "name": "example" } ], "heldOutMeasures": [ "example" ], "licenses": { "code": "example", "data": "example" }, "modes": [ "example" ], "package": { "image": "example", "loader": "example", "pip": { "index": "example", "name": "example", "version": "example" } }, "publisher": "example", "readiness": "example", "requirements": { "gpu": "example", "memory": "example" }, "rewardType": "example", "sampleTask": "example", "sandbox": { "cpu": "example", "image": "example", "memory": "example", "timeout": "example" }, "sourceURL": "example", "splits": { "test": { "size": 1 }, "train": { "size": 1 } }, "summary": "example", "version": "example" }, "status": { "conditions": [ { "lastTransitionTime": "example", "message": "example", "observedGeneration": 1, "reason": "example", "status": "example", "type": "example" } ], "digest": "example", "observedGeneration": 1, "phase": "example", "splits": { "test": 1, "train": 1 } }}default
Section titled “ default ”An error: a metav1.Status whose reason is a registered code.
Status is the error body of every API response: a Kubernetes metav1.Status (so kubectl and client-go understand it) plus three top-level extensions that those clients ignore (ADR-028).
object
object
object
Docs is the URL of the code’s docs page.
Fix says what to do next, for example a CLI command or the field to change.
object
object
RequestID identifies the request in logs and support tickets.
Example generated
{ "apiVersion": "example", "code": 1, "details": { "causes": [ { "field": "example", "message": "example", "reason": "example" } ], "group": "example", "kind": "example", "name": "example", "retryAfterSeconds": 1, "uid": "example" }, "docs": "example", "fix": "example", "kind": "example", "message": "example", "metadata": { "continue": "example", "remainingItemCount": 1, "resourceVersion": "example", "selfLink": "example", "shardInfo": { "selector": "example" } }, "reason": "example", "requestId": "example", "status": "example"}