Official agent skill

Hugging Face API Tool Builder

by huggingface in huggingface/skills

Builds reusable command line scripts that fetch, enrich or process data from the Hugging Face API, aimed at chained, repeated or automated tasks.

OfficialApache-2.0Auto-check passedAI & LLM Engineering

Install Hugging Face API Tool Builder

skills CLI
$ npx skills add huggingface/skills --skill huggingface-tool-builder -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install huggingface/skills huggingface-tool-builder --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/huggingface/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/huggingface-tool-builder .claude/skills/huggingface-tool-builder && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
huggingface-tool-builder
GitHub stars
11k
Used in
2 other repos
Token cost
~1.5k tokens
SKILL.md length
473 words
Files
8 (incl. references)
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Builds reusable command line scripts that fetch, enrich or process data from the Hugging Face API, aimed at chained, repeated or automated tasks.

  • Building a script that lists trending models with their metadata
  • SKILL.md covers Script Rules, Sample Scripts, High Level Endpoints and Accessing the API, plus 1 more section
  • Runs Shell and Python scripts from its folder; calls jq and curl; reaches huggingface.co; needs HF_TOKEN
  • Finding models linked to a given paper

What it does

The agent turns a request that depends on Hugging Face data into a small script instead of a one-off call. Scripts must answer --help with their inputs and outputs, non-destructive ones are tested before handoff, and shell is preferred, with Python or TSX when the complexity needs it. They send the HF_TOKEN environment variable as a Bearer Authorization header for higher rate limits and access to gated or private content, and usage examples are shared once the script is done.

The sample files under references show the patterns: baseline calls in bash, Python and TSX that return raw JSON, a script chaining trending models to metadata and model-card parsing, a paper search with a retry path, a model-card frontmatter extractor built on the hf CLI that emits NDJSON summaries, and a stdin-to-NDJSON enricher for model IDs in pipelines. The agent inspects the shape of API results before settling on a design and favors simple, composable solutions.

When your agent uses it

  • Building a script that lists trending models with their metadata
  • Finding models linked to a given paper
  • Extracting license and pipeline tags from model cards
  • Automating a repeated Hugging Face API query that feeds other tools

Example prompts

  • “Write a shell script that takes model IDs on stdin and prints their metadata as NDJSON.”
  • “Build a CLI tool that finds Hugging Face models associated with an arXiv paper.”
  • “Make a reusable script that lists gated models with their license and pipeline tag.”

Requirements

  • A Hugging Face token in the HF_TOKEN environment variable
  • The hf CLI, for the model card examples
  • Network access to the Hugging Face API

What it can do on your machine

Read from SKILL.md and the folder at commit c3ff942. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Shell and Python), which the agent can run.

    Shell commands in SKILL.md call:

    • jq
    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • huggingface.co

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • HF_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Hugging Face API Tool Builder loads about 1.5k tokens when it runs, and up to ~7.1k if it reads all its reference files. Until then it costs about 82 tokens; SKILL.md has 473 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~82
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from huggingface/skills at commit c3ff942, republished under its Apache-2.0 licence (© huggingface). 473 words, ~1,471 tokens.

Download SKILL.mdSave it as .claude/skills/huggingface-tool-builder/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
huggingface-tool-builder
description
Use this skill when the user wants to build tool/scripts or achieve a task where using data from the Hugging Face API would help. This is especially useful when chaining or combining API calls or the task will be repeated/automated. This Skill creates a reusable script to fetch, enrich or process data.

Hugging Face API Tool Builder

Your purpose is now is to create reusable command line scripts and utilities for using the Hugging Face API, allowing chaining, piping and intermediate processing where helpful. You can access the API directly, as well as use the hf command line tool. Model and Dataset cards can be accessed from repositories directly.

Script Rules

Make sure to follow these rules:

  • Scripts must take a --help command line argument to describe their inputs and outputs
  • Non-destructive scripts should be tested before handing over to the User
  • Shell scripts are preferred, but use Python or TSX if complexity or user need requires it.
  • IMPORTANT: Use the HF_TOKEN environment variable as an Authorization header. For example: curl -H "Authorization: Bearer ${HF_TOKEN}" https://huggingface.co/api/. This provides higher rate limits and appropriate authorization for data access.
  • Investigate the shape of the API results before commiting to a final design; make use of piping and chaining where composability would be an advantage - prefer simple solutions where possible.
  • Share usage examples once complete.

Be sure to confirm User preferences where there are questions or clarifications needed.

Sample Scripts

Paths below are relative to this skill directory.

Reference examples:

  • references/hf_model_papers_auth.sh — uses HF_TOKEN automatically and chains trending → model metadata → model card parsing with fallbacks; it demonstrates multi-step API usage plus auth hygiene for gated/private content.
  • references/find_models_by_paper.sh — optional HF_TOKEN usage via --token, consistent authenticated search, and a retry path when arXiv-prefixed searches are too narrow; it shows resilient query strategy and clear user-facing help.
  • references/hf_model_card_frontmatter.sh — uses the hf CLI to download model cards, extracts YAML frontmatter, and emits NDJSON summaries (license, pipeline tag, tags, gated prompt flag) for easy filtering.

Baseline examples (ultra-simple, minimal logic, raw JSON output with HF_TOKEN header):

  • references/baseline_hf_api.sh — bash
  • references/baseline_hf_api.py — python
  • references/baseline_hf_api.tsx — typescript executable

Composable utility (stdin → NDJSON):

  • references/hf_enrich_models.sh — reads model IDs from stdin, fetches metadata per ID, emits one JSON object per line for streaming pipelines.

Composability through piping (shell-friendly JSON output):

  • references/baseline_hf_api.sh 25 | jq -r '.[].id' | references/hf_enrich_models.sh | jq -s 'sort_by(.downloads) | reverse | .[:10]'
  • references/baseline_hf_api.sh 50 | jq '[.[] | {id, downloads}] | sort_by(.downloads) | reverse | .[:10]'
  • printf '%s\n' openai/gpt-oss-120b meta-llama/Meta-Llama-3.1-8B | references/hf_model_card_frontmatter.sh | jq -s 'map({id, license, has_extra_gated_prompt})'
Show full SKILL.md (123 more words)Show less

High Level Endpoints

The following are the main API endpoints available at https://huggingface.co

/api/datasets
/api/models
/api/spaces
/api/collections
/api/daily_papers
/api/notifications
/api/settings
/api/whoami-v2
/api/trending
/oauth/userinfo

Accessing the API

The API is documented with the OpenAPI standard at https://huggingface.co/.well-known/openapi.json.

IMPORTANT: DO NOT ATTEMPT to read https://huggingface.co/.well-known/openapi.json directly as it is too large to process.

IMPORTANT Use jq to query and extract relevant parts. For example,

Command to Get All 160 Endpoints

bash
curl -s "https://huggingface.co/.well-known/openapi.json" | jq '.paths | keys | sort'

Model Search Endpoint Details

bash
curl -s "https://huggingface.co/.well-known/openapi.json" | jq '.paths["/api/models"]'

You can also query endpoints to see the shape of the data. When doing so constrain results to low numbers to make them easy to process, yet representative.

Using the HF command line tool

The hf command line tool gives you further access to Hugging Face repository content and infrastructure.

bash
❯ hf --help
Usage: hf [OPTIONS] COMMAND [ARGS]...

  Hugging Face Hub CLI

Options:
  --help                Show this message and exit.

Commands:
  auth                 Manage authentication (login, logout, etc.).
  buckets              Commands to interact with buckets.
  cache                Manage local cache directory.
  collections          Interact with collections on the Hub.
  datasets             Interact with datasets on the Hub.
  discussions          Manage discussions and pull requests on the Hub.
  download             Download files from the Hub.
  endpoints            Manage Hugging Face Inference Endpoints.
  env                  Print information about the environment.
  extensions           Manage hf CLI extensions.
  jobs                 Run and manage Jobs on the Hub.
  models               Interact with models on the Hub.
  papers               Interact with papers on the Hub.
  repos                Manage repos on the Hub.
  skills               Manage skills for AI assistants.
  spaces               Interact with spaces on the Hub.
  sync                 Sync files between local directory and a bucket.
  upload               Upload a file or a folder to the Hub.
  upload-large-folder  Upload a large folder to the Hub.
  version              Print information about the hf version.
  webhooks             Manage webhooks on the Hub.

The hf CLI command has replaced the now deprecated huggingface-cli command.

© huggingface, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (references) in skills/huggingface-tool-builder of huggingface/skills.

  • SKILL.md
  • references/baseline_hf_api.py
  • references/baseline_hf_api.sh
  • references/baseline_hf_api.tsx
  • references/find_models_by_paper.sh
  • references/hf_enrich_models.sh
  • references/hf_model_card_frontmatter.sh
  • references/hf_model_papers_auth.sh

Open the folder on GitHubat commit c3ff942

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in huggingface/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Hugging Face API Tool Builder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Hugging Face API Tool Builder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Hugging Face API Tool Builder this skillhuggingface/skills11k2 repos~1.5kAutomated safety check: PassApache-2.0
Qwen Mtp GgufR6410418/Jackrong-llm-finetuning-guide1.7k—~1.7kAutomated safety check: PassMIT
Hugging Face TokenizersOrchestra-Research/AI-Research-SKILLs13k6 repos~3.4kAutomated safety check: PassMIT
Hugging Face Transformers Usagedavila7/claude-code-templates32k11 repos~1.2kAutomated safety check: PassMIT
Dataset FinderLeoYeAI/openclaw-master-skills2.2k—~5.4kAutomated safety check: PassProprietary
LLM Benchmarking with lm-evaluation-harnessOrchestra-Research/AI-Research-SKILLs13k8 repos~3kAutomated safety check: PassMIT

Similar skills

  • Qwen Mtp Gguf

    R6410418/Jackrong-llm-finetuning-guide

    Complete agent-ready workflow for Qwen-family MTP or nextn GGUF conversion and release.

    1.7k GitHub stars~1.7k tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Hugging Face Tokenizers

    Orchestra-Research/AI-Research-SKILLs

    Shows how to load, train and use fast Hugging Face tokenizers, with BPE, WordPiece and Unigram models, padding, truncation and alignment tracking.

    13k GitHub starsUsed in 6 repos~3.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Hugging Face Transformers Usage

    davila7/claude-code-templates

    Loads pre-trained Hugging Face Transformers models for text, vision and audio tasks, runs inference with pipelines and fine-tunes on custom datasets.

    32k GitHub starsUsed in 11 repos~1.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Dataset Finder

    LeoYeAI/openclaw-master-skills

    A skill your agent uses when users need to search for datasets, download data files, or explore data repositories.

    2.2k GitHub stars~5.4k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • LLM Benchmarking with lm-evaluation-harness

    Orchestra-Research/AI-Research-SKILLs

    Runs lm-evaluation-harness to benchmark language models on academic suites such as MMLU, GSM8K and HumanEval, compare models and track training checkpoints.

    13k GitHub starsUsed in 8 repos~3k tokens
    AI & LLM EngineeringAuto-check passed
  • Edge Bringup

    exeex/edge-cores

    Prepare a macOS or Ubuntu machine for edge-e3 development, diagnose missing Verilator/LLVM/Python dependencies, initialize the public repository, and answer or act on the example prompts in the root…

    110 GitHub stars~1.7k tokensUpdated 13 days ago
    AI & LLM EngineeringAuto-check: notes

More from huggingface/skills

All 25 skills in this repo
  • Official

    Finds or validates a usable SageMaker execution role before deploying or training, so scripts do not try to create IAM roles they lack permission to create.

    11k GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Official

    Chooses the right serving container and current image URI for deploying a Hugging Face model to a SageMaker endpoint, preferring Hugging Face images over generic ones.

    11k GitHub starsUsed in 1 repo~4.6k tokens
    Auto-check passed
  • Official

    Routes a sentence-transformers training task to the right model type and required reference docs and example scripts, covering bi-encoders, rerankers, sparse and multi-vector models.

    11k GitHub starsUsed in 1 repo~2.6k tokens
    Auto-check passed
  • Official

    Sets up an isolated Python environment with a supported interpreter and current boto3 before any SageMaker deployment, training or AWS automation code runs.

    11k GitHub starsUsed in 2 repos~1.7k tokens
    Auto-check passed
  • Official

    Runs evaluations of Hugging Face Hub models on local hardware with inspect-ai or lighteval, and helps choose between vLLM, Transformers and accelerate backends.

    11k GitHub starsUsed in 2 repos~1.6k tokens
    Auto-check passed
  • Official

    Deploys SageMaker endpoints with autoscaling, CloudWatch alarms and tags on by default, using scripts for real-time, scale-to-zero and async setups.

    11k GitHub starsUsed in 1 repo~6.9k tokens
    Auto-check passed

Questions about Hugging Face API Tool Builder

What does Hugging Face API Tool Builder do?

Builds reusable command line scripts that fetch, enrich or process data from the Hugging Face API, aimed at chained, repeated or automated tasks. The agent turns a request that depends on Hugging Face data into a small script instead of a one-off call. Scripts must answer --help with their inputs and outputs, non-destructive ones are tested before handoff, and shell is preferred, with Python or TSX when the complexity needs it.

When should I use Hugging Face API Tool Builder?

Hugging Face API Tool Builder fits situations like: building a script that lists trending models with their metadata; finding models linked to a given paper; extracting license and pipeline tags from model cards; automating a repeated Hugging Face API query that feeds other tools.

How do I install Hugging Face API Tool Builder in Claude Code?

Run `npx skills add huggingface/skills --skill huggingface-tool-builder -a claude-code`. Or copy the skill folder (skills/huggingface-tool-builder in huggingface/skills) into .claude/skills/huggingface-tool-builder in your project. Claude Code loads it when a task matches its description.

How do I install Hugging Face API Tool Builder in Codex?

Run `npx skills add huggingface/skills --skill huggingface-tool-builder -a codex`. Or copy the skill folder (skills/huggingface-tool-builder in huggingface/skills) into .agents/skills/huggingface-tool-builder in your project. Codex loads it when a task matches its description.

Can I use Hugging Face API Tool Builder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add huggingface/skills --skill huggingface-tool-builder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/huggingface-tool-builder, .gemini/skills/huggingface-tool-builder, .github/skills/huggingface-tool-builder and .opencode/skills/huggingface-tool-builder in your project.

What does Hugging Face API Tool Builder need to run?

Going by SKILL.md and its folder, Hugging Face API Tool Builder needs a shell and Python for the scripts in its folder, the command-line tools its instructions call (jq and curl) and credentials named HF_TOKEN. Our summary lists: A Hugging Face token in the HF_TOKEN environment variable; The hf CLI, for the model card examples; Network access to the Hugging Face API.

Does Hugging Face API Tool Builder access the network?

SKILL.md names 1 domain. In commands or code: huggingface.co; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Hugging Face API Tool Builder safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Hugging Face API Tool Builder use?

Hugging Face API Tool Builder is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Hugging Face API Tool Builder use?

About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.7k tokens, read only when the agent opens those files.

What are the alternatives to Hugging Face API Tool Builder?

Skills that share tags, products or a category with Hugging Face API Tool Builder: Qwen Mtp Gguf (R6410418/Jackrong-llm-finetuning-guide, 1.7k stars), Hugging Face Tokenizers (Orchestra-Research/AI-Research-SKILLs, 13k stars), Hugging Face Transformers Usage (davila7/claude-code-templates, 32k stars) and Dataset Finder (LeoYeAI/openclaw-master-skills, 2.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Hugging Face API Tool Builder?

huggingface (a GitHub organization, an official publisher) maintains it in huggingface/skills, which has 11,151 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 8, 2026.

Source: huggingface/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.