Skip to Content
API ReferenceSystem & Search API

System & Search API

The System API provides operational health information, registry-wide statistics, and unified search across the OpenModels registry.

Registry Stats

GET /api/stats

Returns current counts of models, providers, and mappings in the registry, along with the timestamp of the last successful data sync.

Parameters

No parameters required.

Example Request

curl "https://api.openmodels.run/api/stats"

Example Response

{ "models": 115, "providers": 50, "mappings": 183, "last_sync_at": "2026-06-19T10:30:00.000Z" }

Response Fields

FieldTypeDescription
modelsintegerTotal number of models in the registry
providersintegerTotal number of providers in the registry
mappingsintegerTotal number of provider-model mappings
last_sync_atstring | nullISO 8601 timestamp of last successful ingestion, or null if no sync has completed

Caching

Results are cached with a 60-second TTL. Cache is invalidated after each ingestion cycle.


GET /api/search

Unified full-text search across models and providers. Results are grouped by type and ranked by relevance.

Query Parameters

ParameterTypeRequiredDefaultDescription
qstringYesSearch query (minimum 1 character)
typestringNoFilter by type: models or providers. Omit for both.
limitintegerNo10Maximum results per type (max 20)

Example Request

curl "https://api.openmodels.run/api/search?q=deepseek&limit=5"

Example Response

{ "models": [ { "id": "deepseek-v4", "name": "DeepSeek V4", "type": "model", "description": "DeepSeek's fourth-generation large language model." }, { "id": "deepseek-v3", "name": "DeepSeek V3", "type": "model", "description": "DeepSeek's third-generation model with MoE architecture." } ], "providers": [ { "id": "deepseek", "name": "DeepSeek", "type": "provider", "description": "Official DeepSeek inference API." } ], "total": 3 }

Response Fields

FieldTypeDescription
modelsarrayMatching model results, sorted by relevance
providersarrayMatching provider results, sorted by relevance
totalintegerTotal number of results across both types
*.idstringEntity identifier
*.namestringDisplay name
*.typestringEntity type: model or provider
*.descriptionstringBrief description

Ranking

Results are ranked by relevance: exact matches first, then prefix matches, then substring matches.


Search Index

GET /api/search/index

Returns a lightweight JSON payload of all model and provider names/IDs for client-side filtering. Designed for the Command Palette (Cmd+K) to enable instant local search without server round-trips.

Parameters

No parameters required.

Example Request

curl "https://api.openmodels.run/api/search/index"

Example Response

{ "models": [ { "id": "deepseek-v4", "name": "DeepSeek V4", "capabilities": ["chat", "reasoning"], "modalities": ["text", "code"] }, { "id": "gpt-5", "name": "GPT-5", "capabilities": ["chat", "vision", "reasoning"], "modalities": ["text", "image"] } ], "providers": [ { "id": "openai", "name": "OpenAI", "compatibility": "openai" }, { "id": "anthropic", "name": "Anthropic", "compatibility": "anthropic" } ], "updated_at": "2026-05-11T10:30:00.000Z" }

Caching

Results are cached with a 5-minute TTL. Payload is typically under 50KB for the full registry.


Health Check

GET /api/health

Returns the overall health status of the API and its dependencies, including database connectivity and cache availability. This endpoint is designed for automated monitoring systems, load balancers, and uptime services.

Parameters

No parameters required.

Example Request

curl "https://api.openmodels.run/api/health"

Example Response

{ "status": "healthy", "timestamp": "2025-07-10T14:30:00.000Z", "services": { "api": { "status": "healthy" }, "database": { "status": "healthy", "latency_ms": 3 }, "cache": { "status": "healthy", "latency_ms": 1 } } }

Response Fields

FieldTypeDescription
statusstringOverall system status: healthy or degraded
timestampstringISO 8601 timestamp of the health check
servicesobjectStatus of individual service dependencies
services.apiobjectAPI service status
services.api.statusstringAPI status: healthy or degraded
services.databaseobjectDatabase connection status
services.database.statusstringDatabase status: healthy or degraded
services.database.latency_msintegerDatabase ping latency in milliseconds
services.cacheobjectCache layer status
services.cache.statusstringCache status: healthy or degraded
services.cache.latency_msintegerCache ping latency in milliseconds

HTTP Status Codes

StatusMeaningDescription
200HealthyAll services are operating normally
503DegradedOne or more services are unavailable or experiencing issues

When the system is degraded, the response body still returns with the same structure, but individual service statuses will reflect the issue:

{ "status": "degraded", "timestamp": "2025-07-10T14:30:00.000Z", "services": { "api": { "status": "healthy" }, "database": { "status": "healthy", "latency_ms": 5 }, "cache": { "status": "degraded", "latency_ms": null } } }
Last updated on