Mortar documentation
On this page
Mortar serves open-weight language models behind an OpenAI-compatible API, in its own cloud or in yours. Point an OpenAI SDK at Mortar's base URL, authenticate with a Mortar API key, and your chat-completions code keeps working.
https://api.mortar.one/v1Start here
- Quickstart. Create a key and send your first request from Python, TypeScript or curl, then stream the reply.
- Authentication. How keys are issued, stored, rotated and revoked.
- OpenAI compatibility. The few places Mortar behaves differently, starting with streaming by default.
Build
- Stream responses. Read chunks, get usage, detect incomplete replies and cancel.
- Write cache-friendly prompts. Order prompts so repeated requests skip most of their prefill.
- Choose Managed Cloud or BYOC. Decide where inference runs and what leaves your account.
Look things up
- API reference. Every endpoint, field, status code and error, starting with chat completions.
- Model catalog. Context windows and sample prices for every model, with and without prompt caching.
- Cost tools. Find what a prompt wastes on prefill, and project a monthly bill at your cache hit rate.
- Changelog. What changed, newest first.