Hugging Face API Tester

Build, run and copy Hugging Face Inference API requests as cURL, Python and JavaScript.

Building the request and the cURL, Python and JavaScript code happens entirely in your browser. When you press Run, your Hugging Face token and inputs are sent directly from your browser to the Hugging Face Inference API — never to ArrayKit. Your token is held in browser memory only and is never stored or sent to ArrayKit. Avoid using production tokens on shared or public machines.

Try the API Request Client

About Hugging Face API Tester

The Hugging Face API tester lets you build, run and copy Hugging Face Inference API requests without leaving your browser. Enter a model id like mistralai/Mistral-7B-Instruct-v0.2, type your inputs, paste your hf_ token, and ArrayKit assembles the POST to https://api-inference.huggingface.co/models/{model} with the right Authorization: Bearer header and JSON body. It instantly generates ready-to-paste cURL, Python (requests) and JavaScript (fetch) snippets, and where Hugging Face allows cross-origin calls you can press Run to see the live response. It is built for ML engineers, backend developers and prompt tinkerers who want to smoke-test a model, confirm a token works, or grab clean code for an app. The request and all code are built locally in your browser; when you Run, the call goes directly from your browser to Hugging Face.

Features

How to use the Hugging Face API Tester

  1. Enter a model id such as mistralai/Mistral-7B-Instruct-v0.2
  2. Type your inputs (for example, a prompt) into the Inputs field
  3. Paste your Hugging Face token (hf_…) into the token field
  4. Press Run to send the request, or copy the cURL, Python or JavaScript code
  5. Read the JSON response and status, then tweak the model or inputs and retry

Example

Input

curl -X POST 'https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.2' \
  -H 'Authorization: Bearer hf_xxx' \
  -H 'Content-Type: application/json' \
  -d '{"inputs":"Write a haiku about TypeScript."}'

Output

[{"generated_text":"Types guard every line..."}]

A minimal Hugging Face Inference API call with an hf_ token and JSON inputs.

Common errors & troubleshooting

Frequently asked questions

What is the Hugging Face API tester?
It is an ArrayKit tool that builds Hugging Face Inference API requests from a model id, inputs and your hf_ token, then lets you run them and copy the equivalent cURL, Python and JavaScript code.
Do I need a Hugging Face token?
Yes. Inference API calls use an Authorization: Bearer hf_ token. Generate one at huggingface.co/settings/tokens and paste it into the token field.
Why does Run fail in the browser when the cURL works?
The Hugging Face Inference API frequently does not send CORS headers for browser requests. The generated cURL or Python snippet runs fine from a terminal or server where CORS does not apply.
Which models can I test?
Any model that exposes the serverless Inference API. The tool suggests Mistral-7B-Instruct, Meta-Llama-3-8B-Instruct and gpt2, but you can type any model id like owner/name.
Is my token safe to use here?
The request and all code are built locally in your browser. When you press Run, the call goes directly from your browser to Hugging Face, not to ArrayKit, and your token is kept in browser memory only — never stored or sent to ArrayKit. Avoid using production tokens on shared machines.
Can I generate code for my app?
Yes. The tool outputs ready-to-paste cURL, Python (requests) and JavaScript (fetch) for the exact request you built, so you can drop it straight into a script or backend.

Related tools

All ArrayKit tools