Hugging Face Natural Language Processing API

NLP tasks including text generation, classification, and translation

Business capability
Artificial Intelligence Management BC-610.60

Operations 11

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /models/{model_id} Run inference on any Hub model · Run Inference on a Model #
Ask an LLM
“Can I call any model hosted on the Hub with a generic inference request?”
“Does the input and output format change depending on a model's pipeline task?”
Tell an agent
Run inference on model {model_id} with input {inputs}.
Send {inputs} to {model_id} with task parameters {parameters}.
POST /pipeline/{task} Run inference by task with a recommended model · Run Inference by Task Pipeline #
Ask an LLM
“Can I name just a task like summarization and let Hugging Face pick the best model?”
“Which pipeline tasks can I run without choosing a model myself?”
Tell an agent
Run the {task} pipeline on {inputs}.
Use the recommended model for {task} to process {inputs}.
POST /models/{model_id}/text-generation Continue a prompt with a language model · Text Generation Inference #
Ask an LLM
“Can I generate text from a prompt with a specific Hub model and control temperature and top_p?”
“Is there a way to cap max new tokens or penalize repetition in serverless text generation?”
Tell an agent
Continue the prompt {inputs} with model {model_id}.
Generate text from {inputs} on {model_id} using parameters {parameters}.
POST /models/{model_id}/text-classification Classify text, such as sentiment · Text Classification Inference #
Ask an LLM
“Can I tell whether a review is positive or negative with a sentiment model?”
“What labels and scores does text classification return?”
Tell an agent
Classify the sentiment of {inputs} with model {model_id}.
Label {inputs} using text classifier {model_id}.
POST /models/{model_id}/question-answering Extract an answer from a context passage · Question Answering Inference #
Ask an LLM
“Can a model pull the answer to a question out of a passage I provide?”
“Which task finds an answer span inside my own document text?”
Tell an agent
Answer the question in {inputs} from its context using model {model_id}.
Extract the answer span for {inputs} with QA model {model_id}.
POST /models/{model_id}/summarization Summarize a long text · Text Summarization Inference #
Ask an LLM
“Can I shorten a long article into a brief summary with a Hub model?”
“Is there a way to control summary length through task parameters?”
Tell an agent
Summarize {inputs} with model {model_id}.
Write a shorter version of {inputs} using {model_id} and parameters {parameters}.
POST /models/{model_id}/translation Translate text between languages · Translation Inference #
Ask an LLM
“Can I translate a sentence into another language with a translation model?”
“Which serverless task should I use to translate text with a model I pick?”
Tell an agent
Translate {inputs} with model {model_id}.
Run translation model {model_id} on {inputs}.
POST /models/{model_id}/fill-mask Fill a masked word in a sentence · Fill Mask Inference #
Ask an LLM
“Can a model guess the missing word where I put a [MASK] token?”
“What candidates and scores come back for a masked token?”
Tell an agent
Fill the [MASK] in {inputs} using model {model_id}.
Predict the masked word in {inputs} with {model_id}.
POST /models/{model_id}/feature-extraction Extract embeddings with a chosen Hub model · Feature Extraction Inference #
Ask an LLM
“Can I get raw feature vectors from a specific Hub model by calling its feature-extraction task?”
“Which serverless model task returns dense vector representations for text?”
Tell an agent
Extract features for {inputs} using model {model_id}.
Get the feature-extraction vectors of {inputs} from {model_id}.
POST /models/{model_id}/zero-shot-classification Classify text into labels you supply · Zero-shot Classification Inference #
Ask an LLM
“Can I classify text into my own categories without training a model?”
“Where do I pass the candidate labels for zero-shot classification?”
Tell an agent
Classify {inputs} into the candidate labels in {parameters} with model {model_id}.
Run zero-shot classification of {inputs} on {model_id} using labels {parameters}.
POST /models/{model_id}/sentence-similarity Score similarity between sentences · Sentence Similarity Inference #
Ask an LLM
“Can I measure how similar one sentence is to a list of other sentences?”
“Which task returns similarity scores between a source sentence and targets?”
Tell an agent
Compare the source and target sentences in {inputs} with model {model_id}.
Score sentence similarity for {inputs} using {model_id}.

Documentation

Specifications

SDKs

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/hugging-face:hugging-face-natural-language-processing-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

hugging-face-natural-language-processing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Hugging Face Inference Natural Language Processing API
  description: Run inference on 200,000+ machine learning models hosted on the Hugging Face Hub with a simple HTTP request. Supports text generation, image classification, object detection, speech recognition, and many more tasks.
  version: 1.0.0
  termsOfService: https://huggingface.co/terms-of-service
  contact:
    name: Hugging Face Support
    url: https://huggingface.co/support
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://api-inference.huggingface.co
  description: Hugging Face Inference API production server
security:
- bearerAuth: []
tags:


# --- truncated at 32 KB (32 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/hugging-face/refs/heads/main/openapi/hugging-face-natural-language-processing-api-openapi.yml