# Models

The `v1/models` endpoint is used to make predictions using a trained model. Details on training a model via the API can be found at the [Training endpoint](/akkio-docs/endpoints-and-schemas/endpoints/training.md). Use `GET` to obtain a list of all models. Then use the model ID to `POST` data to that model and receive predictions.

## Get All Models

<mark style="color:blue;">`GET`</mark> `https://api.akkio.com/v1/models`

#### Query Parameters

| Name                                       | Type   | Description                                                         |
| ------------------------------------------ | ------ | ------------------------------------------------------------------- |
| api\_key<mark style="color:red;">\*</mark> | string | Your api key, accessible from <https://app.akkio.com/team-settings> |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "models": [
       
        {
            "id": "mpcfo01LuKwZKkH8fMwN",
            "name": "titanic-sheet-titanic"
        },
        {
            "id": "nPG4VV5MhXwiiuNdgYTU",
            "name": "Lead Scoring Demo"
    ]
}
```

{% endtab %}
{% endtabs %}

```bash
# Example cURL

curl --request GET 'https://api.akkio.com/v1/models?api_key=api_key_string'
```

## Make Prediction

<mark style="color:green;">`POST`</mark> `https://api.akkio.com/v1/models`

#### Request Body

| Name                                       | Type   | Description                                                                          |
| ------------------------------------------ | ------ | ------------------------------------------------------------------------------------ |
| api\_key<mark style="color:red;">\*</mark> | string | Your api key, accessible from <https://app.akkio.com/team-settings>                  |
| data<mark style="color:red;">\*</mark>     | array  | Data in the format of: \[{'field name 1': 'value 1', 'field name 2': 0}, {...}, ...] |
| id<mark style="color:red;">\*</mark>       | string | The ID of the model to make the prediction with                                      |

{% tabs %}
{% tab title="200  Example response  from request on the titanic dataset:
{ "id":"wNFRCKF4L2WRwl75lyja",
"data": \[{"Age":58}],
"api\_key": "YOUR\_API\_KEY" }" %}

```
{
    "status": "success",
    "predictions": [
        {
            "Survived": "0",
            "Probability Survived is 0": 0.8029362559318542,
            "Probability Survived is 1": 0.19706374406814575
        }
    ]
}
```

{% endtab %}
{% endtabs %}

```bash
# Example cURL

curl -g --request POST 'https://api.akkio.com/v1/models?id=id_string&api_key=api_key_string&data=[{'\''field name 1'\'': '\''value 1'\'', '\''field name 2'\'': 0}]'
```

## Delete Model&#x20;

<mark style="color:red;">`DELETE`</mark> `https://api.akkio.com/v1/models`

#### Request Body

| Name                                       | Type   | Description                                                         |
| ------------------------------------------ | ------ | ------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>       | string | The ID of the model to be deleted                                   |
| api\_key<mark style="color:red;">\*</mark> | string | Your api key, accessible from <https://app.akkio.com/team-settings> |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success"
}
```

{% endtab %}
{% endtabs %}

```bash
# Example cURL

curl --request DELETE 'https://api.akkio.com/v1/models?id=id_string&api_key=api_key_string'
```


---

# 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://docs.akkio.com/akkio-docs/endpoints-and-schemas/endpoints/models.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.
