HFAI Cloud · integration
curl
on HFAI Cloud.
One command, one key, no client library.
What curl is, and what it sends.
Its own description, its own docs,
and the request it makes here.
curl describes itself as the command line tool and library for transferring data with URLs, and it is maintained by its own project rather than by us. The release standing on curl.se on the day this page was checked was 8.23.0, checked against curl.se. Because it ships with most systems and needs no dependency file, it is the least ceremony a single HFAI Cloud answer can be asked for: nothing to install in a project and nothing to import into a shell.
The command below is the whole integration. curl posts JSON to the chat completions path, carrying the key in a bearer header; the model name and the message list are the two fields the endpoint reads. Point it at the base URL https://api.heartflowai.net/v1, replace hfai_live_… with a key minted in the HFAI Cloud app, and name any model from the catalogue — GPT-OSS 120B is the one the anonymous free tier covers, which is why it is the model spelled out here.
curl https://api.heartflowai.net/v1/chat/completions \
-H "Authorization: Bearer hfai_live_…" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-oss:120b","messages":[{"role":"user","content":"Hello HFAI"}]}'
Add --no-buffer and "stream":true to read the answer as it is generated rather than in one piece:
curl --no-buffer https://api.heartflowai.net/v1/chat/completions \
-H "Authorization: Bearer hfai_live_…" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-oss:120b","stream":true,"messages":[{"role":"user","content":"Hello HFAI"}]}'
Five of curl's own options carry that call, and each one has a section of its own in curl's manual, linked below. Nothing here is a curl plugin, a wrapper or a fork: it is the stock binary talking to a plain HTTP endpoint, which is also why the same request works from a container, a cron job or another machine's shell without changing anything but the key.
| Option | What it carries |
|---|---|
--header | An extra header for the request: here the bearer key and the JSON content type. |
--data | The request body, sent as a POST to the URL on the command line. |
--no-buffer | Disables output buffering, so a streamed answer arrives as it is produced. |
--json | A shortcut for --data that also sets the JSON content type, if you prefer one option to two headers. |
--silent | Suppresses curl's own progress meter, leaving the response body alone on standard output. |
curl is an independent project with its own maintainers, its own release process and its own trademark position; the terms it is distributed under live on its site, not on ours. Its copyright page records the licence as inspired by MIT/X but not identical to it, checked at curl.se/docs/copyright.html, and the options above are documented at curl.se/docs/manpage.html. HeartFlowAI is not affiliated with the curl project, is not sponsored or endorsed by it, and ships no part of it: the page describes a public tool and the request that reaches this API from it.
Check the answer yourself.
A status line, a JSON body,
or an error code with a reason.
curl prints the status line and the body, so a wrong key shows up as a 401 rather than as a surprise later in your own code. Add --silent --show-error to keep a failure visible without the progress meter, and --write-out "%{http_code}" to print only the status when a script needs it.
The response envelope, the way a streamed answer is framed and every error code are documented in the API reference, and the catalogue with its prices is on HFAI Cloud.
The same key works everywhere else.
curl is one way in. The endpoint, the key and the model string are the same for a coding agent, a script or a chat client.