Skip to content

Use the models

Before you can use any model of the STACKI AI Model Serving, you need to create an auth token.

  • You have a STACKIT AI Model Serving auth token.
    Check Manage auth tokens to create a token.

You can use all of the Shared Models via the API. STACKIT AI Model Serving provides an OpenAI-compatible API, making it easy to integrate with existing tools and libraries. Please consult the OpenAI API Documentation for additional parameters and detailed information.

ParameterMeaningExample
auth-tokenThe AI Model Serving auth tokenBZasjkdasbu…
modelThe model you want to use.cortecs/Lla…
system-promptThe instruction for the model prior to the chatYou are a h…
user-messageThe message the user asks the modelHey, please…
assistant-messageThe message the chat model gaveOk, thanks …
max-complention-tokensThe maximum length of the model’s answer in token250
temperatureDefines the entropy of the model. A higher value means more creativity.0.1
Terminal window
curl -X POST \
https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1/chat/completions \
-H "Authorization: Bearer [auth-token]" \
-H "Content-Type: application/json" \
-d '{
"model": "[model]",
"messages": [{"role": "system", "content": "[system-prompt]"}, {"role": "user", "content": "[user-message]"}, {"role": "assistant", "content": "[assistant-message]"}, {"role": "user", "content": "[user-message]"}],
"max\_completion\_tokens": [max-complention-tokens],
"temperature": 0.1
}'
ParameterMeaningExample
auth-tokenThe AI Model Serving auth tokenBZasjkdasbu…
documentA document, must be a stringThe API is fast and reliable
modelThe model you want to use.intfloat/e5-mistral-7b-instruct
Terminal window
curl -X POST \
https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [auth-token]" \
-d '{
"model": "[model]",
"input": [
"[document]"
]
}'

Example:

Terminal window
curl -X POST \
https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyNSksHSus78h2kshdfsd7878shjkdlkdc" \
-d '{
"model": "intfloat/e5-mistral-7b-instruct",
"input": [
"The API is fast and reliable.",
"The system reacts just in time and is stable."
]
}'

The model will answer with the embeddings:

{
"id":"embd-96d405966aa14e8eb3d7e202a006e2cf",
"object":"list",
"created":1262540,
"model":"intfloat/e5-mistral-7b-instruct",
"data": [
{
"index":0,
"object":"embedding",
"embedding": [0.0167388916015625,0.005096435546875,0.01302337646484375,0.006805419921875,0.0089569091796875,-0.01406097412109375,...]
},
{
"index":1,
"object":"embedding",
"embedding": [0.0167388916015625,0.0050543545546875,0.01302337646484375,0.006805419921875,0.0089568951796875,-0.01406097412109375,...]
}
],
"usage": {
"prompt_tokens":3,
"total_tokens":3,
"completion_tokens":0
}
}