Using The API
The RCD LLM Service is intended for clients that support OpenAI-style API requests.
Prerequisites
Before connecting programmatically, make sure you have:
- an approved RCD LLM Service allocation
- an API key from llm.rcd.clemson.edu
- access to the Clemson network, either on campus or through VPN
Endpoints
The RCD LLM Service provides LLM endpoints compliant with industry standards. Not all endpoints are compatible with every model, so be sure to check the model page to know what endpoints it supports.
- OpenAI-Compatible Chat Completions:
POST /v1/chat/completions. - OpenAI-Compatible Completions:
POST /v1/completions. - OpenAI-Compatible Embeddings:
POST /v1/embeddings. - Cohere-Compatible Rerank:
POST /v1/rerank. - OpenAI-Compatible Responses:
POST /v1/responses. Note: the proxy currently uses a shim that provides an initial compatibility layer by transforming Responses-format requests into chat-completions requests. Any model that supports the chat-completions endpoint therefore has preliminary support for Responses, but we do not guarantee the stability of this shim layer. - OpenAI-Compatible Models List:
GET /v1/models.
When using these endpoints in applications or SDKs that allow OpenAI-compatible
endpoints, you typically configure them by setting the base URL to
https://llm.rcd.clemson.edu/v1. Alternatively, some clients may require the
full endpoint, e.g. https://llm.rcd.clemson.edu/v1/chat/completions.
Choose A Model
Check the Available Models page for instructions on finding and using the correct model name.
Store Your API Key
Treat your API key like a password. Do not paste it into shared documents, shell history you do not control, or Git repositories.
One common pattern is to store it in an environment variable:
export RCD_LLM_API_KEY="your-api-key-here"
Example: curl
If your client needs the full chat-completions endpoint, you can send a request
with curl like this:
curl https://llm.rcd.clemson.edu/v1/chat/completions \
-H "Authorization: Bearer $RCD_LLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<model-name>",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Give me three ideas for a short workshop abstract."}
],
"temperature": 0.2
}'
Replace <model-name> with a model shown on the Models page.
Example: Python
The Python openai package can be pointed at the service by overriding the base
URL:
pip install openai
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["RCD_LLM_API_KEY"],
base_url="https://llm.rcd.clemson.edu/v1",
)
response = client.chat.completions.create(
model="<model-name>",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Summarize the benefits of on-prem LLM hosting in two sentences."},
],
temperature=0.2,
)
print(response.choices[0].message.content)
More Examples
More examples are available in a RCD LLM examples repository, including:
- Embedding and rerank
- Structured output
- Multimodal (image, video, and audio processing)
Notes
- If your client asks for a base URL, use
https://llm.rcd.clemson.edu/v1. - If your client asks for a full chat-completions endpoint, use
https://llm.rcd.clemson.edu/v1/chat/completions. - If you receive network or connection errors from off campus, connect to the Clemson University VPN and try again.