The System One EventUtahGo To Event Page →

Docs

Set up Midium, use every part of it, run it for your team, and build on it.

Quickstart

Send your first request to the models on this Mac — with cURL, the OpenAI SDKs or the `midium` command — and find where to go next.

For developers

Midium serves an OpenAI-compatible API (and an Anthropic-compatible one) from this Mac. Anything that can talk to OpenAI can talk to Midium: change the base URL, use your Midium key, and name a Midium model.

Before you start#

You need three things. The examples on this page fill them in for you from this Mac.

WhatValue hereWhere to find it
Base URLhttp://127.0.0.1:9100/v1Settings → API, or the connection pill at the top of the window
API keyYOUR_API_KEYSettings → API (Your local key), the connection pill, or midium key --reveal
ModelYOUR_MODELAny chat model on Settings → Models. Use its name as shown.

The engine listens on 127.0.0.1 only, so requests must come from this Mac. See Remote access to reach it from elsewhere.

Send a chat request#

curl http://127.0.0.1:9100/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_MODEL",
    "messages": [{"role": "user", "content": "Say hello in five words."}]
  }'

If the model isn't in memory yet, the first request loads it, so it can take a while. Later requests answer right away.

The reply is a standard chat completion. A reasoning model's thinking comes back separately, in message.reasoning_content, not in content. See Chat completions.

Or ask from the terminal#

The midium command can do the same without any code:

Shell
midium ask "Say hello in five words."
midium ask gemma "Say hello in five words."   # pick a model; a partial name works
cat notes.txt | midium ask "Summarize this"    # a piped prompt works too

With no model named, midium ask uses the Sub-agent model from Settings → Agent, else one already in memory. See CLI reference.

Stream the reply#

Add "stream": true to get the reply as it's written, as server-sent events:

curl -N http://127.0.0.1:9100/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "YOUR_MODEL", "stream": true,
       "messages": [{"role": "user", "content": "Count to ten."}]}'

List your models#

Shell
curl http://127.0.0.1:9100/v1/models -H "Authorization: Bearer YOUR_API_KEY"

Each entry's id is the name to send as model. Entries also say what the model is for (type: chat, embedding, rerank, transcription, …) and whether it takes images (capabilities.vision).

Where to go next#

Something here wrong or out of date? Tell us.