# Mortar documentation

> Mortar serves open-weight language models behind an OpenAI-compatible API, in Mortar's cloud or yours. Start with the quickstart, then look up any endpoint, field or error.

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.

```text title="Base URL"
https://api.mortar.one/v1
```

## Start here

- [Quickstart](/docs/quickstart). Create a key and send your first request from Python, TypeScript or curl, then stream the reply.
- [Authentication](/docs/authentication). How keys are issued, stored, rotated and revoked.
- [OpenAI compatibility](/docs/api#openai-compatibility). The few places Mortar behaves differently, starting with streaming by default.

## Build

- [Stream responses](/docs/guides/streaming). Read chunks, get usage, detect incomplete replies and cancel.
- [Write cache-friendly prompts](/docs/guides/prompt-caching). Order prompts so repeated requests skip most of their prefill.
- [Choose Managed Cloud or BYOC](/docs/guides/deployment-models). Decide where inference runs and what leaves your account.

## Look things up

- [API reference](/docs/api). Every endpoint, field, status code and error, starting with [chat completions](/docs/api/chat-completions).
- [Model catalog](/models). Context windows and sample prices for every model, with and without prompt caching.
- [Cost tools](/docs/api/cost). Find what a prompt wastes on prefill, and project a monthly bill at your cache hit rate.
- [Changelog](/docs/changelog). What changed, newest first.
