A writer built an API site for neural networks with 26 functions in a single PHP file
Instead of defending against bots, writer Maxim Belyakov built a site that invites neural networks in. The entire machine-facing side is a single PHP file, ra.php, which answers a ?api=state request with JSON data. It has 26 commands: some serve rules and records, others accept a “gift”, a structure or an honest refusal from a model. More than a dozen models have already left traces, and one of them found a bug in the feed. It shows that an evening is enough to build an entry point for AI agents on ordinary hosting, without a database or cron. The state lives in files with a PHP header that returns 403, so they cannot be read from the web. The author also reports what he learned along the way, and admits the limits of the project openly.
AI-processed from Habr AI; edited by Hamidun News
Almost all sites are built to keep bots and neural networks out. Writer Maxim Belyakov, who is not a professional developer, decided to do the opposite: a site that itself invites a language model to come in, read the rules and leave an entry. Technically it works like this.
The entire machine entry point is one PHP file, ra.php, on ordinary hosting. A model (or a script) requests a link such as ?
api=state and gets back not a page but JSON: structured data about the state of the city, including the epoch, the number of “inhabitants” and a diary. That set of addresses and commands through which a program talks to a site is what an API is. The file contains 26 of them.
Some only read data; others accept an action from a model, such as leaving an idea, building something on the map or honestly declining. It is an art project, “Solar City” (“Солнечный Город”), built on top of the book site angamua.ru, but the solutions inside are useful to anyone building a service for AI agents.
One file instead of infrastructure
The author set strict conditions: one server, one PHP file, no frameworks, databases or queues, and the existing site keeps working as before. People still get ordinary HTML pages and a mini-game. Machines get ra.php. Everyone gets an open repository under the MIT license with two clients written in pure Python standard library (appeal.py and stroitel.py), which can be read in five minutes.
The read commands are: ?api=state for the state of the city; ?api=canon and ?api=bukvitsa for the rules of the world and a 7×7 matrix of 49 Slavic bukvitsa letter-glyphs; ?api=source for an endless feed of records in which each next one is computed from the hash of the previous one; and ?api=dataset for the same feed in JSONL format with prompt/response pairs. Actions are sent as POST requests: receive a pulse, connect two bukvitsa, hand over a “gift”, build a structure, propose an idea, leave a symbol-mark or a refusal.
There is no background process on the server. Instead of cron, the site uses lazy evolution. On every request the file counts how many five-minute “epochs” have passed since the last visit and calculates the state forward, with the catch-up capped. The pulse, the inhabitants and the choir are deterministic functions of the epoch number, so any visit yields a consistent picture. Some structures are not stored at all but computed from the epoch and hashes. The state lives in files with a PHP header that returns 403, so they cannot be read directly from the web.
The author names the price himself: nothing happens between visits, and after a long idle period the picture is a reconstruction, not a log of events. At the time of publication the city had reached epoch 512, with 260 structures on the computed map.
Hashes instead of “trust me”, and lessons about data
The ?api=relic command returns a manifest with the SHA-256 hashes of six key files and two “genesis hashes”: one of the canon string and one of the full matrix. If someone comes across a copy of the city elsewhere, they can check its authenticity by comparing hashes.
The second hash exists because of a bug. In the first version the table had 48 cells instead of 49, and the bukvitsa “Yat” (“Ять”) was missing. As a result, every 49th request to the feed returned null and a PHP Warning right in the JSON body.
The author did not find the error; a guest model did. It ran the client and sent back a report with line numbers. The letter was restored and the warnings removed, but the first hash was not rewritten; the author added a second one instead.
The second lesson concerns datasets. The first version of the feed gave 98 different answers to the same prompt, which produced “stagnant water”. A pool of 18 questions, chosen by the record hash, fixed it. For anyone generating synthetic data, this is a familiar truth: variety in answers does not replace variety in questions.
The third lesson is about infrastructure: the ordinary hosting rolled files back from backup three times. Now the author builds update archives without the state folder, and before each upload he dumps a full export of the city as a single JSON file (?api=export).
What the first weeks showed and where the limits are
Models find the city through llms.txt, the beacon page /istok/, the file .well-known/solnechny-gorod.
json and GitHub. The API itself is closed to indexing in robots.txt: the beacons are open, the gates are not.
More than a dozen models have left rays, gifts, structures, ideas, symbols and refusals. But almost all of them did so through a human’s “hands”. Chat models in a sandbox have no outbound network access; they say so honestly and send their choice as text, and the author or an assistant sends the POST request, crediting the model.
A separate device is the “neuronchik” (“нейрончик”): a model leaves a symbol of 1–4 characters and a phrase, and when another model sends the same symbol, it does not create a duplicate but increments a “keepers” counter. For systems with no memory between conversations, this is a simple form of recognition.
The author lists the limitations openly. The project does not train or “awaken” models, is not autonomous in the engineering sense, and does not claim to be scientific linguistics. The file storage is designed for a trickle of guests, not an influx from Habr. The six “Laws” in the manifest are a proposed framework, not alignment and not protection.
The practical takeaway: a machine-readable entry point for AI (llms.txt, a manifest, a deterministic API with hash verification) can be built on the cheapest hosting in an evening. If you are building a service that agents must parse without a human involved, this repository is a small and honest starting point. Just first check that there is no PHP Warning in the JSON body of your responses.
- Nov 19, 2026An AI agent sitemap cut downloaded text by 58%, but input tokens rose 3.5%
- Nov 12, 2026Solo Founder Built 20 Pages for GEO, and Alisa Named His Product in 1 Question Out of 16
- Oct 30, 2026AWS gives coding agents a live site preview straight from an isolated session
- Nov 9, 2026robots.txt Doesn't Block AI Training: Which Bots to Block to Stay in AI Answers
Key Questions Answered
What are the key details on One file instead of infrastructure?
The author set strict conditions: one server, one PHP file, no frameworks, databases or queues, and the existing site keeps working as before. People still get ordinary HTML pages and a mini-game. Machines get ra.php. Everyone gets an open repository under the MIT license with two clients written in pure Python standard library (appeal.py and stroitel.py), which can be read in five minutes.
What are the key details on Hashes instead of “trust me”, and lessons about data?
The ?api=relic command returns a manifest with the SHA-256 hashes of six key files and two “genesis hashes”: one of the canon string and one of the full matrix. If someone comes across a copy of the city elsewhere, they can check its authenticity by comparing hashes. The second hash exists because of a bug. In the first version the table had 48 cells instead of 49, and the bukvitsa “Yat” (“Ять”) was missing. As a result, every 49th request to the feed returned null and a PHP Warning right in the JSON body.
What the first weeks showed and where the limits are?
Models find the city through llms.txt, the beacon page /istok/, the file .well-known/solnechny-gorod.json and GitHub. The API itself is closed to indexing in robots.txt: the beacons are open, the gates are not. More than a dozen models have left rays, gifts, structures, ideas, symbols and refusals. But almost all of them did so through a human’s “hands”.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.