HeliosDB API Reference Overview
HeliosDB API Reference Overview
Version: 7.0 Last Updated: January 2026
This directory contains comprehensive API reference documentation for HeliosDB, covering all interfaces and access methods available for interacting with the database.
Table of Contents
- API Interfaces
- HTTP/REST API
- gRPC API
- WebSocket API
- Authentication Methods
- Rate Limiting
- API Versioning
- Related Documentation
API Interfaces
HeliosDB provides multiple API interfaces to accommodate different use cases, integration patterns, and performance requirements:
| Interface | Port | Protocol | Use Case |
|---|---|---|---|
| HTTP/REST | 8080 (HTTP), 443 (HTTPS) | HTTP/1.1, HTTP/2 | Web applications, microservices, general integration |
| gRPC | 50051 | HTTP/2 | High-performance, low-latency, service-to-service |
| WebSocket | 8081 | WS/WSS | Real-time subscriptions, streaming, live updates |
| PostgreSQL Wire | 5432 | PostgreSQL v3 | SQL clients, ORM frameworks, migrations |
| MongoDB Wire | 27017 | MongoDB Wire | Document-style operations, existing MongoDB apps |
| Redis Protocol | 6379 | RESP3 | Caching, key-value operations, pub/sub |
| Cassandra CQL | 9042 | CQL Binary | Wide-column operations, existing Cassandra apps |
| GraphQL | 8080/graphql | HTTP POST | Flexible queries, frontend applications |
Choosing an API Interface
- HTTP/REST API: Best for most applications, easy integration, language-agnostic
- gRPC API: Best for microservices, high throughput, strongly-typed contracts
- WebSocket API: Best for real-time updates, live dashboards, streaming data
- Wire Protocols: Best when migrating from existing databases or using native drivers
HTTP/REST API
The primary HTTP/REST API provides full database functionality through RESTful endpoints.
Base URLs
Production: https://api.heliosdb.io/api/v1Development: http://localhost:8080/api/v1Core Endpoints
| Category | Endpoint | Description |
|---|---|---|
| Query | POST /query | Execute SQL queries |
| Query | POST /query/async | Execute async queries |
| Query | POST /query/stream | Stream query results |
| Tables | GET /tables | List all tables |
| Tables | GET /tables/{name} | Get table schema |
| Tables | POST /tables | Create new table |
| Tables | DELETE /tables/{name} | Drop table |
| CRUD | GET /tables/{name}/rows | Read rows |
| CRUD | POST /tables/{name}/rows | Insert rows |
| CRUD | PUT /tables/{name}/rows | Update rows |
| CRUD | DELETE /tables/{name}/rows | Delete rows |
| Vector | POST /vectors/search | Vector similarity search |
| Vector | POST /vectors/upsert | Upsert vectors |
| Admin | GET /health | Health check |
| Admin | GET /metrics | Prometheus metrics |
| Admin | GET /info | Server information |
Quick Example
# Execute a SQL querycurl -X POST https://api.heliosdb.io/api/v1/query \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT * FROM users WHERE status = $1 LIMIT 10", "params": ["active"]}'Full documentation: HTTP_REST_API.md
gRPC API
HeliosDB provides a high-performance gRPC API for service-to-service communication with strongly-typed contracts.
Connection
Endpoint: grpc.heliosdb.io:50051TLS: Required in productionService Definition
syntax = "proto3";
package heliosdb.v1;
service HeliosDB { // Query operations rpc ExecuteQuery(QueryRequest) returns (QueryResponse); rpc ExecuteQueryStream(QueryRequest) returns (stream Row);
// Transaction operations rpc BeginTransaction(BeginTransactionRequest) returns (TransactionResponse); rpc CommitTransaction(TransactionId) returns (CommitResponse); rpc RollbackTransaction(TransactionId) returns (RollbackResponse);
// Vector operations rpc VectorSearch(VectorSearchRequest) returns (VectorSearchResponse); rpc VectorUpsert(VectorUpsertRequest) returns (VectorUpsertResponse);
// Admin operations rpc HealthCheck(Empty) returns (HealthResponse);}
message QueryRequest { string sql = 1; repeated Value params = 2; optional TransactionId transaction_id = 3;}
message QueryResponse { repeated Column columns = 1; repeated Row rows = 2; int64 affected_rows = 3; QueryMetrics metrics = 4;}
message VectorSearchRequest { string index_name = 1; repeated float vector = 2; int32 top_k = 3; optional string filter = 4; bool include_vectors = 5; bool include_metadata = 6;}Client Libraries
| Language | Package | Installation |
|---|---|---|
| Python | heliosdb-grpc | pip install heliosdb-grpc |
| Go | github.com/heliosdb/grpc-go | go get github.com/heliosdb/grpc-go |
| Java | io.heliosdb:grpc | Maven/Gradle |
| Node.js | @heliosdb/grpc | npm install @heliosdb/grpc |
| Rust | heliosdb-grpc | cargo add heliosdb-grpc |
Python Example
import grpcfrom heliosdb.v1 import heliosdb_pb2, heliosdb_pb2_grpc
# Create channel with TLScredentials = grpc.ssl_channel_credentials()channel = grpc.secure_channel('grpc.heliosdb.io:50051', credentials)stub = heliosdb_pb2_grpc.HeliosDBStub(channel)
# Execute queryrequest = heliosdb_pb2.QueryRequest( sql="SELECT * FROM users WHERE age > $1", params=[heliosdb_pb2.Value(int_value=21)])response = stub.ExecuteQuery(request, metadata=[('authorization', 'Bearer YOUR_API_KEY')])
for row in response.rows: print(row)Go Example
package main
import ( "context" "log"
"google.golang.org/grpc" "google.golang.org/grpc/credentials" pb "github.com/heliosdb/grpc-go/heliosdb/v1")
func main() { // Create connection with TLS creds, _ := credentials.NewClientTLSFromFile("ca.crt", "") conn, err := grpc.Dial("grpc.heliosdb.io:50051", grpc.WithTransportCredentials(creds)) if err != nil { log.Fatal(err) } defer conn.Close()
client := pb.NewHeliosDBClient(conn)
// Execute query response, err := client.ExecuteQuery(context.Background(), &pb.QueryRequest{ Sql: "SELECT * FROM users LIMIT 10", }) if err != nil { log.Fatal(err) }
for _, row := range response.Rows { log.Println(row) }}WebSocket API
The WebSocket API enables real-time subscriptions and streaming data access.
Connection
Endpoint: wss://api.heliosdb.io/wsProtocol: WebSocket (RFC 6455)Subprotocol: heliosdb.v1Message Format
All messages use JSON format:
{ "type": "request|response|event", "id": "unique-request-id", "action": "action-name", "data": { ... }}Available Actions
| Action | Description |
|---|---|
authenticate | Authenticate the connection |
subscribe | Subscribe to table changes |
unsubscribe | Unsubscribe from changes |
query | Execute a one-time query |
ping | Keep-alive ping |
Authentication
{ "type": "request", "id": "auth-1", "action": "authenticate", "data": { "token": "YOUR_API_KEY" }}Subscribe to Changes
{ "type": "request", "id": "sub-1", "action": "subscribe", "data": { "table": "users", "events": ["INSERT", "UPDATE", "DELETE"], "filter": "status = 'active'" }}Receive Events
{ "type": "event", "subscription_id": "sub-1", "data": { "event_type": "INSERT", "table": "users", "row": { "id": 123, "name": "Alice", "email": "alice@example.com" }, "timestamp": "2026-01-04T12:00:00Z" }}JavaScript Client Example
const ws = new WebSocket('wss://api.heliosdb.io/ws', 'heliosdb.v1');
ws.onopen = () => { // Authenticate ws.send(JSON.stringify({ type: 'request', id: 'auth-1', action: 'authenticate', data: { token: 'YOUR_API_KEY' } }));};
ws.onmessage = (event) => { const message = JSON.parse(event.data);
if (message.type === 'response' && message.id === 'auth-1') { // Authentication successful, subscribe to changes ws.send(JSON.stringify({ type: 'request', id: 'sub-1', action: 'subscribe', data: { table: 'orders', events: ['INSERT'] } })); }
if (message.type === 'event') { console.log('New order:', message.data.row); }};
// Keep connection alivesetInterval(() => { ws.send(JSON.stringify({ type: 'request', action: 'ping' }));}, 30000);Python Client Example
import asyncioimport websocketsimport json
async def subscribe_to_orders(): async with websockets.connect( 'wss://api.heliosdb.io/ws', subprotocols=['heliosdb.v1'] ) as ws: # Authenticate await ws.send(json.dumps({ 'type': 'request', 'id': 'auth-1', 'action': 'authenticate', 'data': {'token': 'YOUR_API_KEY'} }))
auth_response = json.loads(await ws.recv()) if auth_response.get('success'): # Subscribe to orders table await ws.send(json.dumps({ 'type': 'request', 'id': 'sub-1', 'action': 'subscribe', 'data': { 'table': 'orders', 'events': ['INSERT', 'UPDATE'] } }))
# Listen for events async for message in ws: data = json.loads(message) if data['type'] == 'event': print(f"Order event: {data['data']}")
asyncio.run(subscribe_to_orders())Authentication Methods
HeliosDB supports multiple authentication methods to accommodate different security requirements.
API Key Authentication
The simplest authentication method, suitable for server-to-server communication.
Request Header:
Authorization: Bearer hdb_sk_abc123xyz...Alternative Header:
X-API-Key: hdb_sk_abc123xyz...Key Format:
- Production keys:
hdb_sk_prefix (secret key) - Public keys:
hdb_pk_prefix (limited access) - Test keys:
hdb_test_prefix (test environment only)
JWT Token Authentication
For user-based authentication with fine-grained permissions and expiration.
Token Generation:
# Login to obtain tokencurl -X POST https://api.heliosdb.io/api/v1/auth/login \ -H "Content-Type: application/json" \ -d '{"username": "user@example.com", "password": "password"}'Response:
{ "access_token": "eyJhbGciOiJSUzI1NiIs...", "refresh_token": "eyJhbGciOiJSUzI1NiIs...", "token_type": "Bearer", "expires_in": 3600}Using JWT Token:
Authorization: Bearer eyJhbGciOiJSUzI1NiIs...Token Refresh:
curl -X POST https://api.heliosdb.io/api/v1/auth/refresh \ -H "Content-Type: application/json" \ -d '{"refresh_token": "eyJhbGciOiJSUzI1NiIs..."}'OAuth 2.0 / OIDC
For enterprise SSO integration with identity providers.
Supported Providers:
- Google Workspace
- Microsoft Azure AD
- Okta
- Auth0
- Custom OIDC providers
Configuration:
authentication: oauth2: enabled: true provider: azure client_id: "YOUR_CLIENT_ID" client_secret: "YOUR_CLIENT_SECRET" tenant_id: "YOUR_TENANT_ID" scopes: - openid - profile - emailmTLS (Mutual TLS)
For the highest security requirements with certificate-based authentication.
Client Certificate:
curl --cert client.crt --key client.key \ https://api.heliosdb.io/api/v1/tablesConfiguration:
tls: enabled: true cert_file: /certs/server.crt key_file: /certs/server.key client_auth: require client_ca_file: /certs/ca.crtDatabase Authentication (Wire Protocols)
For PostgreSQL, MySQL, and other wire protocol connections.
PostgreSQL (MD5/SCRAM-SHA-256):
postgresql://username:password@localhost:5432/heliosdbSupported Methods:
- Password (MD5 hash)
- SCRAM-SHA-256 (recommended)
- Certificate-based
- LDAP/Active Directory
- GSSAPI/Kerberos
Rate Limiting
HeliosDB implements rate limiting to ensure fair usage and system stability.
Rate Limit Tiers
| Tier | Requests/Second | Requests/Hour | Concurrent |
|---|---|---|---|
| Free | 10 | 1,000 | 5 |
| Developer | 100 | 10,000 | 25 |
| Professional | 1,000 | 100,000 | 100 |
| Enterprise | Custom | Custom | Custom |
Rate Limit Headers
Every API response includes rate limit headers:
X-RateLimit-Limit: 1000X-RateLimit-Remaining: 987X-RateLimit-Reset: 1704364800X-RateLimit-Reset-After: 3600Handling Rate Limits
When rate limited, the API returns HTTP 429:
{ "error": { "code": "RATE_LIMIT_EXCEEDED", "message": "Rate limit exceeded. Please retry after 60 seconds.", "retry_after": 60 }}Best Practices:
- Implement exponential backoff
- Use the
Retry-Afterheader - Batch operations where possible
- Cache frequently accessed data
- Use streaming for large result sets
Example with Retry Logic
import requestsimport time
def api_call_with_retry(url, data, max_retries=3): for attempt in range(max_retries): response = requests.post(url, json=data, headers=headers)
if response.status_code == 429: retry_after = int(response.headers.get('Retry-After', 60)) print(f"Rate limited. Retrying in {retry_after} seconds...") time.sleep(retry_after) continue
return response
raise Exception("Max retries exceeded")API Versioning
Current Version
The current stable API version is v1.
Version Format
API versions are included in the URL path:
/api/v1/... # Current stable/api/v2/... # Future (when available)Version Lifecycle
| Phase | Duration | Description |
|---|---|---|
| Preview | 3 months | New features, may change |
| Stable | 24+ months | Production-ready, backward compatible |
| Deprecated | 12 months | Still works, migration warnings |
| Sunset | - | No longer available |
Deprecation Notices
Deprecated features are indicated via response headers:
Deprecation: trueSunset: Sat, 01 Jan 2028 00:00:00 GMTLink: </api/v2/query>; rel="successor-version"Migration Support
# Check API version compatibilitycurl https://api.heliosdb.io/api/v1/info \ -H "Authorization: Bearer YOUR_API_KEY"Response:
{ "version": "7.0.0", "api_version": "v1", "supported_versions": ["v1"], "deprecated_features": [ { "feature": "/api/v1/legacy/query", "sunset_date": "2027-01-01", "replacement": "/api/v1/query" } ]}Related Documentation
API Reference Files
| Document | Description |
|---|---|
| HTTP_REST_API.md | Complete HTTP REST API reference |
| SQL_FUNCTIONS.md | SQL function reference |
| DDL_REFERENCE.md | DDL statement reference |
External Documentation
| Document | Location |
|---|---|
| Main API Reference | /docs/api/API_REFERENCE.md |
| SQL API Reference | /docs/api/SQL_API_REFERENCE.md |
| OpenAPI Specification | /docs/reference/OPENAPI_SPECIFICATION.md |
| Protocol Documentation | /docs/reference/protocols/ |
Protocol-Specific Documentation
| Protocol | Documentation |
|---|---|
| PostgreSQL | /docs/reference/protocols/postgresql/ |
| MongoDB | /docs/reference/protocols/mongodb/ |
| Redis | /docs/reference/protocols/redis/ |
| Cassandra | /docs/reference/protocols/cassandra/ |
| GraphQL | /docs/reference/protocols/graphql/ |
| HTTP/REST | /docs/reference/protocols/http-rest/ |
Support
For API support and questions:
- Documentation: https://docs.heliosdb.io
- GitHub Issues: https://github.com/heliosdb/heliosdb/issues
- Community Forum: https://community.heliosdb.io
- Enterprise Support: support@heliosdb.io
Last Updated: January 2026 API Version: v1 HeliosDB Version: 7.0.0