Hugging Face Model API
One model with its card, weight facts, base models, evaluation results and the providers that serve it.
GET /v1/hugging-face/models/{owner}/{name}1 credit Failed requests are free
About this endpoint
GET /v1/hugging-face/models/{owner}/{name} returns model with the summary fields plus the card metadata as card, languages, datasets, baseModels, derivedModelCounts, safetensors, gguf, transformers, inferenceProviders, evalResults, usedStorageBytes and widgetExamples.
Pass the full repository id as owner/name, for example openai-community/gpt2; a bare id such as gpt2 is not accepted. include adds optional blocks: config for config.json, spaces for the Spaces that use the model, and security for scan findings. revision selects a branch, tag or commit. HTTP is 200 for every outcome, so branch on lookupStatus (found or not_found); a private model returns not_found.
Hugging Face Model API FAQ
What does include=config return?
include=config adds the model's config.json as model.config. Without it, model.config is null.
Can I see which Spaces use a model?
Yes, with include=spaces. The result is model.spaces, a list of Space ids; it is null when the block was not requested.
What does lookupStatus tell me?
found means the model was returned. not_found means there is no public model with that owner and name, which also covers a private model.
How do I read a specific revision?
Pass revision as a branch, tag or commit. The default is main.
How much does a model lookup cost?
Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth.
Other Hugging Face endpoints
- Search modelsGET /v1/hugging-face/models
- Search datasetsGET /v1/hugging-face/datasets
- Get datasetGET /v1/hugging-face/datasets/{owner}/{name}
- Search SpacesGET /v1/hugging-face/spaces
- Get SpaceGET /v1/hugging-face/spaces/{owner}/{name}
- READMEGET /v1/hugging-face/repos/{repoType}/{owner}/{name}/readme
- FilesGET /v1/hugging-face/repos/{repoType}/{owner}/{name}/files
- CommitsGET /v1/hugging-face/repos/{repoType}/{owner}/{name}/commits