> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Gateway

> Turn on the Model Gateway, decide who can create Model Gateway keys, set spend and rate limits, review every key and see what keys cost.

![Model Gateway map with the heading All your models behind one gateway, connecting coding tools such as REST API, Claude, OpenCode, Codex, Cursor and GitHub Copilot through the Langdock gateway, turned on for everyone, to model providers such as OpenAI, Anthropic, Google, DeepSeek and Meta](https://mintcdn.com/langdock-34/50oda34lhL8TAAKF/images/model-gateway/admin-gateway-hero.png?fit=max\&auto=format\&n=50oda34lhL8TAAKF\&q=85\&s=237fb98f44f1bba7d5a021c01852fc7f)

The Model Gateway lets members use your workspace's models in coding tools like Claude Code, Codex and Cursor, and in their own code, with a personal **Model Gateway key**. Every request runs under the member's account, counts toward their spend limit and shows up in your analytics. You find it under **Settings > Workspace > Model Gateway**, next to **Platform API**, which holds the keys for Langdock's own APIs. See [API keys](https://docs.langdock.com/en/developer/overview/api-keys.md) for how the two kinds of keys differ.

> [!NOTE]
>
> The Model Gateway is rolling out. Until it is enabled for your workspace, you manage all API keys under [Settings > Workspace > Products > API](https://docs.langdock.com/en/admin/manage-usage/personal-api-keys.md). It is not available on dedicated deployments yet.

## Turn it on

The first time you open **Model Gateway > Access**, you choose **Turn on for everyone** or **Just for me** to try it yourself first. On Langdock Cloud, gateway requests are paid from [extra usage](https://docs.langdock.com/en/admin/manage-usage/extra-usage.md), so the page asks you to enable extra usage if it is off. On BYOK workspaces, requests run on your own model keys and count toward your [usage limits](https://docs.langdock.com/en/admin/manage-usage/byok/usage-limits.md).

![Turn on the gateway card with the buttons Turn on for everyone and Just for me](https://mintcdn.com/langdock-34/50oda34lhL8TAAKF/images/model-gateway/admin-gateway-turn-on.png?fit=max\&auto=format\&n=50oda34lhL8TAAKF\&q=85\&s=3639e79c5cf21569e770b9329b372547)

Then create your own key and send a first request from the page. When you are ready, **Let users know** publishes a short info box in chat or copies a link to **Account > API keys** for you to share.

## Access

* **General access** lets everyone in the workspace create a Model Gateway key.
* **Allow specific users or groups to create Model Gateway keys** limits it to the people and groups you add.
* Members without access can ask for it from their keys page. Open requests show up here with a count on the tab. **Approve** gives the member access right away.

![Model Gateway Access tab with General access turned on and the option to allow only specific users or groups](https://mintcdn.com/langdock-34/50oda34lhL8TAAKF/images/model-gateway/admin-gateway-access.png?fit=max\&auto=format\&n=50oda34lhL8TAAKF\&q=85\&s=0ce21f1ebfdd40c6a1dac4931155acbe)

This list is separate from who can create Platform API keys, which you set on the **Platform API** page. Until you change it here for the first time, Model Gateway access follows the access you gave for personal API keys.

Model Gateway keys always include model access (Completion API). **Run agents** and **Embedding** are optional and need your approval. Members never get workspace wide admin scopes on a personal key.

## Limits

| Section | What it controls |
| - | - |
| **Workspace total** | The workspace's extra usage limit, shared with chat. When it is reached, extra usage stops for everyone. Admins get an email at 80% and 100%. On BYOK workspaces this is the workspace spend limit from **Usage limits** |
| **Per person** | Each person's monthly limit across chat and the Model Gateway: **Seat defaults** where everyone starts, **Group limits** for groups that need more, and **Personal limits** for single people, set under **Users** |
| **Quotas & limits** | Requests and tokens per minute for each model, with the busiest minute of each of the last 7 days. **Request more** asks Langdock for a higher quota. We reply by email within two working days |

People get the higher of their seat and group limit, unless they have a personal limit. On BYOK workspaces a personal limit adds to the seat or group limit. When a person or the workspace reaches a limit, their gateway requests fail with `429` until the limit resets or you raise it. Requests never fall back to another model. See [Limits and usage](https://docs.langdock.com/en/developer/model-gateway/limits-and-usage.md) for rate limits and how cached tokens count.

![Model Gateway Limits tab with the workspace extra usage limit and forecast, per person seat defaults, group limits set for 1 of 4 groups and personal limits, and per model quotas with requests and tokens per minute, one marked Requested](https://mintcdn.com/langdock-34/50oda34lhL8TAAKF/images/model-gateway/admin-gateway-limits.png?fit=max\&auto=format\&n=50oda34lhL8TAAKF\&q=85\&s=6c2540e1e70bfd458d9e72a81f09880d)

## Manage

**Manage** lists every key with model access: members' personal keys and workspace keys, with owner, expiry, last use and spend this month. A **+ Agents** badge marks keys that can also run agents. **Gateway + Platform** marks [combined keys](https://docs.langdock.com/en/developer/overview/migrate-combined-keys.md) created before the split. Revoking one of those also stops its Platform API access.

![Model Gateway Manage tab listing keys with their owner, expiry, last use and spend, two marked + Agents and one marked Gateway + Platform](https://mintcdn.com/langdock-34/50oda34lhL8TAAKF/images/model-gateway/admin-gateway-manage.png?fit=max\&auto=format\&n=50oda34lhL8TAAKF\&q=85\&s=4ce62e8d499e8348901bf08fec236a83)

* **Revoke** stops a key immediately, for example when someone leaves. This cannot be undone.
* **Create key** creates your own personal key or a workspace key for an app or automation. Workspace Model Gateway keys use the classic endpoint on `api.langdock.com` for now and count toward the monthly spend limit for workspace API keys.

## Analytics

**Analytics** shows what your API keys cost, including agent runs, for a period you choose, and can be filtered by group:

* Spend, tokens, model calls and active users, and spend over time split into models, agent runs and other runs.
* A spend breakdown by person, model and API key.
* Model usage with cost and tokens by model, tokens by type (input, output, cache reads, cache writes), cache hit rate and latency.
* A CSV export of usage by user.

![Model Gateway Analytics tab with spend, tokens, model calls and active users for the last 30 days, a spend chart split into models, agent runs and other runs, a model calls chart and a spend breakdown by person](https://mintcdn.com/langdock-34/50oda34lhL8TAAKF/images/model-gateway/admin-gateway-analytics.png?fit=max\&auto=format\&n=50oda34lhL8TAAKF\&q=85\&s=35ab9570fbcc1088d4061f573655b215)

Gateway request history is kept for 90 days. Per person figures are hidden when **User level data** is off in your privacy settings. Workflows are not run by keys, so their cost counts toward your total in **Extra usage** instead.

## Related settings

| Setting | Where |
| - | - |
| Who can create Platform API keys, which API scopes personal keys can use, scopes per person or group | **Platform API > Access** and **Preferences** |
| Monthly spend limit and cost export for workspace keys | **Platform API > Preferences** |
| Workspace Platform API keys | **Platform API > Manage** |
| Which models can be used through the API | **Models** |
| Extra usage and per person limits outside the Model Gateway | **Extra usage** |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.