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