MIDADeveloper foundation

MIDA Core API 0.2

Build the experience.
Reuse the intelligence.

A practical contract for connecting reading, speaking, homework, science, and future learning applications to one child-safe, bilingual educational backend.

Service foundation active API version v1 OpenAPI 3.1 English + 简体中文

Core contract

Every answer carries more than text.

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.

01

Learner context

Age, language, requested depth, and recent conversational context.

02

Safety decision

Allow, support, redirect, or block—with category and risk level.

03

Teaching plan

Age band, explanation depth, strategy, and response target.

04

Consent result

Whether educational history was stored and the explicit reason.

First request

Ask MIDA to explain.

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

A deliberately small version-one surface.

GET/api/v1/health

Public service health and active mode

GET/api/v1/capabilities

Discover supported educational capabilities

POST/api/v1/chat

Run the complete safety and explanation pipeline

POST/api/v1/learners

Create or update a tenant-scoped learner

GET/api/v1/learners/{id}

Read a learner profile inside its tenant

DELETE/api/v1/learners/{id}

Delete a learner and all dependent records

POST/api/v1/learners/{id}/consents

Record grant or withdrawal of educational-history consent

GET/POST/api/v1/learners/{id}/memories

Read or add consented educational memory

POST/api/v1/admin/bootstrap

Create a tenant and first application client

POST/api/v1/admin/clients/{id}/revoke

Immediately revoke an application credential

Safety contract

Three independent boundaries.

Before generation

Privacy, dependency, self-harm, sexual-content, and serious-harm patterns are classified before a model receives the request.

During generation

The provider receives a fixed identity, teaching, privacy, language, and child-safety contract. User content cannot rewrite that contract.

After generation

The answer is checked for secrecy, isolation, unsafe authority claims, and requests for sensitive child information.

Configuration

Connect an approved intelligence provider.

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 client
MIDA_ALLOWED_ORIGINSComma-separated approved application origins
MIDA_MODEL_ENDPOINTFull server-side model endpoint
MIDA_MODEL_API_KEYServer-side provider credential
MIDA_MODEL_NAMEConfigured model identifier