Skip to content

Hugging Face API and MCP

Hugging Face provides hosted model inference and discovery of public models on the Hugging Face Hub. An agent can find public models and generate text through hosted inference. Add your Hugging Face key once in Longwave settings; calls run on your vendor account.

Add to Longwave

Add Hugging Face to your agent

Paste this into Claude Code or a terminal. Then run /mcp to sign in.

functions
3
access
Your key
tasks
1

Use Hugging Face on Longwave

  1. Download Longwave or open app.longwave.run.
  2. Add your Hugging Face API key once in Longwave settings. Calls run on your Hugging Face account at Hugging Face's price.
  3. Ask for the result in any thread, for example: “Find a model for a software integration”. The agent picks the Hugging Face function and calls it.

Use Hugging Face in Claude Code, Codex, Cursor or ChatGPT

Add the Longwave MCP server once. It carries 2,593 functions across 103 tools, including Hugging Face, and asks you to sign in on first use.

Why call Hugging Face through Longwave

  • Your Hugging Face key is stored once, encrypted, and used by every harness and device you use.
  • One MCP server for 103 tools, so your agent setup does not grow a key and a server per vendor.
  • Spending limits per key and per account, checked before a paid call is made.
  • Each call is recorded with the provider, the cost and the result, and can be read again from another device.

Hugging Face functions

Function Price
Generate a response with a Hugging Face model Accepts a model name, conversation messages and an output token limit and returns a model response to the supplied conversation. huggingface.chat.complete
The selected model and usage determine the charge; no single per-call price applies to this function.
Search Hugging Face models Accepts a search term and returns public model records matching the search term. huggingface.models.search
Model or provider metadata lookup; no generation charge or separate published per-call fee.
List Hugging Face model tags Accepts a retrieval type and returns supported model tags grouped by tag type. huggingface.openapi.get.api.models-tags-by-type
Model or provider metadata lookup; no generation charge or separate published per-call fee.

Prices are Hugging Face's published rates. Source: Hugging Face pricing.

Use cases

Questions people ask

How do I get a Hugging Face API key?

Sign in to Hugging Face and create a key at huggingface.co/settings/tokens. Add it once in Longwave settings and your agents' Hugging Face calls run on your own account. Hugging Face API keys

Do I need a Hugging Face account?

Yes. Create a key at https://huggingface.co/settings/tokens and add it in Longwave settings. Longwave stores it encrypted and uses it only for your calls.

How do I use Hugging Face in Claude Code?

Add the Longwave MCP server once with claude mcp add --transport http longwave https://api.longwave.run/v1/mcp/tasks, sign in, and ask for what you need. Claude finds the right Hugging Face function and calls it.

Use Hugging Face in Longwave

Ask any Longwave thread for the result, or add Longwave to Claude Code, Codex, Cursor or ChatGPT.

Add to Longwave