> ## Documentation Index
> Fetch the complete documentation index at: https://docs.haitoken.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Model list

> Retrieve the list of available models in OpenAI-compatible format

This endpoint is compatible with the OpenAI model list protocol for retrieving the list of currently available models.

## Features

* Returns a model list in OpenAI-compatible format
* Uses Caffeine local cache for fast response times

## Authentication

Include the `Authorization` header in the format `Bearer YOUR_API_KEY`.

## Quick example

<CodeGroup>
  ```python Python theme={null}
  import requests

  url = "https://api.haitoken.ai/v1/models"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY"
  }

  response = requests.get(url, headers=headers)
  print(response.json())
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.haitoken.ai/v1/models', {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  });

  const data = await response.json();
  console.log(data);
  ```

  ```curl cURL theme={null}
  curl -X GET 'https://api.haitoken.ai/v1/models' \
    -H 'Authorization: Bearer YOUR_API_KEY'
  ```
</CodeGroup>

## Response example

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "id": "gpt-4o",
      "object": "model",
      "owned_by": "openai",
      "created": 1715367049
    }
  ]
}
```


## OpenAPI

````yaml en/api-reference/models/openapi.json GET /v1/models
openapi: 3.0.1
info:
  title: Default Module
  description: ''
  version: 1.0.0
servers: []
security: []
tags: []
paths:
  /v1/models:
    get:
      tags: []
      summary: Get available model list
      description: Returns OpenAI compatible format, reuses Caffeine local cache
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: true
          schema:
            type: string
            example: Bearer YOUR_API_KEY
        - name: Content-Type
          in: header
          description: ''
          schema:
            example: application/json
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelListResponse'
                description: >-
                  OpenAI compatible model list response

                  Reference:
                  https://platform.openai.com/docs/api-reference/models/list
          headers: {}
      deprecated: false
      security: []
components:
  schemas:
    ModelListResponse:
      type: object
      properties:
        object:
          type: string
          description: Object type, always "list"
        data:
          type: array
          items:
            $ref: '#/components/schemas/ModelInfo'
            description: Single model information
          description: Model list
    ModelInfo:
      type: object
      properties:
        owned_by:
          type: string
          description: Model owner
        id:
          type: string
          description: Model identifier (corresponds to t_model.model_no)
        object:
          type: string
          description: Object type, always "model"
        created:
          type: integer
          description: Creation time (Unix timestamp, in seconds)
          format: int64

````