# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://1for-ai.gitbook.io/docs/model/retrieve-model-list.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
