Learner context
Age, language, requested depth, and recent conversational context.
MIDA Core API 0.2
A practical contract for connecting reading, speaking, homework, science, and future learning applications to one child-safe, bilingual educational backend.
Core contract
MIDA returns the learner-facing answer together with the safety decision, pedagogical strategy, provider identity, persistence result, and a trace identifier. Connected apps can render the answer while their adult-facing systems use the structured metadata.
Age, language, requested depth, and recent conversational context.
Allow, support, redirect, or block—with category and risk level.
Age band, explanation depth, strategy, and response target.
Whether educational history was stored and the explicit reason.
First request
The public presentation accepts same-origin demonstration requests without storing history. Connected applications authenticate with an API key and tenant context. Set learner.language to en or zh-CN to choose the answer language.
curl -X POST https://mida.skyed.cn/api/v1/chat \
-H 'content-type: application/json' \
-H 'x-mida-api-key: APPLICATION_SECRET' \
-H 'x-mida-tenant-id: TENANT_UUID' \
-H 'x-mida-client-id: CLIENT_UUID' \
-d '{
"message": "Why does the Moon follow us?",
"learner": { "age": 9, "language": "en" },
"requestedDepth": "balanced",
"history": [],
"consent": { "persistEducationalHistory": false }
}'Endpoints
/api/v1/healthPublic service health and active mode
/api/v1/capabilitiesDiscover supported educational capabilities
/api/v1/chatRun the complete safety and explanation pipeline
/api/v1/learnersCreate or update a tenant-scoped learner
/api/v1/learners/{id}Read a learner profile inside its tenant
/api/v1/learners/{id}Delete a learner and all dependent records
/api/v1/learners/{id}/consentsRecord grant or withdrawal of educational-history consent
/api/v1/learners/{id}/memoriesRead or add consented educational memory
/api/v1/admin/bootstrapCreate a tenant and first application client
/api/v1/admin/clients/{id}/revokeImmediately revoke an application credential
Safety contract
Privacy, dependency, self-harm, sexual-content, and serious-harm patterns are classified before a model receives the request.
The provider receives a fixed identity, teaching, privacy, language, and child-safety contract. User content cannot rewrite that contract.
The answer is checked for secrecy, isolation, unsafe authority claims, and requests for sensitive child information.
Configuration
MIDA runs in verified demonstration mode without provider credentials. A deployment can connect a server-side chat-completions-compatible provider while keeping the client contract unchanged.
MIDA_ADMIN_KEYProvisioning-only server secret; application secrets are generated per clientMIDA_ALLOWED_ORIGINSComma-separated approved application originsMIDA_MODEL_ENDPOINTFull server-side model endpointMIDA_MODEL_API_KEYServer-side provider credentialMIDA_MODEL_NAMEConfigured model identifier