> For the complete documentation index, see [llms.txt](https://ai-docs.fptcloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-docs.fptcloud.com/fpt-ai-studio/services/model-testing-interactive-sessions/tutorials/how-to-integrate-model.md).

# How to Integrate Model?

{% hint style="info" %} <mark style="color:$warning;">**Note:**</mark> Get API Endpoint is enabled when session's status is **RUNNING**
{% endhint %}

<figure><img src="/files/vGT1ucGgKqLlJRa3iieX" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}

### Get the required information

We offer:

<table><thead><tr><th width="132.59991455078125">Objects</th><th>Description</th></tr></thead><tbody><tr><td>Endpoint URL</td><td>The address where your application sends requests to interact with a service.</td></tr><tr><td>Bearer token</td><td>A string that proves you have permission to access the API.<br><br><strong>Notice:</strong><br>- Never expose your token in public code or repositories.<br>- Store it in environment variables or secure vaults.</td></tr><tr><td>Model</td><td>A unique identifier for a specific AI model hosted on an Interactive Sessions platform.</td></tr><tr><td>Sample code</td><td>More details, includes:<br>- Endpoint URL<br>- Bearer token<br>- Model ID<br>- Messages (system, user, assistant)<br>- Temperature</td></tr></tbody></table>
{% endstep %}

{% step %}

### Choose your integration platform

{% endstep %}

{% step %}

### Send a Request to the API

Here's an example using Python:

```json
import requests
url = "https://api.gptcloud.com/aiam/v1/chat/completions"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer pR2vV0zGZ0nP6tQ3gFJk9wXn0"
}
payload = {
    "model": "62d8b2e6-42f9-4c17-95f8-4ca93d74f396",
    "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"}
    ],
    "temperature": 0.7
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
```

{% endstep %}
{% endstepper %}


---

# 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://ai-docs.fptcloud.com/fpt-ai-studio/services/model-testing-interactive-sessions/tutorials/how-to-integrate-model.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.
