mere.run Local API
This page reflects the public Swift package. The API is not hosted by mere.run; it runs on the user's machine after starting mere.run api serve.
Start the server
swift run mere.run api serve --engine text-chat-gemma4
Network-exposed mode
export MERERUN_API_KEY=change-me
swift run mere.run api serve \
--engine text-chat-gemma4 \
--host 0.0.0.0 \
--port 11434 \
--api-key "$MERERUN_API_KEY" \
--rate-limit-per-minute 120
Routes
GET /health
GET /v1/models
POST /v1/chat/completions
POST /v1/embeddings
POST /v1/images/generations
POST /v1/images/edits
POST /v1/audio/speech
POST /v1/audio/transcriptions
GET /runtime/status
/v1/models, OpenAI-compatible routes, and runtime routes accept Authorization: Bearer <key> when the local operator starts the server with --api-key or MERERUN_API_KEY. This is API-key auth, not OAuth/OIDC.
Sidecar examples
curl http://127.0.0.1:8080/v1/embeddings \
-H "Content-Type: application/json" \
--data '{"model":"text-embed-qwen3-0.6b","input":["mere.run native embeddings","local RAG"]}'
curl http://127.0.0.1:8080/v1/images/generations \
-H "Content-Type: application/json" \
--data '{"model":"image-zimage-nano","prompt":"a compact local AI workstation","size":"1024x1024"}'
curl http://127.0.0.1:8080/v1/audio/speech \
-H "Content-Type: application/json" \
--output speech.wav \
--data '{"model":"speech-tts-qwen3-nano","input":"mere.run is serving native speech.","voice":"nova","response_format":"wav"}'