1For AI
  • Welcome
  • Getting Started
    • Quickstart
  • Model
    • Retrieve Model List
    • Get Single Model
  • Chat
    • Create new chat
    • Continue Chat Conversation
  • User
    • User Balance
  • Errors
    • Common Errors
Powered by GitBook
On this page
  1. Model

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": String,
    "pricePerImage": Double,
    "platform": String,
    "shortName": String,
    "type": "image"
}
  • 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:

[
    {
        "modelName": "autoAI",
        "pricePerMillionToken": {
            "input": 0.0975,
            "output": 0.39
        },
        "platform": "1For",
        "shortName": "1for",
        "type": "text"
    },
    {
        "modelName": "dall-e-3",
        "pricePerImage": 0.052,
        "platform": "OpenAI",
        "shortName": "Dall-E 3",
        "type": "image"
    }
    // More models...
]

Notes

  • Ensure your API key has sufficient privileges.

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

PreviousQuickstartNextGet Single Model

Last updated 1 month ago