İçeriğe atla
Jev | typesafeAPI & Playground
…

Use Cases / game-action

Game next action

A game loop that sends a screenshot to a chat model and parses jump out of a sentence misses the tick.

Try a related template free on this host — 5 anonymous real-API runs with no signup — then ship the same schema with a prepaid jv_live_ key. See is Jev free? and playground.

Why Jev

Demos such as a Mario RAM agent feed structured state and ask for one action from a closed list. This host already runs that shape live on 2048 and Snake. The sample below is the same call for your own tick: action Choice, plus a Noul for whether waiting fails the state.

How to define the decision

State is positions, flags, and hazards in text. Choice criteria are the buttons your simulator accepts. Do not include a move the physics cannot perform. A Noul asks if waiting a tick likely fails.

When to use Jev

  • One action per tick from state you already decoded
  • Keeping illegal moves out of the criteria list
  • Comparing a decision model with a scripted policy on the same log

When not to use Jev

  • Reading pixels or audio on this endpoint
  • Emitting controller bytes or connecting to a console
  • Treating a demo win rate as a guarantee for your game

Failure modes and human fallback

  • Upstream or network errors: retry with backoff; do not invent a decision.
  • Low confidence: route to a human queue or safer default — never auto-act on money/destructive tools.
  • Schema drift: keep a golden fixture set in CI so label changes fail the build before production.
  • This page does not ship a game runtime.
  • Live demos on this host are 2048 and Snake, not the sample state.
  • A tick label is not a path plan.

API example

Same prepaid jv_live_ balance as tools. Output tokens are free on this host's metering model.

curl
curl https://jevtypesafe.org/api/v1/decide \
  -H "Authorization: Bearer jv_live_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"state":"On ground. Gap two tiles ahead. An enemy walks toward the gap from the right.","questions":{"action":{"type":"choice","instructions":"Which discrete action should happen on the next tick?","criteria":{"run":"move forward","jump":"jump","wait":"hold position"}},"urgent":{"type":"noul","instructions":"Does waiting one more tick likely fail this state?"}}}'

FAQ

Where can I watch a live game?
Open /games/jev-2048/ or /games/jev-snake/. Those call the hosted decide API. Your own loop uses the same packs.
Do you run a Mario agent here?
No. The sample is a state and a closed action list. The simulator stays on your side.

Related use cases

Ready to build?

Free anonymous tool runs, then prepaid packs and a jv_live_ key — independent host, not affiliated with TypeSafe AI.

Jev Game Agent | Next Action from Structured State