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);
Troubleshooting
Common issues when using the API:
- Authentication Failed: Ensure your API key is correct and has not expired. You can regenerate it in the Voyager portal.
- Model Not Found: Check the "Available Models" list in Voyager to ensure you are requesting a valid model name (e.g.,
llama3vsllama-3). - Rate Limits: If you receive a 429 error, you may be exceeding the allowed request rate. Please wait and try again.