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

# アクティブな SMLTP ポリシー

> 現在アクティブな SMLTP ポリシーを取得します

# アクティブな SMLTP ポリシー

アカウントの現在アクティブな SMLTP (Secure Model Language Transfer Protocol) ポリシーを取得します。

## エンドポイント

```
GET /smltp-policies/active
```

## 説明

現在アクティブな SMLTP ポリシー構成を取得します。 **管理者のみのアクセスが必要です。**

## 認証

**必須**: 管理者権限を持つ API キー

```
Authorization: Bearer sk-your-api-key-here
```

## リクエストの例

```bash theme={null}
GET /smltp-policies/active
```

## 成功の応答

**ステータス コード**: `200 OK`

```json theme={null}
{
  "success": true,
  "data": {
    "template": "internal",
    "policy": {
      // Current policy configuration object
    },
    "lastUpdated": "2024-01-15T10:30:00.000Z"
  }
}
```

### 応答フィールド

| フィールド              | タイプ    | 説明                     |
| ------------------ | ------ | ---------------------- |
| `success`          | ブール値   | 操作が成功したかどうかを示します。      |
| `data`             | オブジェクト | 応答データ オブジェクト           |
| `data.template`    | 文字列    | 現在アクティブなポリシー テンプレート ID |
| `data.policy`      | オブジェクト | 現在のポリシー構成オブジェクト        |
| `data.lastUpdated` | 文字列    | 最終更新タイムスタンプ            |

## 使用例

### JavaScript

```javascript theme={null}
const getActiveSmltpPolicy = async () => {
  const response = await fetch('https://{customer.name}.hiperai.ai/api/external/smltp-policies/active', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer sk-your-api-key-here'
    }
  });
  
  return await response.json();
};

// Example usage
const result = await getActiveSmltpPolicy();
console.log('Active template:', result.data.template);
console.log('Policy config:', result.data.policy);
```

### パイソン

```python theme={null}
import requests

def get_active_smltp_policy():
    url = "https://{customer.name}.hiperai.ai/api/external/smltp-policies/active"
    headers = {
        "Authorization": "Bearer sk-your-api-key-here"
    }
    
    response = requests.get(url, headers=headers)
    return response.json()

# Example usage
result = get_active_smltp_policy()
print("Active template:", result["data"]["template"])
print("Policy config:", result["data"]["policy"])
```

### cURL

```bash theme={null}
curl -X GET "https://{customer.name}.hiperai.ai/api/external/smltp-policies/active" \
  -H "Authorization: Bearer sk-your-api-key-here"
```

## エラー応答

### 401 不正

```json theme={null}
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}
```

### 429 リクエストが多すぎます

```json theme={null}
{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded",
    "retryAfter": 60
  }
}
```

## 使用例

* **ポリシーのレビュー**: 現在アクティブなポリシー テンプレートを確認します。
* **構成チェック**: 現在のポリシー構成を確認します。
* **テンプレート管理**: どのポリシー テンプレートが使用されているかを理解する
* **トラブルシューティング**: 現在のポリシー設定を理解する
* **監査の準備**: コンプライアンス監査のアクティブなポリシーを確認します。

## レート制限

* **デフォルト**: 1 分あたり 100 リクエスト
* **毎日**: 1 日あたり 10,000 リクエスト
* **毎月**: 毎月 300,000 件のリクエスト

## 注意事項

* このエンドポイントには管理者権限が必要です
* 単一ポリシー: 現在アクティブなポリシー テンプレートと構成を返します。
* 配列なし: ポリシーの配列は返されず、アクティブなポリシーのみが返されます。
* テンプレート ID: 現在アクティブなポリシー テンプレートを表示します。
* ポリシー構成: 実際のポリシー構成オブジェクトを返します。
* ネストされた応答: 応答はデータ オブジェクトの下にネストされます。


## OpenAPI

````yaml GET /smltp-policies/active
openapi: 3.0.3
info:
  title: SecureAI External API
  description: >
    SecureAI External API provides AI chat completion and image generation
    capabilities with knowledge base retrieval, 

    security policies, and comprehensive usage tracking. This API is designed
    for external developers 

    and integrations using API key authentication.


    ## Key Features

    - **RAG (Retrieval-Augmented Generation)**: Automatically search knowledge
    bases for relevant context

    - **Multi-Model Support**: OpenAI, Anthropic, Google, Meta, and other AI
    models

    - **Model Redundancy & Failover**: Caller-defined failover chains (primary +
    fallbacks) with per-attempt timeouts

    - **OpenAI-Compatible Endpoint**: Point any OpenAI SDK at `/api/external/v1`
    — no code changes

    - **Image Generation**: Generate and edit images using Google Gemini 2.5
    Flash Image

    - **Speech-to-Speech (S2S)**: Real-time voice conversations using OpenAI
    Realtime API with WebRTC

    - **Security Policies**: SMLTP policy enforcement, per-call Prompt Shield,
    and signed compliance receipts

    - **Usage Tracking**: Comprehensive usage monitoring, self-service quota,
    and rate limiting

    - **Knowledge Base Integration**: Access to personal and shared knowledge
    bases

    - **User Management**: Complete user, group, and role management
    capabilities

    - **Audit Logging**: Comprehensive activity and security audit logs


    ## Authentication

    All endpoints (except health check) require API key authentication using
    Bearer token:

    ```

    Authorization: Bearer sk-your-api-key-here

    ```


    ## Billing and Usage

    By default, API requests are billed to the user account that owns the API
    key. You can specify 

    a different user to bill by including the `user_id` parameter in your
    request. This allows for:

    - Multi-tenant applications with per-user billing

    - Flexible completion limit management

    - Per-user "Usage by Model" settings


    ## Rate Limits

    - Default: 60 requests per minute, 1000 requests per hour

    - Daily limits: 100 requests (configurable)

    - Monthly limits: 10,000 requests (configurable)


    ## Base URL

    ```

    https://secureai.hiperai.ai/api/external

    ```
  version: 1.1.0
  contact:
    name: SecureAI Support
    email: support@secureai.hiperai.ai
  license:
    name: Proprietary
    url: https://secureai.hiperai.ai/terms
servers:
  - url: https://secureai.hiperai.ai/api/external
    description: Production server
  - url: http://localhost:3010/api/external
    description: Development server
security:
  - ApiKeyAuth: []
tags:
  - name: System
    description: System health and status endpoints
  - name: Discovery
    description: Endpoints to discover available models, indexes, and policies
  - name: Chat
    description: AI chat completion endpoints
  - name: User Management
    description: Endpoints for managing user accounts and roles
  - name: Index Management
    description: Endpoints for managing knowledge base indexes
  - name: Group Management
    description: Endpoints for managing user groups
  - name: SMLTP Security
    description: Endpoints for managing SMLTP security policies and audit logs
  - name: Role Management
    description: Endpoints for managing user roles
  - name: Activity Logs
    description: Endpoints for retrieving activity logs
externalDocs:
  description: SecureAI Documentation
  url: https://secureai.hiperai.ai/docs
paths:
  /smltp-policies/active:
    get:
      tags:
        - SMLTP Security
      summary: Get Active SMLTP Policy
      description: >
        Retrieve the currently active SMLTP policy configuration. Only
        accessible by administrators.
      responses:
        '200':
          description: Active SMLTP policy
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      template:
                        type: string
                        example: internal
                      policy:
                        type: object
                        description: Current policy configuration object
                      lastUpdated:
                        type: string
                        format: date-time
                        example: '2024-01-15T10:30:00.000Z'
              example:
                success: true
                data:
                  template: internal
                  policy: null
                  lastUpdated: '2024-01-15T10:30:00.000Z'
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Access denied - admin only
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Invalid API key
        message:
          type: string
          example: The provided API key is invalid or has been revoked
        request_id:
          type: string
          example: req-abc123
          description: Request ID for tracking (if available)
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: |
        API key authentication using Bearer token format.
        Example: `Authorization: Bearer sk-your-api-key-here`

````