---
title: "Get Model Gateway credential configuration"
method: GET
path: "/api/ai/config"
tags: ["Admin"]
---

# Get Model Gateway credential configuration

`GET /api/ai/config`

Returns masked OpenRouter API and management key status for self-hosted deployments. Cloud-hosted credentials are managed by InsForge Cloud.

## Response `200`

Masked Model Gateway credential status

- ModelGatewayConfig
  - `apiKey` ModelGatewayCredentialStatus, required
    - `configured` boolean, required — Whether the credential resolves from encrypted settings or the supported API-key environment fallback.
    - `maskedKey` string, nullable, required — Masked credential for display, or null when it is not configured.
  - `managementKey` ModelGatewayCredentialStatus, required
    - `configured` boolean, required — Whether the credential resolves from encrypted settings or the supported API-key environment fallback.
    - `maskedKey` string, nullable, required — Masked credential for display, or null when it is not configured.

## Other responses

- `400` — Configuration is managed by InsForge Cloud
- `401` — Unauthorized
- `500` — Failed to load encrypted credentials

---

[API](https://skmtc.net/insforge/apis/insforge-authentication-api.md) · [All operations](https://skmtc.net/insforge/apis/insforge-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/insforge/insforge-authentication-api/versions/a935bb49f932/schema)
