> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mixlayer.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mixlayer.com/_mcp/server.

# Platform API

> Manage Mixlayer organizations, models, billing, analytics, and API keys

The Mixlayer Platform API lets you automate organization administration outside the console.

The base URL is:

```text
https://api.mixlayer.com/v1/
```

Authenticate with the same Bearer token format used by the model API:

```bash
Authorization: Bearer $MIXLAYER_API_KEY
```

Your API key must have the permissions required for the operation.

## Capabilities

Platform API endpoints are grouped around these resources:

| Area                                                                                                                                                                                          | Permissions                                                                               |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| Organizations List the key's organization, get organization details, update organization settings, list resources, list members, manage invitations, and update or remove members.            | `api-read` for reads, `api-admin` for updates                                             |
| Routing Policy Read or replace the organization's inference routing policy. See [Regional Routing](/regions-and-routing) for latency-based routing, region priorities, and fallback examples. | `api-read` for reads, `api-admin` for updates; replacement requires an organization owner |
| Models List organization model access and request model access.                                                                                                                               | `api-read` for lists, `api-write` to request access                                       |
| API Key Management Create, list, update, rotate, and delete organization API keys.                                                                                                            | `api-read` to list, `api-admin` for changes                                               |
| Analytics Read overview metrics and request sequences for an organization.                                                                                                                    | `api-read`                                                                                |
| Audit Log List audit log entries for an organization.                                                                                                                                         | `api-admin`                                                                               |
| Billing Accounts Read billing account details, usage, spend controls, refills, and current usage invoices. Configure refills, auto-refill, and spend controls.                                | `api-read` for reads, `api-admin` for changes                                             |

## Examples

List the organizations visible to the API key:

```bash
curl https://api.mixlayer.com/v1/organizations \
  -H "Authorization: Bearer $MIXLAYER_API_KEY"
```

List models available to the organization:

```bash
curl https://api.mixlayer.com/v1/organizations/$ORG_ID/models \
  -H "Authorization: Bearer $MIXLAYER_API_KEY"
```

Create a Platform API key:

```bash
curl https://api.mixlayer.com/v1/organizations/$ORG_ID/api_keys \
  -H "Authorization: Bearer $MIXLAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CI platform key",
    "permissions": ["api-read", "api-write"]
  }'
```

New key secrets are only returned once, when the key is created or rotated.