API as Architecture
One contract. Your APIs, services, databases — a design language that embraces both engineers and AI agents.
$ iex (irm 'https://raw.githubusercontent.com/apihug/apihug.github.io/main/helper/apihug-install.ps1')syntax = "proto3";service OrderService { rpc Place () returns () { }; }}public class OrderController { @PostMapping("/order/place") public place() { // Generated by ApiHug }}The Blueprint
From AI agents at the top to enterprise systems at the bottom — ApiHug is the operating language that connects them all, flanked by security, governance, observability, and collaboration.
Proto Semantic
ApiHug extends protobuf with a rich semantic layer — routing, validation, persistence, mocking — all declared in your .proto files. Typed fields, pagination, repeated inputs — structured semantics that LLMs understand without hallucinating.
HTTP routes, methods, pagination — declared on your RPCs. Generates OpenAPI specs, Spring controllers, and client SDKs automatically.
service OrderService { // Service-level config option (hope.swagger.svc) = { path: "/order"; description: "Order Service"; } rpc Place (PlaceOrderRequest) returns (OrderPlacedResponse) { option (hope.swagger.operation) = { post: "/place"; description: "place a new order"; }; } rpc Query (QueryOrderRequest) returns (OrderView) { option (hope.swagger.operation) = { get: "/query"; pageable: true; }; }}message Movie { string name = 1 [(hope.swagger.field) = { description: "name of the movie"; example: "The Lord of the Rings" empty: FALSE; mock: { nature: MOVIE } max_length: { value: 64 } }]; MovieLevel level = 2 [(hope.swagger.field) = { description: "level of the movie"; example: "PG_13" empty: FALSE; }]; uint32 year = 3 [(hope.swagger.field) = { description: "publish year"; example: "2022" }];}enum MovieLevel { PG_13 = 0 [(hope.constant.field) = { code: 1, message: "PG-13" }]; R = 1 [(hope.constant.field) = { code: 2, message: "R" }]; NC_17 = 3 [(hope.constant.field) = { code: 4, message: "NC-17" }];}// 40+ built-in nature types for mock dataenum Nature { ANIMAL = 0; // random animal names AVATAR = 2; // avatar image URLs BOOK = 4; // book titles COLOR = 8; // color names COUNTRY = 10; // country names CURRENCY = 11; // currency names DATE_AND_TIME = 12; // random dates DOG = 13; // dog breed names FOOD = 14; // food names MOVIE = 20; // movie titles NAME = 22; // person names EMAIL = 24; // email addresses PHONE = 26; // phone numbers URL = 36; // random URLs}Entity Design
Define your domain model in protobuf. ApiHug generates entities, migrations, and CRUD — schema, code, and API always in sync.
message Movie { string name = 1 [(hope.persistence.column) = { name: "NAME", description: "Name of the movie", type: VARCHAR, length: { value: 64 } }]; string description = 2 [(hope.persistence.column) = { name: "DESCRIPTION", type: VARCHAR, length: { value: 255 } }]; MovieLevel level = 3 [(hope.persistence.column) = { enum_type: STRING, type: VARCHAR, length: { value: 16 } }]; option (hope.persistence.table) = { name: "MOVIE", wires: [IDENTIFIABLE, AUDITABLE] };}<!-- Auto-generated by ApiHug --><createTable remarks="Movie" tableName="MOVIE"> <column name="ID" type="BIGINT" autoIncrement="true"> <constraints primaryKey="true" unique="true" /> </column> <column name="NAME" type="VARCHAR(64)"> <constraints nullable="false" /> </column> <column name="DESCRIPTION" type="VARCHAR(255)" /> <column name="LEVEL" type="VARCHAR(16)" /> <column name="CREATED" type="TIMESTAMP" /></createTable>@Entity@Table(name = "MOVIE")@Auditablepublic class Movie implements Identifiable<Long> { @Id @GeneratedValue private Long id; @Column(name = "NAME", length = 64, nullable = false) private String name; @Column(name = "DESCRIPTION", length = 255) private String description; @Enumerated(EnumType.STRING) @Column(name = "LEVEL", length = 16) private MovieLevel level;}Enterprise Factory
No more hand-wiring layers. One proto contract generates services, database, SDKs, testing, and AI tooling — the same definition powers both human engineers and machine agents.
Describe your API in Protocol Buffers — structured, typed, machine-readable.
Controllers, DTOs, and service stubs — production-ready, zero boilerplate.
Tables, indexes, and migrations — generated from your entity annotations.
MCP servers and tool schemas so AI agents can invoke your APIs safely.
Agent Native
In the AI era, your API consumers are agents — not just developers. ApiHug hugs both: giving humans clean contracts and LLMs the structured semantics they need to understand — not guess at — your enterprise.
Auto-generate MCP servers from your API contracts. AI agents discover and invoke services without custom integration.
Every endpoint becomes a typed tool definition with input, output, and pagination — exactly what LLMs need.
RBAC and audit trails keep AI agents operating within safe enterprise boundaries.
Protobuf eliminates ambiguity. LLMs reason best against structured, typed definitions with clear semantics.
Client SDKs for any language from one contract — Java, TypeScript, Python, Go.
Observability, tracing, and compliance built into every generated artifact.
From business intent to deployed systems. ApiHug hugs both humans and AI agents into a shared, unambiguous contract — the foundation for the entire enterprise lifecycle.