> ## 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 AI models based on your API key permissions and user license.
Models are categorized as 'standard' or 'premium' based on your subscription tier.


# 利用可能なモデルを取得する

API キーの権限とユーザー ライセンスに基づいて、利用可能な AI モデルを取得します。

## エンドポイント

```
GET /models
```

## 説明

API キーの権限とユーザー ライセンスに基づいて、利用可能な AI モデルを取得します。

## 認証

必須: API キー

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

## パラメータ

| パラメータ      | タイプ | 必須  | 説明                   | 例          |
| ---------- | --- | --- | -------------------- | ---------- |
| `provider` | 文字列 | いいえ | プロバイダーごとにモデルをフィルターする | `"openai"` |

## リクエスト

### 基本的なリクエスト

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

### プロバイダーによるフィルター

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

## 応答

### 成功の応答 (200)

```json theme={null}
{
  "success": true,
  "models": [
    {
      "id": "openai/gpt-5-nano",
      "name": "openai/gpt-5-nano",
      "provider": "openai"
    },
    {
      "id": "anthropic/claude-sonnet-4.6",
      "name": "anthropic/claude-sonnet-4.6",
      "provider": "anthropic"
    }
  ],
  "user_license": "Pro",
  "restrictions": {
    "allowed_models": "all"
  },
  "filters": {
    "provider": "openai"
  }
}
```

### 応答フィールド

| フィールド          | タイプ    | 説明                   | 例       |
| -------------- | ------ | -------------------- | ------- |
| `success`      | ブール値   | リクエストが成功した場合は常に true | `true`  |
| `models`       | 配列     | 利用可能なモデルのリスト         | 例を参照    |
| `user_license` | 文字列    | ユーザーのライセンス層          | `"Pro"` |
| `restrictions` | オブジェクト | モデルのアクセス制限           | 例を参照    |
| `filters`      | オブジェクト | 適用されたフィルター           | 例を参照    |

### モデルオブジェクト

| フィールド      | タイプ | 説明        | 例                     |
| ---------- | --- | --------- | --------------------- |
| `id`       | 文字列 | 一意のモデル識別子 | `"openai/gpt-5-nano"` |
| `name`     | 文字列 | モデル表示名    | `"openai/gpt-5-nano"` |
| `provider` | 文字列 | モデルプロバイダー | `"openai"`            |

### 制限対象

| フィールド            | タイプ | 説明           | 例       |
| ---------------- | --- | ------------ | ------- |
| `allowed_models` | 文字列 | モデルのアクセス レベル | `"all"` |

### フィルタオブジェクト

| フィールド      | タイプ | 説明                | 例          |
| ---------- | --- | ----------------- | ---------- |
| `provider` | 文字列 | 適用されたプロバイダー フィルター | `"openai"` |

## エラー応答

### 401 不正

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

### 429 レート制限を超えました

```json theme={null}
{
  "success": false,
  "error": "Rate limit exceeded",
  "message": "Please reduce your request rate",
  "reset_time": "2024-01-15T11:00:00.000Z"
}
```

## 使用例

### JavaScript/Node.js

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

const data = await response.json();
console.log('Available Models:', data.models);
console.log('User License:', data.user_license);
```

### パイソン

```python theme={null}
import requests

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

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

print('Available Models:', data['models'])
print('User License:', data['user_license'])
```

### プロバイダーによるフィルター

```python theme={null}
import requests

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

params = {
    'provider': 'openai'
}

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

print('OpenAI Models:', data['models'])
```

### cURL

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

# Filter by provider
curl -X GET "https://{customer.name}.hiperai.ai/api/external/models?provider=openai" \
  -H "Authorization: Bearer sk-your-api-key-here"
```

## LLM バケット (現在)

チャット システムはモデルを 2 つの実行バケットに分類します。

* `standard` バケット
* `premium` バケット

この参照は、アクティブなバックエンド バケット マッピングに基づいています。

### 標準バケット

* `openai/gpt-oss-120b`
* `openai/gpt-5-nano`
* `google/gemini-3.1-flash-lite-preview`
* `google/gemini-3-flash-preview`
* `deepseek/deepseek-r1-distill-llama-70b`
* `deepseek/deepseek-r1`
* `deepseek/deepseek-v3.2`
* `meta-llama/llama-3.3-70b-instruct`
* `meta-llama/llama-4-maverick`
* `meta-llama/llama-4-scout`
* `mistralai/mistral-7b-instruct`
* `mistralai/mistral-nemo`
* `mistralai/ministral-14b-2512`
* `mistralai/mistral-large-2512`
* `x-ai/grok-3-mini`
* `qwen/qwen3-235b-a22b-2507`
* `qwen/qwen3-coder`
* `qwen/qwen3-coder-next`
* `qwen/qwen3.5-397b-a17b`

### プレミアムバケット

* `anthropic/claude-3.7-sonnet`
* `anthropic/claude-sonnet-4.6`
* `anthropic/claude-opus-4.6`
* `openai/o4-mini-high`
* `openai/o4-mini`
* `openai/gpt-5.2`
* `openai/gpt-5.3-codex`
* `openai/gpt-5.1`
* `google/gemini-3.1-pro-preview`
* `x-ai/grok-4`

## 利用可能なプロバイダー

* **OpenAI**
* **人類学**
* **Google**
* **メタ**
* **ミストラル**
* **ディープシーク**
* **xAI**
* **クウェン**

## 注意事項

* 利用可能なモデルはサブスクリプション層によって異なります
* 一部のモデルはライセンスに基づいて制限される場合があります
* プロバイダー フィルターを使用して、特定のプロバイダーからモデルを取得します
* 応答には、現在のライセンス層と制限事項が含まれます
* API キー制限 (`allowedModels`) により、モデル リストがさらに削減される可能性があります


## OpenAPI

````yaml GET /models
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:
  /models:
    get:
      tags:
        - Discovery
      summary: Get Available Models
      description: >
        Retrieve available AI models based on your API key permissions and user
        license.

        Models are categorized as 'standard' or 'premium' based on your
        subscription tier.
      parameters:
        - name: provider
          in: query
          description: Filter models by provider (e.g., 'openai', 'anthropic', 'google')
          required: false
          schema:
            type: string
      responses:
        '200':
          description: List of available models
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  models:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: openai/gpt-4.1-mini
                        name:
                          type: string
                          example: openai/gpt-4.1-mini
                        provider:
                          type: string
                          example: openai
                  user_license:
                    type: string
                    example: Growth
                  restrictions:
                    type: object
                    properties:
                      allowed_models:
                        type: string
                        example: all
                  filters:
                    type: object
                    properties:
                      provider:
                        type: string
                        nullable: true
                        example: openai
              example:
                success: true
                models:
                  - id: openai/gpt-4.1-mini
                    name: openai/gpt-4.1-mini
                    provider: openai
                  - id: anthropic/claude-sonnet-4
                    name: anthropic/claude-sonnet-4
                    provider: anthropic
                user_license: Growth
                restrictions:
                  allowed_models: all
                filters:
                  provider: openai
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
      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)
    RateLimitError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Rate limit exceeded
        message:
          type: string
          example: Please reduce your request rate
        reset_time:
          type: string
          format: date-time
          example: '2024-01-15T11:00:00.000Z'
          description: When the rate limit will reset
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: |
        API key authentication using Bearer token format.
        Example: `Authorization: Bearer sk-your-api-key-here`

````