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

# S2S 時間ステータスの取得

> Retrieve the current Speech-to-Speech (S2S) time status for the billing user, including remaining time,
total monthly limit, used time, and renewal information.

**S2S Time Quotas:**
- Quotas are based on the user's license tier
- Time resets monthly based on the license assignment date
- Non-renewable trial licenses don't auto-reset


# S2S 時間ステータスを取得

請求ユーザーの現在の Speech-to-Speech (S2S) 時間ステータスを取得します。

## エンドポイント

```
GET /speech/s2s/status
```

## 説明

残り時間、月間制限合計、使用時間、更新情報など、請求ユーザーの現在の Speech-to-Speech (S2S) 時間ステータスを取得します。

### S2S 時間の割り当て

* クォータはユーザーのライセンス層に基づいています
* 時間はライセンスの割り当て日に基づいて毎月リセットされます
* 更新不可の試用版ライセンスは自動リセットされません

## 認証

必須: API キー

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

## クエリパラメータ

| パラメータ     | タイプ | 必須  | 説明                                   |
| --------- | --- | --- | ------------------------------------ |
| `user_id` | 文字列 | いいえ | ステータスを確認するユーザー ID (デフォルトは API キー所有者) |

## リクエストの例

```bash theme={null}
curl -X GET "https://{customer.name}.hiperai.ai/api/external/speech/s2s/status?user_id=60a7c8f5e8b4f5001f7a8c23" \
  -H "Authorization: Bearer sk-your-api-key-here"
```

### JavaScript/Node.js

```javascript theme={null}
const response = await fetch('https://{customer.name}.hiperai.ai/api/external/speech/s2s/status?user_id=60a7c8f5e8b4f5001f7a8c23', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer sk-your-api-key-here'
  }
});

const data = await response.json();
console.log('Remaining minutes:', data.remaining_minutes);
console.log('Total minutes:', data.total_minutes);
console.log('Used minutes:', data.used_minutes);
```

### パイソン

```python theme={null}
import requests

url = "https://{customer.name}.hiperai.ai/api/external/speech/s2s/status"
headers = {
    "Authorization": "Bearer sk-your-api-key-here"
}
params = {
    "user_id": "60a7c8f5e8b4f5001f7a8c23"
}

response = requests.get(url, headers=headers, params=params)
result = response.json()
print('Remaining minutes:', result['remaining_minutes'])
print('Total minutes:', result['total_minutes'])
print('Used minutes:', result['used_minutes'])
```

## 応答

### 成功の応答 (200)

```json theme={null}
{
  "success": true,
  "remaining_minutes": 38.2896,
  "total_minutes": 45,
  "used_minutes": 6.7104,
  "has_time_remaining": true,
  "next_renewal_date": "2025-12-01T12:55:35.721Z",
  "non_renewable": false,
  "request_id": "a8c307b4-c0c9-4b30-98db-5aced06c1cfe"
}
```

### 応答フィールド

| フィールド                | タイプ       | 説明                                       |
| -------------------- | --------- | ---------------------------------------- |
| `success`            | ブール値      | リクエストが成功した場合は常に true                     |
| `remaining_minutes`  | 番号        | 残りの S2S 時間 (分)                           |
| `total_minutes`      | 番号        | S2S の月間合計時間制限                            |
| `used_minutes`       | 番号        | 今月の S2S 使用時間                             |
| `has_time_remaining` | ブール値      | ユーザーに S2S 時間が残っているかどうか                   |
| `next_renewal_date`  | 文字列\|null | S2S 時間割り当てがいつリセットされるか (更新不可のライセンスの場合は無効) |
| `non_renewable`      | ブール値      | これが更新不可の試用版ライセンスであるかどうか                  |
| `request_id`         | 文字列       | 追跡用のリクエスト ID                             |

## エラー応答

### 400 不正なリクエスト

```json theme={null}
{
  "success": false,
  "error": "Invalid user_id",
  "message": "The specified user_id is invalid"
}
```

### 401 不正

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

### 404 見つかりません

```json theme={null}
{
  "success": false,
  "error": "User not found",
  "message": "The specified user_id does not exist"
}
```

### 500 内部サーバーエラー

```json theme={null}
{
  "success": false,
  "error": "Internal server error",
  "message": "An unexpected error occurred"
}
```

## 注意事項

* S2S セッションを開始する前にこのエンドポイントをチェックして、十分な時間が利用可能であることを確認してください
* `user_id` パラメータを使用すると、別のユーザーのステータスを確認できます (デフォルトは API キー所有者)
* 時間割り当てはユーザーのライセンス層に基づきます
* 更新不可の試用版ライセンスには `non_renewable: true` および `next_renewal_date: null` が含まれます


## OpenAPI

````yaml GET /speech/s2s/status
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:
  /speech/s2s/status:
    get:
      tags:
        - Speech
      summary: Get S2S Time Status
      description: >
        Retrieve the current Speech-to-Speech (S2S) time status for the billing
        user, including remaining time,

        total monthly limit, used time, and renewal information.


        **S2S Time Quotas:**

        - Quotas are based on the user's license tier

        - Time resets monthly based on the license assignment date

        - Non-renewable trial licenses don't auto-reset
      parameters:
        - name: user_id
          in: query
          description: Optional user ID to check status for (defaults to API key owner)
          required: false
          schema:
            type: string
            example: 60a7c8f5e8b4f5001f7a8c23
      responses:
        '200':
          description: S2S time status
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  remaining_minutes:
                    type: number
                    description: Remaining S2S time in minutes
                    example: 38.2896
                  total_minutes:
                    type: number
                    description: Total monthly S2S time limit
                    example: 45
                  used_minutes:
                    type: number
                    description: Used S2S time this month
                    example: 6.7104
                  has_time_remaining:
                    type: boolean
                    description: Whether user has any remaining S2S time
                    example: true
                  next_renewal_date:
                    type: string
                    format: date-time
                    description: >-
                      When the S2S time quota will reset (null for non-renewable
                      licenses)
                    example: '2025-12-01T12:55:35.721Z'
                  non_renewable:
                    type: boolean
                    description: Whether this is a non-renewable trial license
                    example: false
                  request_id:
                    type: string
                    description: Request ID for tracking
                    example: a8c307b4-c0c9-4b30-98db-5aced06c1cfe
        '400':
          description: Invalid user_id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          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`

````