Hesperan

(Docs)

API reference

Base URL https://api.hesperan.com. JSON in, JSON out. The machine-readable description is at /openapi.json (OpenAPI 3.1).

Authentication

Send your key as a bearer token: Authorization: Bearer hsp_…. Keys belong to your account; create and revoke them in the console. Never ship a key in browser or mobile code — call the API from your server.

POST /v1/systemone

Answer one or more typed questions about a state.

FieldTypeDescription
statestring | object | arrayWhat the questions are about. Up to 256 KB per request body.
questionsobjectMap of question name → question. At least one.
questions.*.type"choice" | "noul" | "score"The judgment type.
questions.*.instructionsstringThe question (choice, score) or statement (noul).
questions.*.criteriaobject | arraychoice: key → description · noul: optional { true, false } · score: level descriptions, lowest first.

Response

FieldTypeDescription
modelstringModel that answered, e.g. hesperan-1.
answersobjectOne answer per question name, with the same type.
answers.*.choicestringchoice: the most likely option key.
answers.*.noulnumbernoul: probability that the statement holds.
answers.*.scorenumberscore: expected level, Σ level × probability.
answers.*.probabilitiesobjectchoice and score: probability per option / level; sums to 1.
usage.input_tokensintegerTokens read for this request.
timing_msnumberTime the model spent deciding, in milliseconds.

Response headers

HeaderMeaning
x-request-idUnique id; include it when you contact support.
x-billed-toWhat paid for this answer: plan or balance.
x-plan-usageShare of this period's plan allowance used, e.g. 42%.
x-balance-remainingYour prepaid balance in euros after this request.
x-ratelimit-limitRequests per minute for this key's plan.
x-ratelimit-remainingRequests left in the current window.

GET /health

Unauthenticated. Returns 200 with the model id when the service can answer, 503 otherwise.

Response
{ "status": "ok", "model": "hesperan-1", "upstream": "ok" }