Skip to main content
GET
GET /v1/models

Overview

List available models on the server. This endpoint is compatible with OpenAI’s models API and returns information about the currently loaded model.
This endpoint requires authentication if the server was started with --api-key.

Authentication

string
Bearer token with your API key (required if server started with --api-key)Format: Bearer YOUR_API_KEY

Request

No request body or parameters required.

Response

string
Object type, always "list"
array
Array of available model objects

Examples

Basic Request

Response


Using OpenAI Python Client


Using OpenAI Node.js Client


Use Cases

Discovery

Check which model is currently loaded on the server:

Validation

Verify the expected model is loaded:

Integration Testing

Use in integration tests to ensure correct setup:

Client Configuration

Auto-configure client based on available model:

Error Responses

401 Unauthorized

Missing or invalid API key:
Causes:
  • Missing Authorization header
  • Incorrect API key
  • Wrong authorization format

500 Internal Server Error

Server error (rare):

OpenAI Compatibility

This endpoint is fully compatible with OpenAI’s /v1/models endpoint:
  • Same request format (no body required)
  • Same response structure
  • Works with OpenAI client libraries
  • Can be used as a drop-in replacement

Differences from OpenAI

HyperGen always returns a single model (the one loaded at startup), while OpenAI returns multiple models.
The model ID is the HuggingFace model identifier or local path, not an OpenAI model ID.
Always returns "owned_by": "hypergen" instead of OpenAI’s organization names.
HyperGen doesn’t provide model capabilities, permissions, or other metadata that OpenAI includes.

Response Fields Reference

Top Level

Model Object


Model Identification

The model id returned matches what was passed to hypergen serve:

Best Practices

Model information doesn’t change during server lifetime. Cache the response to avoid unnecessary API calls.
Use the model ID to auto-configure generation parameters based on the model type.
Check the model ID at startup to ensure the correct model is loaded before processing requests.
Handle cases where the API is unavailable or returns an unexpected model.

Generate Images

Generate images with the loaded model

Health Check

Check server health and status