Skip to content

Quickstart

This quick start gets you to a working MIG runtime and a successful HELLO / DISCOVER / INVOKE flow.

Estimated time: about 10 minutes.

  • Running MIG runtime (migd)
  • curl

Start your MIG runtime on http://localhost:8080.

Terminal window
curl -sS http://localhost:8080/admin/v0.1/health/conformance

Expected shape:

{"core":true,"streaming":true,"evented":true,"full":true}
Terminal window
curl -sS -X POST http://localhost:8080/mig/v0.1/hello \
-H 'Content-Type: application/json' \
-H 'X-Tenant-ID: acme' \
-d '{
"header": {"tenant_id": "acme"},
"supported_versions": ["0.1"],
"requested_bindings": ["http"]
}'
Terminal window
curl -sS -X POST http://localhost:8080/mig/v0.1/discover \
-H 'Content-Type: application/json' \
-H 'X-Tenant-ID: acme' \
-d '{"header": {"tenant_id": "acme"}}'
Terminal window
curl -sS -X POST http://localhost:8080/mig/v0.1/invoke/observatory.models.infer \
-H 'Content-Type: application/json' \
-H 'X-Tenant-ID: acme' \
-d '{
"header": {"tenant_id": "acme"},
"payload": {"input": "hello MIG"}
}'

Open an SSE subscription:

Terminal window
curl -N http://localhost:8080/mig/v0.1/subscribe/observatory.inference.completed \
-H 'X-Tenant-ID: acme'

Publish an event:

Terminal window
curl -sS -X POST http://localhost:8080/mig/v0.1/publish/observatory.inference.completed \
-H 'Content-Type: application/json' \
-H 'X-Tenant-ID: acme' \
-d '{
"header": {"tenant_id": "acme"},
"payload": {"status": "done", "job_id": "job-1"}
}'

The subscription terminal should receive the event.

Start runtime with JWT auth enabled and a strong secret value:

Terminal window
MIGD_AUTH_MODE=jwt \
MIGD_JWT_HS256_SECRET=<set-a-strong-secret> \
migd

In JWT mode, include:

  • Authorization: Bearer <token>
  • X-Tenant-ID: <tenant>
  • tenant_id is required: include tenant in header and request body.
  • missing bearer token or invalid bearer token: check JWT mode and token claims.
  • capability not found: run DISCOVER and invoke an advertised capability ID.