Milkloud
Milkloud provides authentication and online data services for Milthm. Applications can use OpenID Connect (OIDC) to act on behalf of multiple users. A user can instead create a User Token for a personal script or another trusted tool.
API Base URLs
Choose the API base used by the Milkloud service that the user accesses.
| Service | API base |
|---|---|
| China | https://milkloud.milthm.cn/api |
| Global | https://milkloud.milthm.com/api |
Append the endpoint paths in this guide to the selected API base.
Choose an Authentication Method
| Use case | Method | Credential sent to the API |
|---|---|---|
| A website, native app, or service used by multiple people | OIDC | Authorization: Bearer <access_token> |
| A personal script or trusted private tool | User Token | Authorization: Basic <credential> |
Do not embed a User Token in a public website, distributed app, public repository, log, or support message. Use OIDC when each user must grant access to an application.
HTTP Conventions
| Parameter | Location | Required | Default | Description |
|---|---|---|---|---|
Accept-Language | Header | No | English | A standard language preference such as ja, en;q=0.8. It changes human-readable messages, not the response schema or symbolic code. |
Timestamps use RFC 3339 and may include a UTC offset and fractional seconds.
Response Envelope
Milkloud API responses use a common JSON envelope:
export interface MilkloudResponse<T> {
code: string;
message: string;
data?: T;
}A successful response has code and message set to OK. Errors use a non-success HTTP status and a symbolic code. See Errors for recovery guidance.
API Overview
See Scopes for each scope's capability, inclusion rules, and support by OIDC and User Tokens.
| Operation | Method and path | Required resource scope |
|---|---|---|
| Read a public profile | GET /v1/user/:identity | None |
| Read the current user's profile | GET /v1/user | Fields depend on openid, profile, user, and email |
| Update the current user's nickname | PATCH /v1/user | user |
| Read cloud-save metadata | GET /v1/game/save/info | milthm:save:read |
| Request a cloud-save download URL | GET /v1/game/save | milthm:save:read |
| Read the current user's recent scores | GET /v1/user/:username/recent | milthm:event:recent |
| Read the current user's Reality and best performances | GET /v1/user/:username/rank | milthm:stats:best_performance |
See Scopes, Errors, Profile, Cloud Save, and Recent Scores and Rank for request and response details.