The complete flow
- Choose an AI provider.
- Add a provider credential.
- Create a gateway in a project.
- Attach the credential and choose routing defaults.
- Create a gateway token.
- Point your provider client at the returned data-plane URL.
- Inspect logs, usage and key access.
List providers
MCP tool used:
list_providersAdd a provider credential
The credential value is accepted for validation and encrypted storage. It is never returned by list or read operations. SDK:AIRCTRL_MCP_KEY_* environment variable and pass only that variable’s name.
MCP tool used:
add_provider_keyCreate a gateway
create_gateway for a bare gateway. Use setup_gateway when the same operation must validate a provider key, bind one live-catalog model, create the gateway, mint a token, and return connection information.
MCP tool used:
create_gatewayCreate a gateway token
Gateway token plaintext is returned once.CLI command:
gateway token-createStore the returned value before leaving the response. Listing tokens later returns metadata only.MCP tool used:
create_gateway_tokenConnect an AI client
Use the gateway token with the URLs returned byget_connection_config or setup_gateway.
- OpenAI-compatible SDKs use the
/compatbase URL. - OpenAI-native requests use the
/openai/v1path. - Anthropic clients use the
/anthropicbase URL. - Gemini-compatible clients use the returned Gemini endpoint.
MCP tool used:
get_connection_configRouting and settings
UseupdateGateway, updateGatewaySettings, attachGatewayCredential, and detachGatewayCredential in the SDK.
Gateway settings can control:
- Spend limit and period.
- Requests per minute.
- Request logging and optional body logging.
- Allowed models.
- Guardrail mode.
- Cache state and lifetime.
gateway update, settings, credential-attach, and credential-detach.
MCP tool used:
set_gateway_settingsLogs and usage
- Gateway logs show requests for one gateway.
- Project usage combines gateways in one project.
- Key access shows whether granted, denied, or failed to retrieve a provider credential.
- Log-body reads require
usage:read-bodiesbecause prompts and responses can contain sensitive data. - Spend reads require
usage:read-spend.
listGatewayLogs, getGatewayLogDetail, listGatewayKeyAccess, listUsageLogs, getUsageLogDetail, getUsageSpend, and getUsageMetrics.
OpenTelemetry
UsegetGatewayOtelExport and updateGatewayOtelExport to configure metrics and traces. Stored header values are write-only and are never returned.
CLI commands: gateway otel, gateway otel-update
MCP tool used:
get_otel_exportCommon failures
403 plan_limit_reached: the account plan cannot create another gateway.404 gateway_not_found: the gateway is unavailable in the active account.400: a provider credential belongs to another account or a setting is invalid.429: API rate limit, gateway rate limit, or spend limit. Read the error code before retrying.