Skip to main content
GET
https://console.mixroute.io
/
v1
/
models
curl --request GET \
  --url https://console.mixroute.io/v1/models \
  --header 'Authorization: Bearer sk-xxxxxxxxxx'
{
  "object": "list",
  "data": [
    {
      "id": "gpt-4o",
      "object": "model",
      "created": 1715232000,
      "owned_by": "openai"
    },
    {
      "id": "claude-sonnet-4-20250514",
      "object": "model",
      "created": 1743465600,
      "owned_by": "anthropic"
    }
  ]
}

Introduction

Get the list of currently available models. This interface supports automatic format detection, no manual specification needed.

Automatic Format Detection

Automatically returns the corresponding format based on request headers: Anthropic, Gemini, or OpenAI format

Authentication

Bearer Token, e.g., Bearer sk-xxxxxxxxxx

Request Headers

Response format is automatically detected based on request headers:
x-anthropic-version
string
Returns Anthropic format response
x-goog-api-key
string
Returns Gemini format response
Default returns OpenAI format response

Code Examples

curl https://console.mixroute.io/v1/models \
  -H "Authorization: Bearer sk-xxxxxxxxxx"

Response Fields

FieldTypeDescription
objectstringFixed as list
dataarrayModel list
data[].idstringModel unique identifier
data[].objectstringFixed as model
data[].createdintegerModel creation timestamp (Unix timestamp)
data[].owned_bystringModel provider (e.g., openai, anthropic, google)

Response Example

{
  "object": "list",
  "data": [
    {
      "id": "gpt-4o",
      "object": "model",
      "created": 1715232000,
      "owned_by": "openai"
    },
    {
      "id": "claude-sonnet-4-20250514",
      "object": "model",
      "created": 1743465600,
      "owned_by": "anthropic"
    },
    {
      "id": "gemini-2.5-pro",
      "object": "model",
      "created": 1746057600,
      "owned_by": "google"
    }
  ]
}

HTTP Status Codes

Status CodeDescription
200Request successful
401API Key invalid or expired
429Request rate too high
500Server internal error

Error Response Example

{
  "error": {
    "message": "Invalid API key",
    "type": "invalid_request_error",
    "code": "invalid_api_key"
  }
}

Notes

  • Recommend caching the model list to avoid frequent requests (recommend caching for 1 hour)
  • The returned model list dynamically changes based on your API Key permissions
  • Can call this interface at application startup for availability check
  • The created timestamps of different models may vary significantly, representing model release time only
  • Python example requires openai library: pip install openai
  • Node.js example requires axios library: npm install axios
curl --request GET \
  --url https://console.mixroute.io/v1/models \
  --header 'Authorization: Bearer sk-xxxxxxxxxx'
{
  "object": "list",
  "data": [
    {
      "id": "gpt-4o",
      "object": "model",
      "created": 1715232000,
      "owned_by": "openai"
    },
    {
      "id": "claude-sonnet-4-20250514",
      "object": "model",
      "created": 1743465600,
      "owned_by": "anthropic"
    }
  ]
}