gateway command-line tool; the platform does the hosting.
This page assumes you finished Installation: @withgateway/sdk is installed and gateway auth status prints your host.
Prefer to hand the work to a coding agent?
gateway worlds skill worlds-getting-started prints the same path in agent form, and --install .
writes it into your repository’s .claude/skills/.Create a world
A world is a sealed copy of a system your agent works against. Start one from a connector template the SDK ships, or from a contract you write yourself.- From a connector template
- From your own contract
gateway worlds create builds the world on the platform in one call. Pass a shipped template slug to --from; gateway worlds schema templates lists what is installed.READY and serving. There is no separate push step.gateway worlds list now shows the world with its slug and latest version.
Open a session
A session is one live, pinned copy of the world. Ask for theapi surface and the platform serves the world’s routes at a URL your agent can call.
-t names the task the session runs, and every world built from a template ships a task called default. -s api asks for the HTTP surface on top of the tool surface; repeat it or comma-separate it for ui and browser.
The command prints the session descriptor:
Call the world over HTTP
Theapi.token in the descriptor authorizes every request. Send it as a bearer token in the header, never in the URL.
gateway worlds session status <sessionId> prints the session’s tools and surfaces. For a world you have a directory for, gateway worlds schema describe ./acme-world prints its entities, tools, and the vendor connection it answers to.
To confirm the world is live without knowing a route, dump its current rows:
$API_URL with that bearer token and it works against the world instead of the real system. Nothing it writes leaves the session.
Grade the run
The session’s task carries a grader.grade runs it against the world’s state as it stands now and prints the reward.
reward is the headline number, rewards breaks it down per check, and raw holds whatever the grader returned. Assertion and Python graders answer in seconds; a rubric judge is scored by the platform’s worker, and the command waits for that verdict.
Want a different question asked?
gateway worlds session open --task-file spec.json supplies a task inline: {instruction, seed?, grader?, metadata?}.
gateway worlds task create keeps the same spec as a project resource so
sessions can open on it by id.Close the session
A session holds a running container, so close it when you are done.gateway worlds session pin <sessionId> exempts it from the idle reaper until you close it.
What to do next
- Build a world properly, with your own contract, real data, and versions, in Getting started with worlds.
- Run every task in a world at once with
gateway worlds run, and gate a pull request on the score withgateway worlds ci. See The gateway CLI. - Capture the sessions a world is seeded from in Tracing.
- Score production traffic and replay real sessions in Evaluation & Replay.
- Learn the six words the product is built from in the Glossary.