> ## 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.

# セキュリティポリシー

> Retrieve available SMLTP (Secure Multi-Layer Trust Protocol) security policies.
These policies determine how your data is processed and protected.


# セキュリティポリシーを取得する

利用可能な SMLTP (Secure Model Language Transfer Protocol) セキュリティ ポリシーを取得します。

## エンドポイント

```
GET /smltp-policies
```

## 説明

利用可能な SMLTP (Secure Model Language Transfer Protocol) セキュリティ ポリシーを取得します。これらのポリシーは、データの処理方法と保護方法を決定します。

## 認証

必須: API キー

```bash theme={null}
Authorization: Bearer sk-your-api-key-here
```

## リクエスト

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

## 応答

### 成功の応答 (200)

```json theme={null}
{
  "success": true,
  "policies": [
    {
      "id": "public",
      "name": "Public",
      "description": "For public, non-sensitive data"
    },
    {
      "id": "internal",
      "name": "Internal",
      "description": "For internal company data"
    },
    {
      "id": "confidential",
      "name": "Confidential",
      "description": "For confidential business data"
    }
  ],
  "restrictions": {
    "allowed_policies": ["public", "internal", "confidential"]
  }
}
```

### 応答フィールド

| フィールド          | タイプ    | 説明                   | 例      |
| -------------- | ------ | -------------------- | ------ |
| `success`      | ブール値   | リクエストが成功した場合は常に true | `true` |
| `policies`     | 配列     | 利用可能なセキュリティ ポリシーのリスト | 例を参照   |
| `restrictions` | オブジェクト | ポリシーのアクセス制限          | 例を参照   |

### ポリシーオブジェクト

| フィールド         | タイプ | 説明         | 例                             |
| ------------- | --- | ---------- | ----------------------------- |
| `id`          | 文字列 | 一意のポリシー識別子 | `"internal"`                  |
| `name`        | 文字列 | ポリシー表示名    | `"Internal"`                  |
| `description` | 文字列 | ポリシーの説明    | `"For internal company data"` |

### 制限対象

| フィールド              | タイプ | 説明               | 例                                        |
| ------------------ | --- | ---------------- | ---------------------------------------- |
| `allowed_policies` | 配列  | 許可されたポリシー ID の配列 | `["public", "internal", "confidential"]` |

## エラー応答

### 401 不正

```json theme={null}
{
  "success": false,
  "error": "Invalid API key",
  "message": "The provided API key is invalid or has been revoked"
}
```

## 使用例

### JavaScript/Node.js

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

const data = await response.json();
console.log('Available Policies:', data.policies);
```

### パイソン

```python theme={null}
import requests

headers = {
    'Authorization': 'Bearer sk-your-api-key-here'
}

response = requests.get('https://{customer.name}.hiperai.ai/api/external/smltp-policies', headers=headers)
data = response.json()

print('Available Policies:', data['policies'])
```

### cURL

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

## ポリシーの種類

### パブリック

* **ユースケース**: 公開された非機密データ
* **セキュリティ レベル**: 低
* **データ処理**: 基本的なセキュリティを備えた標準処理

### 内部

* **使用例**: 社内データ
* **セキュリティ レベル**: 中
* **データ処理**: 追加の保護手段によるセキュリティの強化

### 機密

* **ユースケース**: 機密のビジネスデータ
* **セキュリティ レベル**: 高
* **データ処理**: 厳密なデータ処理による最大限のセキュリティ

## 注意事項

* データの機密性に基づいて適切なポリシーを選択します
* ポリシーはデータの処理方法と保護方法に影響します
* チャット完了リクエストでポリシー ID を使用する
* 一部のポリシーはアカウントの種類に基づいて制限される場合があります


## OpenAPI

````yaml GET /smltp-policies
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:
    get:
      tags:
        - Discovery
      summary: Get Security Policies
      description: >
        Retrieve available SMLTP (Secure Multi-Layer Trust Protocol) security
        policies.

        These policies determine how your data is processed and protected.
      responses:
        '200':
          description: List of available security policies
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  policies:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: internal
                        name:
                          type: string
                          example: Internal
                        description:
                          type: string
                          example: For internal company data
                  restrictions:
                    type: object
                    properties:
                      allowed_policies:
                        type: string
                        example: all
              example:
                success: true
                policies:
                  - id: public
                    name: Public
                    description: For public, non-sensitive data
                  - id: internal
                    name: Internal
                    description: For internal company data
                  - id: confidential
                    name: Confidential
                    description: For confidential business data
                restrictions:
                  allowed_policies: all
        '401':
          description: Invalid API key
          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`

````