Skip to main content

API Reference

This page lists all API endpoints across the Hokusai platform. For detailed request/response schemas and code examples, follow the links to the dedicated documentation pages.

Authentication Service​

Base URL: https://auth.hokus.ai

The authentication service manages registration, authentication, API keys, organizations, and usage tracking for the entire Hokusai platform.

Registration​

MethodEndpointAuth RequiredDescriptionDocs
GET/registerNoRegistration web formRegistration
POST/registerNoSubmit a registration requestRegistration
POST/registration/statusNoCheck registration status by emailRegistration
GET/register/rate-limit-statusNoCheck rate limit before submittingRegistration

Sign-In with Ethereum (SIWE)​

MethodEndpointAuth RequiredDescriptionDocs
POST/auth/siwe/challengeNoGenerate a wallet authentication challengeSIWE
POST/auth/siwe/verifyNoVerify a signed message and get JWTSIWE

Key Management​

All key management endpoints require admin authentication via Authorization: Bearer {ADMIN_TOKEN}.

MethodEndpointDescriptionDocs
POST/api/v1/keysCreate a new API keyAPI Keys
GET/api/v1/keysList all API keysAPI Keys
GET/api/v1/keys/{key_id}Get details for a specific keyAPI Keys
POST/api/v1/keys/{key_id}/rotateRotate a key (revoke old, create new)API Keys
DELETE/api/v1/keys/{key_id}Revoke an API keyAPI Keys

Validation​

MethodEndpointAuth RequiredDescriptionDocs
POST/api/v1/keys/validateNo (public)Validate an API keyValidation
POST/api/v1/tokens/validateNo (public)Validate a JWT tokenValidation

Organizations​

Organization endpoints require JWT authentication. Required roles are noted per endpoint.

MethodEndpointMin RoleDescriptionDocs
POST/api/v1/organizationsAuthenticatedCreate an organizationAPI Keys
GET/api/v1/organizations/{org_id}ViewerGet organization details—
PATCH/api/v1/organizations/{org_id}AdminUpdate organization—
DELETE/api/v1/organizations/{org_id}OwnerDelete organization—
GET/api/v1/organizations/{org_id}/membersViewerList members—
PATCH/api/v1/organizations/{org_id}/members/{user_id}AdminUpdate member role—
DELETE/api/v1/organizations/{org_id}/members/{user_id}AdminRemove member—
POST/api/v1/organizations/{org_id}/invitationsAdminSend invitation—
GET/api/v1/organizations/{org_id}/invitationsAdminList pending invitations—
DELETE/api/v1/organizations/{org_id}/invitations/{id}AdminRevoke invitation—
POST/api/v1/invitations/acceptAuthenticatedAccept an invitation—
POST/api/v1/organizations/{org_id}/api-keysDeveloperCreate org API keyAPI Keys
GET/api/v1/organizations/{org_id}/api-keysViewerList org API keysAPI Keys
DELETE/api/v1/organizations/{org_id}/api-keys/{key_id}DeveloperRevoke org API keyAPI Keys
GET/api/v1/organizations/{org_id}/audit-logsAdminList audit logs—

Usage & Billing​

MethodEndpointAuth RequiredDescriptionDocs
POST/api/v1/usage/{key_id}No (internal)Record API usageUsage & Billing
GET/api/v1/usage/{key_id}/statsAdminGet usage statisticsUsage & Billing
GET/api/v1/usage/{key_id}/billingAdminGet billing informationUsage & Billing
GET/api/v1/usage/aggregateAdminAggregate usage across all keysUsage & Billing

Admin — Registration Management​

MethodEndpointAuth RequiredDescription
GET/api/v1/admin/registrationsAdminList registration requests (paginated, filterable)
GET/api/v1/admin/registrations/{id}AdminGet registration details
PATCH/api/v1/admin/registrations/{id}AdminApprove or reject a registration
GET/api/v1/admin/registration/whitelistAdminList rate-limit whitelist entries
POST/api/v1/admin/registration/whitelistAdminAdd whitelist entry (IP or domain)
PATCH/api/v1/admin/registration/whitelist/{id}AdminEnable/disable whitelist entry
DELETE/api/v1/admin/registration/whitelist/{id}AdminDelete whitelist entry
GET/api/v1/admin/registration/bans/{ip}AdminCheck ban status for an IP
DELETE/api/v1/admin/registration/bans/{ip}AdminRemove temporary IP ban

Health & Monitoring​

MethodEndpointAuth RequiredDescription
GET/healthNoService health check
GET/readyNoReadiness check (database + Redis)
GET/metricsNoService metrics summary

Model API​

Base URL: https://api.hokus.ai

The Model API provides access to Hokusai's AI models for predictions and management. All endpoints require a valid API key.

For detailed Model API documentation, see the Model API Guide.

Models​

MethodEndpointDescription
GET/v1/modelsList available models
GET/v1/models/{model_id}Get model details

Predictions​

MethodEndpointDescription
POST/v1/predictSingle prediction
POST/v1/batch-predictBatch prediction

Technical Task Router (Model 30)​

MethodEndpointDescriptionDocs
POST/api/v1/models/30/predictRequest a routing recommendationRouter Contracts
POST/api/v1/models/30/contributionsSubmit optional harness_outcome_row/v1 rowsOutcome Reporting

License Management​

MethodEndpointDescription
GET/v1/models/{model_id}/licenseCheck license status

Benchmark Datasets​

All benchmark dataset endpoints require a valid API key. See Uploading Datasets via API for a full walkthrough.

MethodEndpointDescription
POST/api/v1/benchmarks/upload/{model_id}Upload a CSV or Parquet benchmark dataset (multipart, ≤ 500 MB); creates a BenchmarkSpec record
GET/api/v1/dataset-arrivalsList recent S3 dataset arrivals; optional ?model_id=&limit= query params

Path parameters

ParameterTypeDescription
model_idstringThe unique identifier of the model to associate with the dataset

Evaluation Schedules​

All evaluation schedule endpoints require a valid API key. A BenchmarkSpec must exist for the model before a schedule can be created. See Automating Evaluations with Schedules.

MethodEndpointStatusDescription
POST/api/v1/models/{model_id}/evaluation-schedule201Create an evaluation schedule; 409 if one already exists
GET/api/v1/models/{model_id}/evaluation-schedule200Retrieve the current schedule
PUT/api/v1/models/{model_id}/evaluation-schedule200Update the cron_expression or enabled flag
DELETE/api/v1/models/{model_id}/evaluation-schedule204Remove the schedule

Path parameters

ParameterTypeDescription
model_idstringThe unique identifier of the model whose evaluation schedule to manage

Common Response Formats​

Success Response​

{
"data": { ... },
"status": "success"
}

Error Response​

{
"detail": "Human-readable error message"
}

Standard HTTP Status Codes​

CodeMeaning
200Request succeeded
400Invalid request parameters
401Missing or invalid authentication
403Valid auth but insufficient permissions
404Resource not found
409Conflict (e.g. duplicate evaluation schedule)
413Payload too large (file exceeds size limit)
422Validation failed (schema, PII, or column errors)
429Rate limit exceeded
500Internal server error
503Service unavailable (dependency down)

Authentication​

All Hokusai APIs authenticate using API keys. See the Authentication Overview for details on: