Skip to main content

How To Integrate Model

Notice: Get API Endpoint is enabled when session's status is RUNNING

Alt text

Step 1: Get the required information

We offer:

ObjectsDescription
Endpoint URLThe address where your application sends requests to interact with a service.
Bearer tokenA string that proves you have permission to access the API.

Notice:

  • Never expose your token in public code or repositories.
  • Store it in environment variables or secure vaults. |
    | Model | A unique identifier for a specific AI model hosted on an Interactive Sessions platform. |
    | Sample code | More details, includes:
  • Endpoint URL
  • Bearer token
  • Model ID
  • Messages (system, user, assistant)
  • Temperature |

Step 2: Choose your intergration platform

Step 3: Send a Request to the API

Here's an example using Python:

Copyimport 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())