Responses API and Anthropic Messages API
Level: Intermediate · Category: API reference
Tags: OpenAI Responses · Anthropic Messages · Claude-compatible clients
Besides Chat Completions, the LLM API accepts two other request shapes, so tools written for them
work with the RC models: OpenAI's Responses API (POST /v1/responses) and Anthropic's
Messages API (POST /v1/messages). Both are translated to chat completions, so every chat model
is available through them, with the same queuing and limits. Keys and setup are on
LLM API Access.
OpenAI Responses API
from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY and OPENAI_BASE_URL
response = client.responses.create(
model="gemma4-31b-it",
instructions="Answer in one sentence.",
input="What does sbatch do?",
)
print(response.output_text)
What is supported:
inputas a string or a list of messages;instructions;max_output_tokens;temperature; functiontoolsand theirfunction_call/function_call_outputitems; images asinput_imageparts.reasoning: {"effort": "none" | "low" | "medium" | "high"}, with the same effect asreasoning_efforton chat.- Streaming (
stream: true) with the standard events:response.created,response.output_text.delta,response.reasoning_text.delta,response.completed, andresponse.failedif the model fails mid-reply. Function calls arrive whole at the end, not as argument deltas.
What is not:
- No stored conversations.
store: true,previous_response_idandbackground: truereturn400: send the whole conversation ininputon every request. - No hosted tools. OpenAI-hosted tools such as
web_searchandfile_searchare dropped; use function tools, or a model with the web search add-on. - For JSON-schema output, use Chat Completions with
response_format.
Anthropic Messages API
The anthropic SDK works with the base URL without /v1 (the SDK adds /v1/messages) and your
RC key:
import os
import anthropic
client = anthropic.Anthropic(base_url="https://openai.rc.asu.edu", api_key=os.environ["OPENAI_API_KEY"])
message = client.messages.create(
model="gemma4-31b-it",
max_tokens=1024,
messages=[{"role": "user", "content": "What does sbatch do? One sentence."}],
)
print(message.content[0].text)
- The key can be sent as
x-api-key(what the SDK does) orAuthorization: Bearer. system,toolsandtool_choice,tool_use/tool_resultblocks, images,stop_sequencesand streaming work. Errors use Anthropic's error shape ({"type": "error", "error": {...}}).- Thinking:
thinking: {"type": "disabled"}is effortnone;{"type": "enabled", "budget_tokens": N}islowbelow 4,096 tokens,mediumbelow 16,384, andhighotherwise. Thinking comes back asthinkingcontent blocks. POST /v1/messages/count_tokensreturns an estimate of the prompt's tokens.- Not supported: prompt caching controls (
cache_controlis ignored; the models cache prompt prefixes on their own), server tools such as Anthropic's web search, and images insidetool_resultblocks (dropped).
Claude-compatible tools
Tools that speak the Messages API and let you set the base URL, such as Claude Code, can use the RC
models. Point them at https://openai.rc.asu.edu (no /v1) with your RC key. For Claude Code:
export ANTHROPIC_BASE_URL="https://openai.rc.asu.edu"
export ANTHROPIC_AUTH_TOKEN="$OPENAI_API_KEY" # your RC key
export ANTHROPIC_MODEL="glm-5-3" # an RC chat model ID
Requests naming a Claude model the gateway doesn't have (such as claude-sonnet-4-5) are answered by
a default RC model instead of failing; the reply still reports the name you sent. Set the model
explicitly so you know which model you're using. These tools are tuned for Claude models, so expect
differences in tool use and long agent runs; OpenCode is set up for the RC models
and is the recommended coding assistant.
Related guides
- Chat completions: the native API, with every feature.
- Limits and Errors: queuing, time limits, and error codes.