> For the complete documentation index, see [llms.txt](https://docs.graphite-note.com/graphite-note-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.graphite-note.com/graphite-note-documentation/rest-api/prediction-api/request-v2.md).

# Request v2

#### Method

API is using **POST** method

***

It supports the following model types:

* ✅ Binary Classification (e.g., YES/NO, True/False outcomes)
* ✅ Multiclass Classification (e.g., predicting one of several categories)
* ✅ Regression (e.g., predicting a numeric value)

***

#### What’s Different in v2?

\
The v2 request body simplifies the structure by using flat JSON objects, where each object is a single prediction row and keys are the actual column names used during model training.

This format is much easier to construct programmatically, especially when working with data from spreadsheets, CSVs, or databases. It eliminates the need to wrap values in extra alias/selectedValue layers. \
\
In short:

* No need for nested arrays or alias mapping.
* Each prediction row is a standard JSON object.
* You can send multiple rows in one request by adding more objects to the array.

v2 is recommended if you:

* Are building automated pipelines or using Python/PHP integrations
* Want to send predictions using raw tabular data (e.g., spreadsheets or databases)
* Prefer a format without nested or verbose structures

***

#### Request URL

The base URL for the API endpoint is:

```
https://app.graphite-note.com/api/v2/prediction/model/[model-code]
```

Replace `[model-code]` in the URL with the code of the specific model you want to use for predictions.

***

#### Where can I find model code?

To easily find the `[model-code]`, open the specific model and navigate to the Settings tab. The model code can be found in the ID section.

<figure><img src="/files/Q6IP9UQsyEYsqg89ym5V" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.graphite-note.com/graphite-note-documentation/rest-api/prediction-api/request-v2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
