Manage auth tokens
Prerequisites
Section titled “Prerequisites”Before creating an auth token, ensure you meet the following prerequisites:
- You have a STACKIT customer account: Create a customer Account
- You have a STACKIT user account: Create a user account
- You have a STACKIT project: Create a project
Purpose of auth tokens and how to manage them
Section titled “Purpose of auth tokens and how to manage them”With auth tokens you authenticate the clients against the AI Model Serving. Every API access to the service needs to be authenticated. In this article you learn how to manage your auth tokens.
Create an auth token
Section titled “Create an auth token”- On the sidebar click on AI Model Serving.
- Click on the instance for which you like to create an auth token for.
- On the top bar click on Create token.
- Enter a Token name and optionally a Lifetime.
- Click on Order fee-based.
- Copy the generated token to a safe place.
To obtain a token with the API, you need an auth token for your user or for your service account. To distinguish it from the auth token for the AI Model Serving-API, we call it STACKIT auth token. The following table gives you a complete overview about all parameters:
| Parameter | Meaning | Example |
|---|---|---|
| stackit-auth-token | User or service account auth token | BZasjkdasbu… |
| project-id | The ID of your project | 89783241-32… |
| token-description | Friendly description of the token’s purpose | My first token |
| token-name | Friendly name of the token | my-first-token |
| token-lifetime | Desired token lifetime as integer followed by either m, h, d | 30d |
curl -X POST https://model-serving.api.stackit.cloud/v1/projects/[project-id]/regions/eu01/tokens \--header "Authorization: Bearer [stackit-auth-token]" \--header "Content-Type: application/json" \--data '{"description": "[token-description]", "name": "[token-name]", "ttlDuration": "[token-lifetime]"}'List auth tokens
Section titled “List auth tokens”-
On the sidebar click on AI Model Serving.
-
You see a list of all tokens. Click on a token to view the details pane.
To get a list of all available tokens, execute the following API call with this parameters:
| Parameter | Meaning | Example |
|---|---|---|
| stackit-auth-token | User or service account auth token | BZasjkdasbu… |
| project-id | The ID of your project | 89783241-32… |
curl https://model-serving.api.stackit.cloud/v1/projects/[project-id]/regions/eu01/tokens \--header "Authorization: Bearer [stackit-auth-token]"Update auth tokens
Section titled “Update auth tokens”- On the sidebar click on AI Model Serving.
- You see a list of all tokens. Click on a token to view the details pane.
- Click on Save to update the token
To change the description or the name of a token, use the following API call. In the shown example the description of a token is updated.
| Parameter | Meaning | Example |
|---|---|---|
| stackit-auth-token | User or service account auth token | BZasjkdasbu… |
| project-id | The ID of your project | 89783241-32… |
| token-description | Friendly description of the token’s purpose | My first token |
curl -X PATCH https://model-serving.api.stackit.cloud/v1/projects/[project-id]/regions/eu01/tokens/${TOKEN_ID} \--header "Authorization: Bearer [stackit-auth-token]" \--header "Content-Type: application/json" \--data '{"description": "[token-description]"}'Delete auth tokens
Section titled “Delete auth tokens”- On the sidebar click on AI Model Serving.
- You see a list of all tokens. Click on a token’s three dots button and then on Delete to open the delete pane.
- Enter the token name and click on Delete to finally delete the token.
To delete an auth token, use the following API call:
| Parameter | Meaning | Example |
|---|---|---|
| stackit-auth-token | User or service account auth token | BZasjkdasbu… |
| project-id | The ID of your project | 89783241-32… |
| token-id | ID of the token | e44bb27e-f1… |
curl -X DELETE https://model-serving.api.stackit.cloud/v1/projects/[project-id]/regions/eu01/tokens/[token-id] \--header "Authorization: Bearer [stackit-auth-token]"