Models API

Access information about available AI models through the ModelProxy.ai Models API

Models API

The Models API provides information about all AI models available through ModelProxy.ai. Use this endpoint to discover models, check their pricing, and determine which models would be most suitable for your application.

Endpoint#

GET https://modelproxy.theitdept.au/api/v1/models

Headers#

HeaderValueDescription
AuthorizationBearer YOUR_API_KEYYour API key (optional)

Parameters#

This endpoint does not accept any query parameters.

Response Format#

The response is a JSON object containing an array of model objects:

{
  "data": [
    {
      "id": "openai/gpt-4o",
      "name": "openai/gpt-4o",
      "description": "Latest GPT-4 model with vision capabilities and improved performance",
      "pricing": {
        "prompt": "0.005",
        "completion": "0.015"
      }
    },
    {
      "id": "claude-3-opus-20240229",
      "name": "Claude 3 Opus",
      "description": "Most powerful Claude model with exceptional understanding",
      "pricing": {
        "prompt": "0.015",
        "completion": "0.075"
      }
    },
    {
      "id": "meta/llama-3.1-8b-instruct",
      "name": "Llama 3.1 8B Instruct",
      "description": "Meta's smaller Llama 3.1 model optimized for instruction following",
      "pricing": {
        "prompt": "0.0002",
        "completion": "0.0002"
      }
    }
  ]
}

Response Fields#

FieldTypeDescription
idstringThe model identifier to use in requests to the Chat Completions API
namestringHuman-readable name of the model
descriptionstring or nullDescription of the model's capabilities and use cases
pricingobjectPricing information for the model
pricing.promptstringCost per 1,000 input tokens, in USD
pricing.completionstringCost per 1,000 output tokens, in USD

Authorization#

This endpoint can be called without authentication to get a list of all available models. However, if you provide an API key:

  1. The response will be filtered to show only models that the specific API key is authorized to use (if the key has model restrictions)
  2. The request will count toward your API usage metrics for analytics purposes

Example Request#

curl https://modelproxy.theitdept.au/api/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY"

Error Codes#

Status CodeError TypeDescription
500Internal Server ErrorFailed to fetch models

Usage Tips#

  • Call this endpoint to determine which models are available for your application
  • Compare pricing information to estimate costs for your use case
  • Use the model id values returned by this endpoint in your requests to the Chat Completions API
  • Consider calling this endpoint periodically in your application to detect newly added models