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

# Get S2S Time Status

> 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


# Get S2S Time Status

Retrieve the current Speech-to-Speech (S2S) time status for the billing user.

## Endpoint

```
GET /speech/s2s/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

## Authentication

Required: API Key

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

## Query Parameters

| Parameter | Type   | Required | Description                                             |
| --------- | ------ | -------- | ------------------------------------------------------- |
| `user_id` | string | No       | User ID to check status for (defaults to API key owner) |

## Request Example

```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

```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'])
```

## Response

### Success Response (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"
}
```

### Response Fields

| Field                | Type         | Description                                                          |
| -------------------- | ------------ | -------------------------------------------------------------------- |
| `success`            | boolean      | Always true for successful requests                                  |
| `remaining_minutes`  | number       | Remaining S2S time in minutes                                        |
| `total_minutes`      | number       | Total monthly S2S time limit                                         |
| `used_minutes`       | number       | Used S2S time this month                                             |
| `has_time_remaining` | boolean      | Whether user has any remaining S2S time                              |
| `next_renewal_date`  | string\|null | When the S2S time quota will reset (null for non-renewable licenses) |
| `non_renewable`      | boolean      | Whether this is a non-renewable trial license                        |
| `request_id`         | string       | Request ID for tracking                                              |

## Error Responses

### 400 Bad Request

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

### 401 Unauthorized

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

### 404 Not Found

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

### 500 Internal Server Error

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

## Notes

* Check this endpoint before initiating S2S sessions to ensure sufficient time is available
* The `user_id` parameter allows checking status for a different user (defaults to API key owner)
* Time quotas are based on the user's license tier
* Non-renewable trial licenses will have `non_renewable: true` and `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`

````