Skip to content

Programmatic tools

Public discovery runs on haneoka.org. Job endpoints run on your local service; see the local computation guide for startup and complete examples.

GETHEAD /api/v1

Machine-readable entry points, request contracts and tool modules.

Authentication
None. Public, anonymous read.
Caching
public, max-age=300

Example request

Terminal window
curl -sS "https://haneoka.org/api/v1"

Example response

HTTP/2 200 OK
{}

Trimmed for length; the real response contains more entries.

GETHEAD /api/v1/openapi.json

Machine-readable entry points, request contracts and tool modules.

Authentication
None. Public, anonymous read.
Caching
public, max-age=300

Example request

Terminal window
curl -sS "https://haneoka.org/api/v1/openapi.json"

Example response

HTTP/2 200 OK
{}

Trimmed for length; the real response contains more entries.

GETHEAD /api/v1/tools

Machine-readable entry points, request contracts and tool modules.

Authentication
None. Public, anonymous read.
Caching
public, max-age=300

Example request

Terminal window
curl -sS "https://haneoka.org/api/v1/tools"

Example response

HTTP/2 200 OK
{}

Trimmed for length; the real response contains more entries.

GET /v1

Lists operations, queue concurrency and result lifetime.

Authentication
Local service Bearer token. Read the private headers file printed at startup.
Caching
no-store

Example request

Terminal window
curl -sS "http://127.0.0.1:8765/v1" \
-H "Authorization: Bearer ${localToken}"

Example response

HTTP/2 200 OK
{
"operations": [
"search",
"evaluate",
"growth",
"timeline",
"chart-image"
],
"concurrency": 1,
"resultTtlSeconds": 600
}

Errors

StatusCodeMeaning
400invalid_requestAn ID in the path or query is malformed.
401unauthorizedSupply the local Bearer token.
403origin_not_allowedCall from a local client or script.
404not_foundUnknown region or record.
404job_not_foundJob expired or was removed.
409image_not_readyWait for image completion.
413body_too_largeRequest exceeds 2 MiB.
429rate_limit_exceededToo many requests for this key; honour Retry-After when present.
429queue_fullWait for an active job or delete expired results.
POST /v1/jobs

Returns 202 and a Location to poll. Bodies: 2 MiB; queue: eight; execution: one job, five minutes. Inventories stay on this host.

Authentication
Local service Bearer token. Read the private headers file printed at startup.
Caching
no-store

Request body application/json

NameTypeDescription
operationrequired string search, evaluate, growth, timeline, chart-image or resource-image.
requestoptional object Required for calculations; use the corresponding type in tools/schema.json.

Example request

Terminal window
curl -sS -X POST "http://127.0.0.1:8765/v1/jobs" \
-H "Authorization: Bearer ${localToken}" \
-H "Content-Type: application/json" \
--data '{"operation":"chart-image","server":"intl","songId":"100001","difficulty":"expert","locale":"en","height":720}'

Example response

HTTP/2 202 Accepted
Location: /v1/jobs/00000000-0000-4000-8000-000000000001
{
"id": "00000000-0000-4000-8000-000000000001",
"operation": "chart-image",
"state": "queued"
}

Errors

StatusCodeMeaning
400invalid_requestAn ID in the path or query is malformed.
401unauthorizedSupply the local Bearer token.
403origin_not_allowedCall from a local client or script.
404not_foundUnknown region or record.
404job_not_foundJob expired or was removed.
409image_not_readyWait for image completion.
413body_too_largeRequest exceeds 2 MiB.
429rate_limit_exceededToo many requests for this key; honour Retry-After when present.
429queue_fullWait for an active job or delete expired results.
GET /v1/jobs/{id}

States: queued, running, completed, failed. Results expire ten minutes after completion. Read result, identity and optional image URL.

Authentication
Local service Bearer token. Read the private headers file printed at startup.
Caching
no-store

Parameters

NameInTypeDescription
idrequired path uuid Job ID returned by submission.

Example request

Terminal window
curl -sS "http://127.0.0.1:8765/v1/jobs/00000000-0000-4000-8000-000000000001" \
-H "Authorization: Bearer ${localToken}"

Example response

HTTP/2 200 OK
{
"id": "00000000-0000-4000-8000-000000000001",
"operation": "search",
"state": "completed",
"createdAt": 1793030400000,
"expiresAt": 1793031000000,
"result": {
"overall": [],
"results": [],
"stopReason": "complete"
}
}

Errors

StatusCodeMeaning
400invalid_requestAn ID in the path or query is malformed.
401unauthorizedSupply the local Bearer token.
403origin_not_allowedCall from a local client or script.
404not_foundUnknown region or record.
404job_not_foundJob expired or was removed.
409image_not_readyWait for image completion.
413body_too_largeRequest exceeds 2 MiB.
429rate_limit_exceededToo many requests for this key; honour Retry-After when present.
429queue_fullWait for an active job or delete expired results.
DELETE /v1/jobs/{id}

Closes the calculation context and removes the saved result. Later reads return 404.

Authentication
Local service Bearer token. Read the private headers file printed at startup.
Caching
no-store

Parameters

NameInTypeDescription
idrequired path uuid Job ID returned by submission.

Example request

Terminal window
curl -sS -X DELETE "http://127.0.0.1:8765/v1/jobs/00000000-0000-4000-8000-000000000001" \
-H "Authorization: Bearer ${localToken}"

Example response

HTTP/2 204 No Content

No response body.

Errors

StatusCodeMeaning
400invalid_requestAn ID in the path or query is malformed.
401unauthorizedSupply the local Bearer token.
403origin_not_allowedCall from a local client or script.
404not_foundUnknown region or record.
404job_not_foundJob expired or was removed.
409image_not_readyWait for image completion.
413body_too_largeRequest exceeds 2 MiB.
429rate_limit_exceededToo many requests for this key; honour Retry-After when present.
429queue_fullWait for an active job or delete expired results.
GET /v1/jobs/{id}/image.png

Requires a completed chart-image job and the same local Bearer token. Returns PNG; 409 while not ready.

Authentication
Local service Bearer token. Read the private headers file printed at startup.
Caching
no-store

Parameters

NameInTypeDescription
idrequired path uuid Job ID returned by submission.

Example request

Terminal window
curl -sS -o output.bin "http://127.0.0.1:8765/v1/jobs/00000000-0000-4000-8000-000000000001/image.png" \
-H "Authorization: Bearer ${localToken}"

Example response

HTTP/2 200 OK

Binary body (not shown).

Errors

StatusCodeMeaning
400invalid_requestAn ID in the path or query is malformed.
401unauthorizedSupply the local Bearer token.
403origin_not_allowedCall from a local client or script.
404not_foundUnknown region or record.
404job_not_foundJob expired or was removed.
409image_not_readyWait for image completion.
413body_too_largeRequest exceeds 2 MiB.
429rate_limit_exceededToo many requests for this key; honour Retry-After when present.
429queue_fullWait for an active job or delete expired results.
POST /v1/resource-image

Uses the same image recipes as the resource APIs. JSON: 8 MiB, output: 16 MiB, deadline: 50 seconds, one job at a time. See the image export guide for kind, data and viewer state.

Authentication
Local service Bearer token. Read the private headers file printed at startup.
Caching
no-store

Request body application/json

NameTypeDescription
kindrequired string team, gacha, gacha-history, stamp, chart, live2d or spine.
datarequired object Website export model; see /reference/images/.

Example request

Terminal window
curl -sS -o output.bin -X POST "http://127.0.0.1:8765/v1/resource-image" \
-H "Authorization: Bearer ${localToken}" \
-H "Content-Type: application/octet-stream" \
--data-binary @resource-image.json

Example response

HTTP/2 200 OK

Binary body (not shown).

Errors

StatusCodeMeaning
400invalid_requestAn ID in the path or query is malformed.
401unauthorizedSupply the local Bearer token.
403origin_not_allowedCall from a local client or script.
404not_foundUnknown region or record.
404job_not_foundJob expired or was removed.
409image_not_readyWait for image completion.
413body_too_largeRequest exceeds 2 MiB.
429rate_limit_exceededToo many requests for this key; honour Retry-After when present.
429queue_fullWait for an active job or delete expired results.
GET /v1/jobs/{id}/images.zip

Use the exact image URL returned by a completed resource-image archive job.

Authentication
Local service Bearer token. Read the private headers file printed at startup.
Caching
no-store

Parameters

NameInTypeDescription
idrequired path uuid Job ID returned by submission.

Example request

Terminal window
curl -sS -o output.bin "http://127.0.0.1:8765/v1/jobs/00000000-0000-4000-8000-000000000001/images.zip" \
-H "Authorization: Bearer ${localToken}"

Example response

HTTP/2 200 OK

Binary body (not shown).

Errors

StatusCodeMeaning
400invalid_requestAn ID in the path or query is malformed.
401unauthorizedSupply the local Bearer token.
403origin_not_allowedCall from a local client or script.
404not_foundUnknown region or record.
404job_not_foundJob expired or was removed.
409image_not_readyWait for image completion.
413body_too_largeRequest exceeds 2 MiB.
429rate_limit_exceededToo many requests for this key; honour Retry-After when present.
429queue_fullWait for an active job or delete expired results.