Retrieve Model List

API Documentation: Retrieve Available AI Models

Endpoint

GET /v1/model

Description

This endpoint retrieves a list of available AI models, along with their pricing details, supported platforms, and types (text or image).

Request

cURL Example:

curl --location 'https://api.1for.ai/v1/model' \
--header 'api-key: {API_KEY}'

Replace {API_KEY} with your actual API key.

Response

The response will be an array of model objects, each structured as follows:

For Text Models:

{
    "modelName": String,
    "pricePerMillionToken": {
        "input": Double,
        "output": Double
    },
    "platform": String,
    "shortName": String,
    "type": "text"
}
  • modelName: The unique identifier of the AI model.

  • pricePerMillionToken: Object containing pricing for:

    • input: Cost per million input tokens.

    • output: Cost per million output tokens.

  • platform: The provider of the model (e.g., OpenAI, Google).

  • shortName: User-friendly name for display purposes.

  • type: The type of the model (text).

For Image Models:

  • modelName: Unique identifier of the image generation model.

  • pricePerImage: Cost per generated image.

  • platform: The provider of the model.

  • shortName: User-friendly name for display purposes.

  • type: The type of the model (image).

Example Response

The API response will return a JSON array of multiple model objects, similar to:

Notes

  • Ensure your API key has sufficient privileges.

  • Models without a pricePerMillionToken will have a pricePerImage field instead, indicating image generation costs.

Last updated