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

# Available Models

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


# Get Available Models

Retrieve available AI models based on your API key permissions and user license.

## Endpoint

```
GET /models
```

## Description

Retrieve available AI models based on your API key permissions and user license.

## Authentication

Required: API Key

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

## Parameters

| Parameter  | Type   | Required | Description               | Example    |
| ---------- | ------ | -------- | ------------------------- | ---------- |
| `provider` | string | No       | Filter models by provider | `"openai"` |

## Request

### Basic Request

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

### Filter by Provider

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

## Response

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

### Response Fields

| Field          | Type    | Description                         | Example     |
| -------------- | ------- | ----------------------------------- | ----------- |
| `success`      | boolean | Always true for successful requests | `true`      |
| `models`       | array   | List of available models            | See example |
| `user_license` | string  | User's license tier                 | `"Pro"`     |
| `restrictions` | object  | Model access restrictions           | See example |
| `filters`      | object  | Applied filters                     | See example |

### Model Object

| Field      | Type   | Description             | Example               |
| ---------- | ------ | ----------------------- | --------------------- |
| `id`       | string | Unique model identifier | `"openai/gpt-5-nano"` |
| `name`     | string | Model display name      | `"openai/gpt-5-nano"` |
| `provider` | string | Model provider          | `"openai"`            |

### Restrictions Object

| Field            | Type   | Description        | Example |
| ---------------- | ------ | ------------------ | ------- |
| `allowed_models` | string | Model access level | `"all"` |

### Filters Object

| Field      | Type   | Description             | Example    |
| ---------- | ------ | ----------------------- | ---------- |
| `provider` | string | Applied provider filter | `"openai"` |

## Error Responses

### 401 Unauthorized

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

### 429 Rate Limit Exceeded

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

## Example Usage

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

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

### Filter by Provider

```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 Buckets (Current)

The chat system classifies models into two execution buckets:

* `standard` bucket
* `premium` bucket

This reference is based on the active backend bucket mapping.

### Standard Bucket

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

### Premium Bucket

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

## Available Providers

* **OpenAI**
* **Anthropic**
* **Google**
* **Meta**
* **Mistral**
* **DeepSeek**
* **xAI**
* **Qwen**

## Notes

* Models available depend on your subscription tier
* Some models may be restricted based on your license
* Use the provider filter to get models from specific providers
* The response includes your current license tier and restrictions
* API key restrictions (`allowedModels`) can further reduce the model list


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

````