Skip to main content
GET
/
v1
/
models
Get available model list
curl --request GET \
  --url https://api.example.com/v1/models \
  --header 'Authorization: <authorization>'
{
  "object": "<string>",
  "data": [
    {
      "owned_by": "<string>",
      "id": "<string>",
      "object": "<string>",
      "created": 123
    }
  ]
}
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

import requests

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

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

Response example

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

Headers

Authorization
string
required
Example:

"Bearer YOUR_API_KEY"

Content-Type
string
Example:

"application/json"

Response

200 - application/json

OpenAI compatible model list response Reference: https://platform.openai.com/docs/api-reference/models/list

object
string

Object type, always "list"

data
object[]

Model list