LLM API Access
Overview
You can access Large Language Models (LLMs) programmatically for your applications or scripts. The API is compatible with the OpenAI specification, allowing you to use standard tools and libraries.
Getting Started with AI walks you from zero to a working setup — key, assistant, agents, and skills — and assumes no prior experience. This page is the API reference underneath it.
How to Request an API Key
API keys are managed through the Voyager User Administration portal.
- Login to the Voyager portal.
- Navigate to the LLM Access tab.
- Click Create Key to generate an API token.
- Review the list of available models to use in your requests.

Examples
- curl
- Python
- JavaScript
Replace <YOUR_API_KEY> with your actual key and <MODEL_NAME> with a supported model (e.g., llama3).
curl https://openai.rc.asu.edu/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-d '{
"model": "<MODEL_NAME>",
"messages": [
{
"role": "user",
"content": "Explain quantum computing in one sentence."
}
]
}'
You can use the standard openai Python library to interact with the API.
from openai import OpenAI
# Initialize the client with the ASU API endpoint
client = OpenAI(
base_url="https://openai.rc.asu.edu/v1",
api_key="<YOUR_API_KEY>",
)
response = client.chat.completions.create(
model="<MODEL_NAME>",
messages=[
{"role": "user", "content": "Write a hello world program in Python."},
],
)
print(response.choices[0].message.content)
You can use the official openai npm package to interact with the API.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://openai.rc.asu.edu/v1",
apiKey: "<YOUR_API_KEY>",
});
const response = await client.chat.completions.create({
model: "<MODEL_NAME>",
messages: [
{ role: "user", content: "Write a hello world program in JavaScript." },
],
});
console.log(response.choices[0].message.content);
Use Python
For real projects, keep secrets out of source files by reading them from the environment.
Install the SDK into your virtual environment with Mamba:
mamba install -c conda-forge openai
Set the connection values in your shell (or a .env file that you keep out of source control). Read
the key in from a prompt so it does not land in your shell history:
read -rs OPENAI_API_KEY # paste your key, then press Enter (nothing is echoed)
export OPENAI_API_KEY
export OPENAI_BASE_URL="https://openai.rc.asu.edu/v1"
To set it permanently, add the export line to ~/.zshrc or ~/.bashrc by editing the file in a
text editor rather than echoing the key into it — an echo command containing your key is itself
recorded in your history.
Anything typed at a prompt is written in plain text to ~/.zsh_history, ~/.bash_history, or
PowerShell's ConsoleHost_history.txt. The same goes for the placeholder keys in the examples above:
substitute a variable rather than pasting the real value. If a key is exposed, regenerate it in the
Voyager portal — rotating it invalidates the old one.
Your Python code can then read the key and base URL from the environment automatically:
from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY and OPENAI_BASE_URL from the environment
response = client.chat.completions.create(
model="<MODEL_NAME>",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
Use an AI coding assistant
Prefer to build with an AI assistant that can read your project and edit files? These options connect to this same RC gateway with your key:
- Getting Started with AI — the complete beginner path: pick a tool, set it up, and learn the prompting and agent habits that make our models work well. Start here.
- Set up OpenCode — a free assistant with a desktop app and a terminal interface. The guide walks you through installing it, storing your key, and adding RC as a provider from scratch.
- Connect VS Code to the RC API — use VS Code Chat with the RC gateway (Bring Your Own Key).
OpenCode needs two things to reach RC: your API key and a provider config pointing at
https://openai.rc.asu.edu/v1. You do not have to write that config by hand — the opencode tab
under LLM Access in the Voyager portal generates it for you,
including agent roles and tool permissions. See
Getting Started with AI.
List available models
curl https://openai.rc.asu.edu/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
Use any returned id as the model value in chat requests. The Models list in the portal shows context windows, capabilities, and usage data.
Troubleshooting
Common issues when using the API:
- Authentication Failed (
401): Ensure your API key is correct and has not expired. You can regenerate it in the portal. - Model Not Found: Check the "Available Models" list to ensure you are requesting a valid model name (e.g.,
llama3vsllama-3). - SDK ignores the endpoint: If cURL works but an SDK does not, confirm the SDK is using
https://openai.rc.asu.edu/v1as its base URL. - Rate Limits (
429): If you receive a 429 error, you may be exceeding the allowed request rate. Please wait and try again.
Related guides
- Getting Started with AI — the complete beginner setup path: tools, agents, skills, and prompting.
- Set up OpenCode — connect the OpenCode AI coding assistant to the RC gateway.
- Connect VS Code to the RC API — use VS Code Chat with the RC LLM gateway (BYOK).
- Tutorials & Projects — build small research tools with the API and AI coding assistance.