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

# Get Model Gateway credential configuration

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



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/ai.yaml get /api/ai/config
openapi: 3.0.3
info:
  title: Insforge AI API
  version: 1.0.0
  description: >-
    Model Gateway helper APIs for OpenRouter key provisioning, model discovery,
    and deprecated compatibility proxy routes
servers: []
security: []
paths:
  /api/ai/config:
    get:
      tags:
        - Admin
      summary: Get Model Gateway credential configuration
      description: >-
        Returns masked OpenRouter API and management key status for self-hosted
        deployments. Cloud-hosted credentials are managed by InsForge Cloud.
      responses:
        '200':
          description: Masked Model Gateway credential status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelGatewayConfig'
        '400':
          description: Configuration is managed by InsForge Cloud
        '401':
          description: Unauthorized
        '500':
          description: Failed to load encrypted credentials
      security:
        - bearerAuth: []
components:
  schemas:
    ModelGatewayConfig:
      type: object
      required:
        - apiKey
        - managementKey
      properties:
        apiKey:
          $ref: '#/components/schemas/ModelGatewayCredentialStatus'
        managementKey:
          $ref: '#/components/schemas/ModelGatewayCredentialStatus'
    ModelGatewayCredentialStatus:
      type: object
      required:
        - configured
        - maskedKey
      properties:
        configured:
          type: boolean
          description: >-
            Whether the credential resolves from encrypted settings or the
            supported API-key environment fallback.
        maskedKey:
          type: string
          nullable: true
          description: Masked credential for display, or null when it is not configured.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````