Gateways

Description
A gateway is the central routing object. Each gateway exposes an inference endpoint, enforces auth, rate limit, budget, and guardrail policies, and routes requests to one or more upstream providers. Every gateway belongs to a tenant.
Through the API, a gateway's secret settings (web-search and embedding API keys, webhook secret, SIEM token / password, tracing headers) are write-only and stored encrypted: reads show a <name>_set boolean, and a save that leaves one out keeps it (details).
The Gateways page lives in the Organisation area: open Organisation from the user-block menu at the bottom of the left sidebar, then AI setup › Gateways (route /org/<organisation id>/ai-setup/gateways; the crumb reads Organisation › AI setup › Gateways). It requires the gateway-management permission (GATEWAYS_MANAGE; by default tenant admin and admin). Finance, member and viewer users see No access at this address.
The organisation is part of the address, so the page has no tenant picker: it always shows the gateways of the organisation in the URL. A platform admin first opens the organisation (from the Organisations list, or with the Organisation picker of the context bar — see The Organisation area) and then AI setup › Gateways.
The view lists every gateway of the organisation. Each row exposes an Open → button that opens the gateway page (/org/<organisation id>/ai-setup/gateways/<gateway id>; the crumb ends with the gateway slug). An address with an unknown gateway shows This gateway does not exist in this organisation (any more). with a link back to the list.
The search field at the top of the view filters the table as you type, matching the entered text against the gateway slug (case-insensitive). The empty field shows all gateways of the organisation. When no gateway matches, the table is replaced with a short "no match" message; clear the field to show the full list again.
The gateway page
The gateway page has four tabs, each with a count. The selected tab is part of the address (?view=), so a reload or a shared link keeps it.
| Tab | Address | Content |
|---|---|---|
| Endpoint & keys | default | The Gateway card (slug, Edit and Delete buttons; Edit opens the gateway settings page (…/gateways/<gateway>/settings), which also holds the EU routing setting), Budget, the configuration facts, the Endpoint URL, Provider keys and Platform models. The count is the number of provider keys. |
| Models & routing | ?view=routing |
Routing rules and Circuit breaker. The count is the number of routing rules. |
| Guardrails & residency | ?view=guardrails |
The Guardrails card with the builder and the execution plan, and the Built-in sources card. The count is the number of stored guardrail rules. EU routing stays on the gateway settings page, opened from the Gateway card. |
| Auth tokens | ?view=auth-tokens |
The gateway's auth tokens. Shown only to users with the token-management permission (GATEWAY_TOKENS_MANAGE). The count is the number of tokens. |
A budget-alert link with ?editToken=<token id> opens the edit page of that token (…/gateways/<gateway>/tokens/<token>/edit).
Old addresses keep working, with the query string kept: the former /gateways, /tenants/<id>/gateways, /tenants/<id>/gateways/<gateway id> and /tenants/<id>?tab=gateways redirect here.
Creating and editing a gateway, a token, a routing rule or a provider key each happen on a page of their own, with its own address, so a reload or a shared link lands on the same screen. These pages have a sticky bar at the bottom with Cancel and the save button (for example Save Changes, Create Gateway or Generate Token). If you leave one while it holds unsaved changes, you are asked to confirm before the changes are discarded.
For the consolidated reference for every gateway-config field, see Gateway configuration reference.
Built-in sources
On the Guardrails & residency tab, the card Built-in sources sets the trust class of the agent tools the gateway offers besides connectors, as a connector's data protection does: Web search (web_search), Web pages (fetch_url, agentic_fetch) and Knowledge and files (search_knowledge, read_file).
- Trust class per row. All three start as External service or public web. The public web is never an internal system: Internal system is disabled on the web rows. Choose Internal system for Knowledge and files when your knowledge bases hold your own data and may be delivered.
- Personal data shows what applies to each row (for example Query masked, Pages masked, Internal channels only for external delivery). Advanced opens the same two-row table as the connector card for that source.
- No PII masker. A gateway without an active PII masker shows Not detected on this gateway: the setting never turns detection on, it only decides what a hit means.
- Lowering (a looser trust class or cell) is held for a second administrator in Approvals; the gateway keeps its current setting until it is approved. A tightening saves at once. Your organisation's minimum for every source locks cells, shown as organisation floor.
- Save gateway saves the card on its own.
- At run time Personal data going to it decides the web-search query and the address of a fetched page, Coming back the results; Knowledge and files sends nothing out, so only its Coming back and delivery cells act. See Guardrails — Sources and trust classes.
- Changed by someone else. When another save changed the gateway after you opened it, a save here, on the Guardrails card or on the gateway's settings page is refused and nothing is written: This gateway was changed by someone else while you were editing. Reload the page and save again. (for the built-in sources: The data protection of this source was changed meanwhile. Reload the page and save again.). Your input stays in the form. Reload page asks Discard changes? first; Discard changes reloads the page and shows the stored gateway, Keep editing keeps your input.
See Gateways API — built-in sources.
Creating a gateway
Required role: tenant admin or admin.

💡 Note: In a free-trial workspace the two gateways are fixed. For workspace administrators, New Gateway and Delete are not shown; a hint explains why, with an upgrade link in your own workspace. Other roles that may manage gateways still see the controls, and the action is refused with the trial-lock message. Upgrade to a paid plan to add or remove gateways. Both controls also require the gateway-management permission.
Proceed as follows to create a gateway:

- Click on the New Gateway button at the top of the Gateways list.
- The New Gateway page opens (
/org/<org>/ai-setup/gateways/new). It holds the sections Identity & budget, Traffic controls, Authentication and Guardrails on one page. Nothing is created until you click Create Gateway.
- The New Gateway page opens (
- On the Identity & budget section, enter a value in the Name text field. The name must be lowercase, contain only letters, digits, and hyphens, and is used in inference URLs.
- If required, enter a value in the Gateway Budget (USD) text field. The budget applies to this gateway only; the tenant's overall spend is capped separately by its own budget. Leave the field empty for no limit.
⚠️ Caution: A budget of
0blocks every request on this gateway. The page shows a warning when you enter0. - Open the Traffic controls section and adjust the fields as required:
- Cache TTL (s) — the default is
0(response caching off); enter a number of seconds to enable it. - Retry Count — the default is
2; enter0to disable retries. The maximum is5. - Timeout (ms) — pre-filled
120000; per attempt, bounds sending the request and, for a provider call made non-streamed, the wait for the answer. See Timeouts for the exact precedence.
- Cache TTL (s) — the default is
- Open the Authentication section. Leave the Require auth token check box ticked unless explicitly developing with auth disabled.
- If required, open the Guardrails section and configure a guardrail pipeline. See Building a guardrail pipeline.
- Click on the Create Gateway button.
-> You return to the gateway list, where the new gateway appears and is active immediately. Configure provider keys (tab Endpoint & keys) and routing rules (tab Models & routing) on the gateway page.
💡 Note: Creating a gateway declares create-intent, so a duplicate name is refused rather than silently overwriting the existing gateway. If a gateway with the same name already exists in the organisation, the page stays open and shows "A gateway with this name already exists in this organisation. Choose a different name to create a new one, or edit the existing gateway." — your entry is kept so you can rename it. To change an existing gateway, edit it from its gateway page instead.
💡 Note: The New Gateway page has no provider field. Add provider keys after creation through the Add Model pages. See Provider keys (BYOK).
Editing a gateway
Required role: tenant admin or admin.

The full gateway configuration is edited on the gateway settings page (/org/<org>/ai-setup/gateways/<gateway>/settings), opened from the Gateway card on the gateway page (tab Endpoint & keys). The sections are tabs: General, Reliability, Performance, Tracing, Notifications and Search & tools. Switching tabs keeps your input; one Save Changes in the sticky bar at the bottom commits every tab's changes in a single request. Cancel leaves the page, and you are asked first if there are unsaved changes.
Proceed as follows to edit a gateway:
- Click on the Open → button of the gateway in the Gateways list.
- The gateway page opens on the Endpoint & keys tab.
- Click on the Edit button in the Gateway card header.
- The gateway settings page opens on the General tab.
- Click a tab, and update its fields as required:
- General — Gateway Budget (USD) and Budget Period (Monthly / Daily / Lifetime); Cache
TTL (s); Retry Count and Timeout (ms) (see Timeouts for what it bounds); Rate Limit (req) and Rate Window
(s); Require auth token and Log request/response payloads toggles; EU
routing (see below); Provider Base URLs override list.
⚠️ Caution: An agent schedule that requires approval before delivery re-reads the approved result from the stored request payload. While Log request/response payloads is off, such a schedule cannot be created, enabled, given a new destination or run now on this gateway, and existing ones are flagged to their owners as Not deliverable — their approved results could never be sent. Other edits (name, prompt, timing) still save. 💡 Note: While Log request/response payloads is off, the gateway also stores no turn replay record for its turns.
- Reliability — Circuit Breaker (enabled toggle, failure threshold, window in seconds, cooldown in milliseconds).
- Notifications — Webhooks (URL, secret, and the checkbox All events, including future
ones — ticked for a new webhook: it receives every event type, also ones added later. Untick it to
pick events with one checkbox per event type:
blocked,budget_exceeded,budget_threshold,circuit_open;budget_thresholdis the early budget warning atbudget_alert_pctof a budget, 80% by default; with no box checked the webhook receives nothing and the page says so; see Webhook payload) and the SIEM target (drop-down with Splunk HEC, Elasticsearch / OpenSearch, Vector, Syslog / CEF) with its type-specific connection fields. - Search & tools — Web Search (enabled toggle, search provider selector — Brave —
US or Linkup — EU, API key, max results (a whole number from
1to9007199254740991) — select Linkup — EU for gateways that enforce EU data residency), Image Generation, Video Generation, the IP allowlist, Code interpreter, Agentic fetch, Scan uploads for malware (ClamAV), and Max parallel tool calls. - Performance — Prompt caching (enabled toggle, TTL
5mor1h; on by default with a1hTTL — a gateway that has never had the setting saved shows and uses that default, and saving an unrelated setting does not write a caching value), Context compaction (enabled toggle, threshold tokens (a whole number from50000to9007199254740991), keep last turns; on by default), and the Compact error threshold. - Tracing — Enable request tracing toggle; when it is on, Include message bodies in trace and a Retention (hours) field (
1to720; stored but inert — trace retention is a deployment-wide setting, not per-gateway). See Request tracing.
- General — Gateway Budget (USD) and Budget Period (Monthly / Daily / Lifetime); Cache
TTL (s); Retry Count and Timeout (ms) (see Timeouts for what it bounds); Rate Limit (req) and Rate Window
(s); Require auth token and Log request/response payloads toggles; EU
routing (see below); Provider Base URLs override list.
- Click on the Save Changes button in the bar at the bottom.
-> The gateway uses the new configuration for every subsequent request.
EU routing
Required role: tenant admin or admin.
The Route to EU-owned providers only toggle, in the EU routing block of the General section, restricts this gateway to EU-owned providers: the Myra models, Mistral and IONOS. AWS Bedrock, Google Vertex and Azure OpenAI are US-owned clouds and are refused in every region, an EU region included (see EU data residency). Previously this control was reachable only by creating a guardrail template and opening its Target Controls section; it is now a direct, top-level gateway setting.
💡 Note: When your organisation enforces EU routing platform-wide (a tenant-level residency floor), this gateway is always EU-only regardless of this toggle — a gateway may only raise EU routing to on, never lower it below the organisation's floor. Turning the toggle off on a floored gateway has no effect on the next reload; the floor still governs. The per-template Target Controls override still exists for advanced, per-template cases.
On an EU-only gateway the gateway also checks the host that actually served a Myra-fleet response. The host must end in an EU DNS suffix (default .myra.eu; the operator can replace the list per deployment) or be an RFC 1918 private address. A loopback address or an unknown host is refused with 403 data_residency_blocked before any answer reaches the client, and the gateway logs [residency_egress_block]. An EU node that the router reports by a bare public IP or an unlisted host name is therefore refused until the operator adds its suffix.
Response caching
Cache TTL (s) (cache_ttl) sets how long the gateway keeps an exact-match copy of a response. 0 disables the cache. The TTL applies to all entries of the gateway; there is no TTL per model or per token.
- Cache key: tenant, gateway, provider, requested model, the request body without
streamanduser, the normalised web-search intent fromx-aig-web-search(on or off, so every off spelling shares one entry), andx-aig-knowledge-ids. Field order in the body does not matter. Two gateways never share entries. - Never cached: streaming requests, requests that name a conversation (
x-aig-conv-id,x-aig-policy-conv-id) or a project (x-project-id), requests withx-aig-knowledge-exclude-ids, a repeatedx-project-idorx-aig-web-searchheader, MCP tools, agent invokes, web-search turns and spoken (voice) turns (the gateway-internalx-aig-voice-langheader). - On a hit: the stored response is returned with
X-AIG-Cache: HIT, the provider is not called, and the request log recordssaved_cost_usdandsaved_latency_ms.
Number fields
The number fields of the gateway pages take whole numbers only. Typed text that is not a whole number (1e, abc, 1.5, -3, a value outside the range) is refused when you save: the page opens the tab that holds the field and names it with its range, and nothing is sent to the server. An empty field keeps its default meaning, for example no rate limit or the default timeout. A stored value that is out of range must be corrected before any save.
| Field | Range | Empty means |
|---|---|---|
| Cache TTL (s) | 0 to 9007199254740991 |
0 (cache off) |
| Retries | 0 to 5 |
2 |
| Timeout (ms) | 1 to 3600000 |
120000 |
| Rate limit: requests | 1 to 1000000000 |
no limit |
| Rate limit: window (s) | 1 to 31536000 |
60 |
| Web search: max results | 1 to 9007199254740991 |
5 |
| Compaction: threshold (tokens) | 50000 to 9007199254740991 |
200000 |
| Compaction: keep last turns | 1 to 1000 |
10 |
| Compact-error threshold | 0 to 10000000 (0 = off) |
off |
| Tracing: retention (h) | 1 to 720 |
48 |
| SIEM syslog port | 1 to 65535 |
514 |
The server enforces the same ranges and answers 400 with the field name (see Validated config fields), with two exceptions: Tracing retention is checked only in this dialog (the setting currently has no effect on the server), and a refused SIEM port is answered with 400 without a field name.
Timeouts
The Timeout (ms) field is a per-attempt deadline. What it bounds depends on how the gateway asks the provider for the answer, not on which client API you call.
- Sending the request to the provider is bounded by this value, unless a matching routing rule sets
timeout_ms; then the rule value bounds the send. - A provider call made non-streamed (for example a provider-native
stream:falserequest such as/v1/messagesor Gemini-native, the gateway's web-search step, a conversation summary, or an agentic fetch): this value bounds the wait for the answer and each pause while the answer arrives. A routing rule'stimeout_msor a built-in budget can set that read deadline instead (for example 300 s for an Anthropic model with web search, or 180 s for a Myra-hosted model with an estimated prompt of 50,000 tokens or more). - A streamed provider answer is never bounded by this value. The default stall budgets are 20 s to the first byte and 300 s between chunks. Other built-in budgets apply in some cases (for example 300 s for an Anthropic model with web search; 180 s to the first byte and between chunks for a Myra-hosted model with an estimated prompt of 50,000 tokens or more; a first-byte wait after a tool call on a Myra-hosted model that ramps up to 180 s; and a 30 s cap on the synthesis step of a tool loop). A stream that sends no headers within the first-byte wait is re-dialled on the same provider when it is the primary and no fallback is configured (a Myra-hosted model gets at least one re-dial even with
retry_count0) and the retry fits the remaining time limit. A stalled last fallback is not re-dialled, except a Myra-hosted one, which gets one re-dial if it fits; see First-byte timeouts. - Worst case to the first byte when every dial stalls: about (
retry_count+ 1) x the first-byte wait plus back-off (a Myra-hosted model: at least one re-dial), and never more than 150 s before the first byte or the request's overall limit; see First-byte timeouts. - A routing rule's
timeout_msreplaces this value (for the send and the waits) and the default and built-in stall budgets for the leg the rule routes. A shorter platform cap still applies, for example the tool-loop synthesis step or the re-dial after a tool call; a rule cannot extend those. - Connecting: each connection step (TCP connect, TLS handshake) takes at most 5 s. For other providers this value can shorten that, not widen it (or the matching rule's
timeout_ms, when set). The Myra fleet uses a fixed 5 s per step. - To limit how long you wait for an answer, set
timeout_mson a routing rule (see the Routing rules API). It replaces the gateway value and the built-in waits (except the shorter platform caps above) for the leg that rule routes, and it does not cap a stream that is actively delivering tokens. The routing-rule dialog keeps atimeout_msthat was set through the API when you save the rule. If a rule carries a legacy invalidtimeout_ms, the save is refused with a message that namestimeout_msand its range (1 to 3600000); fix such a rule through the API.
Deleting a gateway
Required role: tenant admin or admin.
⚠️ Caution: Deleting a gateway is irreversible. The gateway, its routing rules, its tokens, and its provider keys are removed. Logs are retained but no longer associated with a live gateway.
💡 Note: A free-trial workspace's two gateways are fixed, so Delete is not shown to workspace administrators there; see the note under Creating a gateway above.
Proceed as follows to delete a gateway:
- Open the gateway page (tab Endpoint & keys).
- Click on the Delete button in the Gateway card header.
- A confirmation dialog opens with the question Delete gateway "
<slug>"? This cannot be undone.
- A confirmation dialog opens with the question Delete gateway "
- Click on Confirm in the confirmation dialog.
-> The gateway is removed and the application returns to the Gateways list.
Resetting the spend counter
When a gateway has a configured budget, the Budget stat card shows the current spend. For a platform administrator, the Reset Spend button appears beside the Budget label when a budget is configured; other roles do not see it.
🔒 Platform-admin only. Resetting the spend counter re-opens the gateway's budget cap, so it is reserved for platform administrators. A tenant admin does not see the button, and a direct API call from one receives
403 Forbiddenand the counter is unchanged; ask your platform operator to reset spend. Every reset is recorded in the audit log.
Proceed as follows to reset the spend counter:
- Open the gateway page (tab Endpoint & keys).
- Locate the Budget stat card.
- Click on the Reset Spend button and confirm.
-> The accumulated spend is cleared for all periods (the API's ?period= resets one period only). Requests blocked with quota_exceeded are admitted again, up to the configured budget.
Provider base URLs
The Provider Base URLs list in the General tab of the gateway settings page overrides the upstream endpoint of any provider on a per-gateway basis. Use it for private deployments, self-hosted models, or corporate proxies.
The provider is chosen from a dropdown of supported providers — it is not free text. The list is the provider registry the gateway routes on; a value that is not a supported provider is refused on save (see the validation note below), because an override keyed by an unknown provider is never looked up at request time and would silently never route.
The override value is a bare protocol://host:port with no trailing slash and no path. The gateway appends the standard request path of the provider automatically.
| Provider id | Override example | When to use |
|---|---|---|
myra |
http://172.28.0.1:8003 |
Self-hosted model endpoint (e.g. a vLLM server). Use the myra id — the legacy vllm id is not a routable provider and is rejected. |
openai |
https://proxy.internal/openai |
Corporate proxy in front of the OpenAI API. |
Validation and the Test button. On save, each override is checked for a
supported provider and for URL format. The provider must be one the gateway can route to
(the dropdown offers only these); an unknown slug is rejected, and a legacy alias such as vllm is
rejected with a message pointing at its canonical id (myra). The URL must be a valid http:// or
https:// URL with no userinfo and no whitespace; a malformed value
is rejected inline so it can never be saved and then silently fail to route. A saved override that
passes this check can still be blocked when traffic is actually sent if its host resolves to a
private or internal address (the SSRF guard runs at request time, and returns a
configuration_error). Use the per-row Test button as the pre-save check: it performs the same
SSRF-guarded dial and reports reachable (with HTTP status + latency) or the reason it failed,
before you save.
Search & tools

The Search & tools tab of the gateway settings page exposes per-gateway capability controls that were previously reachable only through the admin API:
| Control | Effect | Notes |
|---|---|---|
| IP allowlist | Restricts inference to the listed source IPs (CIDR notation). | One CIDR per row; an empty list allows all source IPs. A malformed CIDR is flagged inline and rejected on save. Filters inference only, not the admin API. See IP allowlist. |
| Code interpreter | Offers the code-interpreter tool to models on this gateway. | On by default — a gateway that has never had the setting saved offers the tool; clear the toggle to turn it off. Persistent kernel (stateful) additionally keeps variables across turns; only available when the tool is enabled. |
| Agentic web fetch | Enables the URL-triggered agentic fetch tool. | The inner fetch-leg model override (agentic_fetch.model), if set via the admin API, is preserved on save. |
| Scan uploads for malware (ClamAV) | Scans files uploaded to this gateway for malware before they are processed. | Infected or unscannable files are rejected. Requires a provisioned ClamAV service. |
| Max parallel tool calls | Caps how many tool calls are dispatched per round. | Leave blank for the default (4). Otherwise a whole number from 1 to 9007199254740991. Anything else (0, negatives, fractions, 1e400, values above the maximum) is refused when you save, with a message naming the allowed range, and nothing is saved. |
The knowledge search the assistant uses on project and conversation documents is also bounded: at most 12 searches per answer by default. This limit has no control on this page; an administrator changes it through the admin API (knowledge.max_searches_per_turn, see the config reference), and saving this page leaves it untouched. knowledge.max_searches_per_turn accepts a whole number of 1 or more (a fraction is rounded down); 0, a negative number, a value that is neither a number nor a numeric string, null, a non-finite number or a knowledge section that is not an object is ignored and the default of 12 applies.
Per-request header overrides
The following request headers override gateway behaviour for a single inference request without changing the gateway configuration.
| Header | Type | Description |
|---|---|---|
x-aig-byok-alias |
string | Selects a non-default BYOK alias for this request (1 to 64 letters, digits, ., _, -; a malformed value is 400 byok_alias_invalid). See Provider keys (BYOK). |
x-aig-meta-{key} |
string | Attaches arbitrary metadata to the log entry. Available as meta:{key} in routing-rule conditions. |
x-aig-collect-log |
off = 0/false/no/off; on = 1/true/yes/on (case-sensitive) |
Overrides whether the request is written to the log table. An off value disables logging for this request; a value that cannot be read (garbage, empty, repeated header) also disables it — see config reference. |
x-aig-collect-log-payload |
off = 0/false/no/off; on = 1/true/yes/on (case-sensitive) |
Overrides whether request and response bodies are stored. A malformed value omits the bodies, like 0. |
x-aig-provider-{field} |
string | Forwards a client-controlled provider header for this request, only for the allow-listed names anthropic-beta, openai-organization, openai-project (for example x-aig-provider-anthropic-beta); any other name is dropped; the gateway's own inner calls receive at most openai-organization / openai-project. See provider header pass-through. |
x-aig-extensions |
1/true/yes/on |
Opts a streaming request into the gateway's aig_* SSE side channel (thinking, tool telemetry, sources). Absent or any other value ⇒ the response is a pure OpenAI stream. Implied by a valid x-aig-turn-id. See Inference — what a plain client receives. |
⚠️ Caution:
x-aig-collect-log-payload: 0suppresses body storage for the affected request only. The gateway-levellog_payloadssetting still applies to every other request.💡 Note:
log_payloadsalso gates the content of trace steps.tracing.include_bodiesstores trace bodies only whilelog_payloadsis on (an absent value counts as on); withlog_payloads: falsethe trace keeps metadata only.
API
Gateway configuration can also be updated through the admin API with a PATCH request. See Tenants and gateways API.