Skip to main content
You need an API key from the dashboard. Copy this file, set NAIVE_API_KEY, run it.
agent.ts
That is the whole primitive. Everything below is the same five calls through a different door, plus the three things that will bite you.

The same thing from a terminal

The CLI takes dollars and converts to micro-USD for you. --max-task-usd defaults to a tenth of the cap if you omit it. naive agents status prints the harness hash the deployment reported — not one the CLI computed — which is how you tell two runs apart when the harness moved under them:
naive agents spend prints every component, including the zeros:

The same thing over HTTP

The three things that will bite you

anthropic/claude-sonnet-4-5, never anthropic/claude-latest or a bare family name. auto, best, latest, default and preview are refused with invalid_input. An alias resolves differently on two days, which makes two runs of the same agent incomparable.
cap_micro_usd and max_task_micro_usd are mandatory — an agent with no cap is not creatable, and a cap with no per-task ceiling is one runaway task away from being the whole cap.They are not the same control. Crossing the cap parks the task as braked; it resumes at the period reset, or the moment you raise the cap. Crossing the per-task ceiling ends the task failed and non-retryable, because a per-task ceiling never resets. Set it to what you would accept losing on one bad task.
budget on update is a full replacement, never a merge.
asap is the default and works on every model. standard and flex are served only on zai-org/GLM-5.2-FP8; anywhere else they are meant to fail with window_unavailable (400) rather than being downgraded — and the refusal lands at the first model call, not at create. 🔴 On our deployed staging host that refusal did not fire and the downgrade did: a non-asap window on a non-GLM model ran to done, was billed, and recorded asap. If you are not on that model, leave the window alone. See Pricing.
status, wakes and next_wake_at are not live yet. They are returned on every agent and written by nothing, so they read "idle", 0 and null regardless of what the agent is doing. Use the task record and the event log instead — those are real.

Next

Give it a schedule

Wake it every morning without sending anything.

Give it a URL

Let Stripe, GitHub or Linear wake it.

Give it a sandbox

Let it write code and run the tests.