API Reference
Complete REST and GraphQL API documentation for the HarchOS ecosystem.
Authentication
Authenticate using Bearer tokens in the Authorization header. Tokens are obtained via the /auth/token endpoint.
X-API-Key: hrch_live_sk_abc123def456Required for all API requests Server-to-server authentication
Authenticate using API keys passed via the X-API-Key header. Suitable for server-to-server communication.
Authorization: Bearer eyJhbGciOiJSUzI1NiIs...Required for all API requests API key management
Authenticate using OAuth 2.0 with client credentials flow. Supports scoped access and token refresh.
Authorization: Bearer <jwt_token>Required for all API requests OAuth 2.0 client credentials
REST
Complete REST and GraphQL API documentation for the HarchOS ecosystem.
/v1/compute/workloads/v1/compute/workloads/v1/compute/workloads/:id/v1/compute/workloads/:id/v1/compute/workloads/:id/v1/compute/workloads/:id/scale/v1/compute/workloads/:id/migrate/v1/carbon/intensity/v1/carbon/optimal-hub/v1/carbon/optimize/v1/carbon/forecast/v1/carbon/metrics/v1/carbon/dashboard/v1/data/pipelines/v1/data/pipelines/v1/data/pipelines/:id/ingest/v1/data/lakes/v1/data/lakes/:id/snapshot/v1/models/v1/models/v1/models/:id/deploy/v1/models/:id/train/v1/models/:id/metrics/v1/inference/v1/pricing/plans/v1/pricing/plans/:id/v1/pricing/estimate/v1/pricing/billing/records/v1/pricing/billing/records/:id/v1/regions/v1/regions/:code/v1/operations/hubs/v1/operations/hubs/:id/v1/operations/failover/v1/operations/energy/v1/operations/schedule/v1/monitoring/metrics/v1/monitoring/health/detailed/v1/monitoring/alerts/v1/monitoring/alerts/rules/v1/monitoring/traces/v1/monitoring/logsgRPC
Complete REST and GraphQL API documentation for the HarchOS ecosystem.
ComputeService — GPU allocation and workload scheduling
CreateWorkloadGetWorkloadListWorkloadsScaleWorkloadMigrateWorkloadStreamWorkloadEventsDataService — Data ingestion, storage, and retrieval
CreatePipelineIngestDataGetSnapshotStreamDataModelService — AI model training and inference
RegisterModelDeployModelTrainModelStreamInferenceMonitorService — Real-time infrastructure monitoring
GetHubStatusStreamMetricsInitiateFailoverGetEnergyReportAuthService — Authentication and authorization
AuthenticateAuthorizeStreamAuditEventsRevokeTokenWebSocket
Complete REST and GraphQL API documentation for the HarchOS ecosystem.
/v1/ws/workloads/:id/eventsws://api.harchos.ai/v1/stream/metrics — Real-time infrastructure metricsJSON over WebSocket/v1/ws/metrics/streamws://api.harchos.ai/v1/stream/events — Live event streamJSON over WebSocket/v1/ws/models/:id/inferencews://api.harchos.ai/v1/stream/logs — Real-time log streamingJSON over WebSocket/v1/ws/audit/eventsws://api.harchos.ai/v1/stream/notifications — Push notificationsJSON over WebSocket/v1/ws/hubs/:id/telemetryws://api.harchos.ai/v1/stream/alerts — Real-time alertsProtobuf over WebSocketRate Limits
Complete REST and GraphQL API documentation for the HarchOS ecosystem.
| Tier | Requests | Burst | Compute | Data |
|---|---|---|---|---|
| Free | 100 req/min | 50 req | 10 GPU-hrs/mo | 5 GB/month |
| Professional | 1,000 req/min | 500 req | 500 GPU-hrs/mo | 50 GB/month |
| Enterprise | 10,000 req/min | 5,000 req | Unlimited | 500 GB/month |
| Sovereign | Custom | Custom | Custom | Custom |
| Classified | Dedicated | Dedicated | Dedicated | Dedicated |
Error Handling
The request was malformed or missing required parameters.
Authentication failed or was not provided.
The authenticated user lacks permission for this resource.
The requested resource does not exist.
Rate limit exceeded. Retry after the specified duration.
An unexpected error occurred on the server.
The server received an invalid response from an upstream service.
The server is temporarily unavailable. Please retry later.
Code Examples
curl -X POST https://api.harchos.ai/v1/compute/workloads \
-H "Authorization: Bearer hrch_live_sk_abc123" \
-H "Content-Type: application/json" \
-d '{
"name": "llama-inference-prod",
"gpu": "H100",
"count": 8,
"region": "morocco-dakhla",
"sovereignty": "strict",
"carbonAware": true,
"schedule": "carbon-optimal"
}'