API as Architecture
Define APIs, services, databases, and AI tools from one protobuf contract. ApiHug keeps engineers and agents on the same system model.
$ 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
Single contract. Shared runtime. Security, governance, observability, and collaboration across the stack.
Proto Semantic
ApiHug extends protobuf with routing, validation, persistence, mocking, and versioning. Structured semantics stay in the contract, where engineers and LLMs can use them reliably.
Routes, methods, and pagination declared on RPCs. Generates OpenAPI, Spring controllers, and client SDKs.
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: 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 entity structure in protobuf. ApiHug generates entities, migrations, and CRUD so schema, code, and API stay aligned.
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")public 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
One proto contract generates services, database artifacts, SDKs, tests, and AI tooling. The same definition serves engineers, clients, and agents.
Describe the API in Protocol Buffers: structured, typed, and machine-readable.
Controllers, DTOs, and service stubs generated with minimal manual wiring.
Tables, indexes, and migrations generated from entity metadata.
MCP servers and typed tools so agents can call your APIs safely.
Agent Native
Agents are now API consumers. ApiHug gives them typed tools, governed access, and the same contract model your engineers already use.
Generate MCP servers from API contracts so agents can discover and invoke services without custom glue.
Turn endpoints into typed tools with clear inputs, outputs, and pagination.
Apply RBAC and audit trails so agent actions stay within enterprise boundaries.
Use structured protobuf contracts that reduce ambiguity for both humans and LLMs.
Generate client bindings from one contract for Java, TypeScript, Python, and Go.
Carry observability, tracing, and compliance through generated artifacts.
From business intent to deployed systems. ApiHug gives humans and AI agents one unambiguous contract across the delivery lifecycle.