API Usage Examples¶
Interactive API Reference¶
The service publishes the schema for its own API, which is the authoritative reference for request and response fields:
- Swagger UI: https://inference-api.alcf.anl.gov/resource_server/docs
- OpenAPI schema: https://inference-api.alcf.anl.gov/resource_server/openapi.json
Both are publicly readable. Most endpoints shown here require a bearer token. The public status endpoints, /resource_server/health and /resource_server/status, do not. Because the schema is generated from the running service, it also lists a few endpoints that are internal to the service and not intended for direct use.
Querying Endpoint Status¶
Querying Endpoint Status
You can check the status of models on the cluster and list all available endpoints programmatically.
This endpoint provides information about what is currently live or queued.
Switching Between Clusters
Replace /sophia/ with /metis/, /minerva/, or /tara/ in the URL.
Chat Completions¶
Chat Completions
This endpoint is used for conversational AI.
Switching Between Clusters
To target a different cluster, simply replace the cluster/framework portion of the URL:
- Sophia:
/resource_server/sophia/vllm/v1 - Metis:
/resource_server/metis/api/v1 - Minerva:
/resource_server/minerva/api/v1 - Tara:
/resource_server/tara/api/v1
Reasoning and API Protocols¶
For Direct API models advertising all three protocols, use the appropriate native endpoint and request fields. Examples below use low; check the model's published capabilities for accepted efforts and the default. Controls are model/backend-specific, so do not copy one protocol's payload unchanged to another.
| Protocol | Minerva endpoint suffix | Effort request fields | Separate reasoning and final output |
|---|---|---|---|
| Chat Completions | /minerva/api/v1/chat/completions | "reasoning_effort": "low" | Reasoning alongside choices[0].message.content; streaming uses reasoning and content deltas. |
| Responses | /minerva/api/v1/responses | "reasoning": {"effort": "low"} | Reasoning items and message items in output; final text blocks have type output_text. |
| Messages | /minerva/api/v1/messages | "thinking": {"type": "adaptive"}, "output_config": {"effort": "low"} | thinking and text blocks in content. |
When reasoning.separate_output is true, read final content separately from reasoning. The output-token budget includes reasoning; a very small budget can end before any final text appears. Responses uses input and max_output_tokens, rather than Chat Completions' messages and max_tokens. Messages requires max_tokens and uses its own message and tool schemas.
Add "stream": true to request server-sent events when streaming is advertised, and use curl --no-buffer when inspecting them. Consume the protocol's completion event rather than stopping after the first text or reasoning chunk. For tool calling, use each API's native tool schema and return tool results using that same protocol. Model tool calling does not imply support for provider-specific built-in tools such as web search.
Vision Language Models¶
Vision Language Models
Use this endpoint to analyze images with text prompts.
Embeddings¶
Embeddings
This endpoint generates vector embeddings from text, currently supported by the vLLM framework.
Rate Limits¶
The service enforces two global request limits. Exceeding either of them returns 429 Too Many Requests.
| Limit | Value |
|---|---|
| Requests per second (per IP address) | 50 req/s |
| Requests per second (per caller) | 20 req/s |
The per-IP limit applies before the per-caller one, and each returns its own body:
{
"error": "Rate limit exceeded",
"message": "Too many requests from your IP address. Please try again later.",
"retry_after": "1 second"
}
A request that exceeds a limit is rejected with 429 and a Retry-After header giving the number of seconds to wait.
For more examples, please see the inference-endpoints GitHub repository.