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.
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):
export OPENAI_API_KEY="YOUR_API_KEY"
export OPENAI_BASE_URL="https://openai.rc.asu.edu/v1"
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? Two beginner-friendly options connect to this same RC gateway with your key:
- 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 (stored as an environment variable) and a
provider config that points at https://openai.rc.asu.edu/v1. Both are covered step by step in the
OpenCode setup guide.
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
- 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.