We are pleased to announce that the LLM APIs provided by OpenAI and Anthropic are now available from SQUID compute nodes. Previously, connections to these companies’ LLM APIs were available only from frontend nodes, but compute nodes can now also connect to them. This enables more flexible use cases, such as having an LLM analyze computation results while a job is running.
Overview
Outbound connections from compute nodes to the OpenAI API endpoint (api.openai.com:443) and the Anthropic API endpoint (api.anthropic.com:443) are now permitted. Since connections must go through a proxy server, please set the http_proxy and https_proxy environment variables in your job script as follows.
|
1 2 |
export http_proxy="http://ibgw1f-ib0:3128" export https_proxy="http://ibgw1f-ib0:3128" |
Example of Using the Claude API
The following explains how to use the Claude API.
1. Install the Claude API client. In this example, we use ant, the official client provided by Anthropic. For instructions on how to install ant, please refer to Anthropic’s documentation.
2. Run the following command on a frontend node and follow the instructions to complete client authentication.
|
1 |
ant auth login --no-browser |
Alternatively, you can obtain an API key from the Claude Console and authenticate by setting the API key in the ANTHROPIC_API_KEY environment variable within your job.
3. You can call the Claude API from a compute node by running the ant command in your job script. As described above, set the http_proxy and https_proxy environment variables in your job script in order to connect through the proxy server. For information on how to use ant, please refer to Anthropic’s documentation.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#!/bin/bash #PBS -q SQUID #PBS --group=<Group name> #PBS -l elapstim_req=00:10:00 #PBS -b 1 #PBS -v http_proxy="http://ibgw1f-ib0:3128" #PBS -v https_proxy="http://ibgw1f-ib0:3128" cd $PBS_O_WORKDIR ant messages create \ --model claude-opus-4-7 \ --max-tokens 1024 \ --message '{role: user, content: "Please give me three best practices for using the Claude API."}' |
Example output
{
"model": "claude-opus-4-7",
"id": "msg_019Te8i1WVawcQjQWgEdDBVk",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "# Three Best Practices for Using the Claude API\n\n## 1. Use system prompts to clearly define roles and constraints\n\nBy using thesystemparameter to specify Claude’s role, tone, output format, and prohibited actions, you can greatly improve the consistency and accuracy of responses. ..."
}
],
"stop_reason": "max_tokens",
"stop_sequence": null,
"stop_details": null,
"usage": {
"input_tokens": 32,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"cache_creation": {
"ephemeral_5m_input_tokens": 0,
"ephemeral_1h_input_tokens": 0
},
"output_tokens": 1024,
"service_tier": "standard",
"inference_geo": "global"
}
}
Posted : June 02,2026

