For Students
Generative AI (GenAI) in Vocareum lets you use large language models directly in your work. To do that, you need a GenAI key: a scoped, budgeted credential that verifies you are allowed to use an AI service and tracks how much of your allowance you have spent. You do not create this key yourself. Your instructor or an admin at your institution provisions it for you, and the way they grant access determines where you find the key.
There are two places a GenAI key can appear, depending on how you were given access:
If GenAI was enabled for an assignment you are working in, the key appears in the in-lab key panel inside that assignment. This is called a course key.
If you were added to a group with a GenAI resource, or an admin issued you an individual key, the key appears in the My Keys section of the GenAI menu. This is called a group key or an individual key.
This article describes how to find your key in each location, how to use it in your code, and how to keep track of your spending. If you are unsure which kind of access you have, start by opening the assignment you are working in; if no key appears there, check the My Keys section. For background on how GenAI works inside Vocareum labs, refer to What is GenAI in Vocareum Labs?.
Finding a Course Key in an Assignment
A course key is available when your instructor has enabled GenAI for the assignment part you are working in. The key lives inside the lab, in a GenAI panel that you open from the lab menu. Because the key is tied to the assignment, you will only find it while that assignment is open.
To find your course key in a Vocareum Notebook assignment, complete the following steps.
Open the assignment you are working in so that the lab environment loads.
In the left-side lab menu, select the GenAI icon to open the GenAI panel.
In the panel, review your GenAI key and its corresponding API base URL. This panel also lists the AI models available to you for the assignment.
If no GenAI panel or icon appears in the assignment, GenAI has not been enabled for that assignment part. In that case, check whether you have a group key or an individual key instead, as described in the next section, or contact your instructor.
Finding a Group Key or an Individual Key in My Keys
If you were added to a group that has a GenAI resource, or an admin issued you an individual key, your key appears in the My Keys section of the GenAI menu rather than inside a specific assignment. Unlike a course key, this key is not tied to a single assignment, so you reach it from the main Vocareum navigation.
Each key is labeled by its source. A group key appears in the format GROUP_NAME(POLICY), where GROUP_NAME is the group you were added to and POLICY is the set of AI services and models available to that key. For example, a key named Digital Backpack(OpenAI) comes from the "Digital Backpack" group and uses the OpenAI policy, so you can tell at a glance which group each key came from.
To find a group key or an individual key, complete the following steps.
In the left sidebar, open the GenAI menu.
Under GenAI, select My Keys to open the list of keys that have been issued to you.
On the My Keys page, each row is one key issued to you. The Budget Name column identifies the key: a group key is labeled in the format GROUP_NAME(POLICY) so that you can tell which group and policy it belongs to, while an individual key shows the name the admin gave it. The Policy column shows which AI service and models the key can use.
If no keys appear in My Keys, you have not been added to a group with a GenAI resource and no individual key has been issued to you. If you expected access this way, contact the admin or instructor who set it up.
Using a Group Key or an Individual Key
From the My Keys page, you have two ways to use a key. Both are available in each key's row.
Select Launch Sandbox in the Actions column to open a sandbox environment where the key is already available, so you can start working with the AI service right away.
To use the key in your own code, select the copy icon next to the value in the API Key column to copy the key, then paste it where your code expects it. Pair it with the base URL for the matching AI service. For the base URL and the environment variable names for each service, refer to GenAI Environment Variables Reference.
Using Your Key in Your Code
However you access your key, you use it the same way: your code reads it from the lab environment. When GenAI is enabled for your work area, Vocareum places the key and its base URL into environment variables that your code can read, so you do not have to copy or paste the key by hand. Each AI service has its own pair of variable names, one for the key and one for the base URL.
The following example reads the OpenAI key and base URL from the environment in a Python file and stores them for use in the rest of your code.
import os
openai_api_key = os.environ["OPENAI_API_KEY"] openai_base_url = os.environ["OPENAI_BASE_URL"]
The exact variable names depend on which AI service your key is for. For the full list of variable names for every service, refer to GenAI Environment Variables Reference. Use the names from that reference in place of OPENAI_API_KEY and OPENAI_BASE_URL when your key is for a different service.
Tracking Your Budget and Spending
Your GenAI key is budgeted, which means there is an upper limit on how much you can spend using it. When you reach that limit, the key stops working, so it helps to check your remaining allowance as you go, especially on larger projects.
For a course key, the in-lab GenAI panel described earlier displays the amount out of the total budget you have spent so far, as well as the amount remaining for the assignment.
For a group key or an individual key, the My Keys page shows your budget and spending directly. Each key's row includes a Budget column with the total allowance for that key and a Spend column with the amount you have used so far, both in the currency amounts set by the admin. The row also shows an End Date column, which is the date the key stops working; a value of N/A means the key has no set end date. Review these columns as you work so that you know how much of each key's allowance remains.
If you are close to your budget limit and need more allowance, contact your instructor or the admin who granted you access, as only they can adjust it.


