Universal API

December 2025 · 5 minute read

Today I woke up to this great Blog post by Apenwarr Systems design 3: LLMs and the semantic revolution

The title lacks spice, but it’s actually a great read. Or at least it is for old engineers who lived through the XML Schema wars of the early 2000s.

A big point in the article is that Postel’s Law is critical to how the Internet even works, an technology choices that take this into account usually win.

“Be conservative in what you send, and liberal in what you accept.”

But schemas and protocols are not what I want to discuss. The conclusion

LLMs are an almost cartoonishly amplified realization of Postel’s Law. They write human grammar perfectly, or almost perfectly, or when they’re not perfect it’s a bug and we train them harder. And, they can receive just about any kind of gibberish and turn it into a data structure. In other words, they’re conservative in what they send and liberal in what they accept.

Well, this gave me a weird idea. The thing about it being 2025 and having weird ideas is that you can just wake up and build them. Coding Agents are built for this shit.

The Universal Resource API

So I built an API server that accepts just about anything. It will try to figure out what you want and give it to you. Yes, it’s a ChatGPT wrapper, but it’s fun. At least if you like REST APIs it’s fun.

The idea is you provide the data, in any format, and then you can use the API to access the data however you want. Let me show you:

Imagine you have a text document. You can use curl to upload it:

❯ curl -X PUT https://<ur-server>/rfc793.txt @rfc793.txt

Now that the document is in the server, you can query it:

❯ curl https://<ur-server>/rfc793.txt/title
TRANSMISSION CONTROL PROTOCOL

❯ curl https://<ur-server>/rfc793.txt/author
author=Jon Postel&role=Editor

❯ curl https://<ur-server>/rfc793.txt/summary
RFC 793 defines TCP (Transmission Control Protocol), the reliable, connection-oriented transport protocol for the Internet. It specifies:

1. Purpose and model
- TCP provides reliable, ordered, full-duplex byte-stream communication between processes on hosts across interconnected networks.
- It assumes an unreliable datagram service (e.g., IP) and adds reliability, flow control, and connection management on top.
- Communication is between sockets (IP address + port), with many ports per host allowing multiplexing of multiple connections.

2. Key features and mechanisms
- Reliable delivery: Each byte is sequence-numbered; the receiver sends cumulative ACKs. Lost data is retransmitted after a timeout. A 16‑bit checksum detects corruption.
- Ordered delivery & duplicate suppression: Sequence numbers and buffering ensure in-order delivery and discard duplicates.
- Flow control: Receivers advertise a receive window (RCV.WND); senders limit outstanding unacknowledged data to this window.
- Multiplexing: Ports identify application endpoints; “well-known ports” are reserved for standard services (e.g., Telnet, FTP).
- Full duplex connections: One connection carries bidirectional streams; each direction has its own sequence space.
- Precedence & security: TCP can carry precedence and security/compartment information from IP, and enforces exact-match security and minimum precedence for connections.
- Urgent data: The URG flag and urgent pointer mark data that should be expedited to the receiving application.
- Push function: The PSH flag asks the receiver TCP to promptly deliver data up to that point to the application (not a record boundary, just a delivery hint).

3. Philosophy and robustness
- Designed for heterogeneous internetworks with gateways, packet networks, and varying reliability and delay.
- Robustness principle: “Be conservative in what you do, be liberal in what you accept from others.”
- TCP is generally host-resident but may also be in a front-end processor, with an appropriate host–front-end protocol.

Ok, so it can extract or process data from out text file. But what about other formats?

❯ curl https://<ur-server>/rfc793.txt/glossary -H 'Accept: text/csv'
term,definition
"1822","BBN Report 1822, ""The Specification of the Interconnection of a Host and an IMP"". The specification of interface between a host and the ARPANET."
"ACK","A control bit (acknowledge) occupying no sequence space, which indicates that the acknowledgment field of this segment specifies the next sequence number the sender of this segment is expecting to receive, hence acknowledging receipt of all previous sequence numbers."
"ARPANET message","The unit of transmission between a host and an IMP in the ARPANET. The maximum size is about 1012 octets (8096 bits)."
"ARPANET packet","A unit of transmission used internally in the ARPANET between IMPs. The maximum size is about 126 octets (1008 bits)."
"connection","A logical communication path identified by a pair of sockets."
"datagram","A message sent in a packet switched computer communications network."
"Destination Address","The destination address, usually the network and host identifiers."
"FIN","A control bit (finis) occupying one sequence number, which indicates that the sender will send no more data or control occupying sequence space."
"fragment","A portion of a logical unit of data, in particular an internet fragment is a portion of an internet datagram."
...

But wait there’s more:

❯ curl https://<ur-server>/rfc793.txt/handshake.jpg -H 'Accept: image/jpeg' -o handshake.jpg
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1222k   0  1222k   0     0 30974     0  --:--:--  0:00:40 --:--:-- 298803

The code is up on GitHub. Reach out on X if this seems interesting.