Quick start
This guide will walk you through creating your first Hyperterse API in under 5 minutes. By the end, you’ll have a working REST endpoint that queries your database.
Create your first API
Section titled “Create your first API”-
Initialize a new configuration
Terminal window hyperterse init -o config.terse -
Define your database adapter(s)
config.terse name: my-apiadapters:my_database:connector: postgresconnection_string: 'postgresql://user:password@localhost:5432/mydb' -
Define your query
config.terse name: my-apiadapters:my_database:connector: postgresconnection_string: 'postgresql://user:password@localhost:5432/mydb'queries:get-users:use: my_databasedescription: 'Retrieve all users'statement: |SELECT id, name, email, created_atFROM usersORDER BY created_at DESCLIMIT 100 -
Start the server
Terminal window hyperterse dev -f config.terse -
Your query is now available as a REST endpoint. Test it with curl:
Terminal window curl -X POST http://localhost:8080/query/get-users \-H "Content-Type: application/json"
Accepting inputs
Section titled “Accepting inputs”Queries can also accept input parameters. These can be substituted in the query statement to create dynamic queries.
name: my-api
adapters: my_database: connector: postgres connection_string: 'postgresql://user:password@localhost:5432/mydb'queries: get-users: use: my_database description: 'Retrieve all users' statement: | SELECT id, name, email, created_at FROM users ORDER BY created_at DESC LIMIT 100 get-user-by-email: use: my_database description: 'Find a user by their email address' statement: | SELECT id, name, email, created_at FROM users WHERE email = {{ inputs.email }} inputs: email: type: string description: 'The email address to search for'Now call it with an input:
curl -X POST http://localhost:8080/query/get-user-by-email \ -H "Content-Type: application/json" \ -d '{"email": "alice@example.com"}'Explore built-in endpoints
Section titled “Explore built-in endpoints”Hyperterse automatically generates documentation and tooling. Try opening http://localhost:8080/docs in your browser to see the auto-generated OpenAPI specification.
| Endpoint | Description |
|---|---|
POST /query/{name} | Execute a query |
GET /docs | OpenAPI 3.0 specification |
GET /llms.txt | AI-friendly documentation |
POST /mcp | MCP JSON-RPC 2.0 endpoint |