# Hosted API (/platform/hosted-api)





The hosted API is the versioned external control-plane surface at
`/api/v1/mogplex/*`.

Use it when another system needs to inspect or drive Mogplex state directly:
repositories, agents, models, sandboxes, automations, runs, events, logs, and
MCP server definitions.

<Callout type="info">
  Unversioned `/api/*` routes are private web-app implementation surfaces. Do
  not build external integrations against them.
</Callout>

## Use the API when [#use-the-api-when]

* a CI job or internal tool needs to start or inspect runs
* a dashboard needs repository, run, model, sandbox, or automation state
* a local agent needs the Mogplex MCP tools
* the CLI needs versioned hosted account state
* an adjacent service needs a supported external contract

Prefer the app when a human is configuring account setup, GitHub coverage,
agents, routing, or sandboxes interactively.

## Public resource model [#public-resource-model]

The public API exposes product resources without exposing the browser app's
private route tree:

| Family      | Examples                                                       |
| ----------- | -------------------------------------------------------------- |
| Discovery   | `/repos`, `/agents`, `/models`                                 |
| Runtime     | `/sandboxes`, `/runs`, run events and logs                     |
| Automations | `/automations`, publish, model override, trigger, and run logs |
| MCP         | `/mcp/servers` and the OAuth-enabled `/mcp` transport          |

The [API endpoint index](/reference/api#endpoint-index) lists every method and
scope.

## Auth model [#auth-model]

Direct REST integrations use personal access tokens. Supported local MCP
clients use OAuth 2.1 authorization code with PKCE.

Start with:

* [API Authentication](/reference/api#authentication) for PATs, OAuth, scopes,
  idempotency, and rate limits
* [API Errors](/reference/api#errors) for envelope shape and status behavior
* [API Quickstart](/reference/api#quickstart) for copyable requests

## Good first calls [#good-first-calls]

* `GET /api/v1/mogplex/repos` to discover repository and installation ids
* `GET /api/v1/mogplex/models` to inspect available models
* `GET /api/v1/mogplex/automations` to list bounded automation summaries
* `GET /api/v1/mogplex/mcp/servers` to export CLI-ready MCP definitions
* `POST /api/v1/mogplex/runs` to start headless agent work

## Read next [#read-next]

<Cards>
  <Card title="API Reference" href="/https/docs.mogplex.com/reference/api" description="Authentication, request types, payloads, responses, errors, and every public endpoint on one page." />

  <Card title="Mogplex MCP" href="/https/docs.mogplex.com/mcp" />

  <Card title="Headless Runs" href="/https/docs.mogplex.com/cli/automation/headless-runs" />
</Cards>
