---
title: Cum expun un flow LangFlow prin API și cum îl integrez?
url: "https://www.hostx.ro/kb/cum-expun-un-flow-langflow-prin-api-si-cum-il-integrez/"
updated: "2026-08-10"
category: LangFlow
---

# Cum expun un flow LangFlow prin API și cum îl integrez?

După ce ai construit un flow, îl poți folosi în afara LangFlow: îl **apelezi prin API** sau îl **înglobezi ca widget** de chat în site.

## 1. Găsește opțiunile de integrare

Deschide flow-ul și apasă butonul **„API”** (sau „Publish”/„Share”). LangFlow generează exemple de cod gata făcute pentru apelarea flow-ului.

## 2. Apelarea prin API

LangFlow expune un endpoint pentru rularea flow-ului. Exemplu simplificat:

```
curl -X POST 'https://langflow.domeniultau.ro/api/v1/run/ID_FLOW' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: CHEIA_TA' \
  -d '{"input_value":"Salut!","output_type":"chat","input_type":"chat"}'
```

## 3. Protejează endpointul

Generează o **cheie API** în LangFlow și trimite-o cu fiecare cerere. Nu lăsa flow-ul accesibil fără protecție, ca să nu-ți consume cineva creditele modelului.

## 4. Widget de chat

LangFlow oferă și un **widget** (cod embed) pe care îl adaugi în paginile site-ului pentru o bulă de chat.

## 5. Integrare în cod

Pentru că este bazat pe Python, poți exporta flow-ul și îl poți integra direct în propriile aplicații, dacă vrei control total.

**Sfat:** Testează întâi cu un apel API simplu (curl), apoi integrează widgetul. Ține cont de rate limiting și de costurile modelului atunci când expui un flow public.
<template id="hostx-kb-related-holder"><section class="hostx-kb-related" aria-label="Articole similare"><h2 class="hostx-kb-related__title">Articole similare</h2><div class="hostx-kb-related__grid"><a class="hostx-kb-related__card" href="https://www.hostx.ro/kb/cum-conectez-langflow-la-openai-sau-ollama-variabile-globale/"><span class="hostx-kb-related__ico"><svg aria-hidden="true" focusable="false"
  class="lucide lucide-file-text"
  xmlns="http://www.w3.org/2000/svg"
  width="24"
  height="24"
  viewBox="0 0 24 24"
  fill="none"
  stroke="currentColor"
  stroke-width="2"
  stroke-linecap="round"
  stroke-linejoin="round"
>
  <path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" />
  <path d="M14 2v5a1 1 0 0 0 1 1h5" />
  <path d="M10 9H8" />
  <path d="M16 13H8" />
  <path d="M16 17H8" />
</svg></span><span class="hostx-kb-related__name">Cum conectez LangFlow la OpenAI sau Ollama (variabile globale)?</span></a><a class="hostx-kb-related__card" href="https://www.hostx.ro/kb/langflow-vs-flowise-dify-si-langchain-care-sunt-diferentele/"><span class="hostx-kb-related__ico"><svg aria-hidden="true" focusable="false"
  class="lucide lucide-file-text"
  xmlns="http://www.w3.org/2000/svg"
  width="24"
  height="24"
  viewBox="0 0 24 24"
  fill="none"
  stroke="currentColor"
  stroke-width="2"
  stroke-linecap="round"
  stroke-linejoin="round"
>
  <path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" />
  <path d="M14 2v5a1 1 0 0 0 1 1h5" />
  <path d="M10 9H8" />
  <path d="M16 13H8" />
  <path d="M16 17H8" />
</svg></span><span class="hostx-kb-related__name">LangFlow vs Flowise, Dify și LangChain: care sunt diferențele?</span></a><a class="hostx-kb-related__card" href="https://www.hostx.ro/kb/ce-este-langflow-si-la-ce-foloseste/"><span class="hostx-kb-related__ico"><svg aria-hidden="true" focusable="false"
  class="lucide lucide-file-text"
  xmlns="http://www.w3.org/2000/svg"
  width="24"
  height="24"
  viewBox="0 0 24 24"
  fill="none"
  stroke="currentColor"
  stroke-width="2"
  stroke-linecap="round"
  stroke-linejoin="round"
>
  <path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" />
  <path d="M14 2v5a1 1 0 0 0 1 1h5" />
  <path d="M10 9H8" />
  <path d="M16 13H8" />
  <path d="M16 17H8" />
</svg></span><span class="hostx-kb-related__name">Ce este LangFlow și la ce folosește?</span></a><a class="hostx-kb-related__card" href="https://www.hostx.ro/kb/cum-construiesc-primul-flow-in-langflow/"><span class="hostx-kb-related__ico"><svg aria-hidden="true" focusable="false"
  class="lucide lucide-file-text"
  xmlns="http://www.w3.org/2000/svg"
  width="24"
  height="24"
  viewBox="0 0 24 24"
  fill="none"
  stroke="currentColor"
  stroke-width="2"
  stroke-linecap="round"
  stroke-linejoin="round"
>
  <path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" />
  <path d="M14 2v5a1 1 0 0 0 1 1h5" />
  <path d="M10 9H8" />
  <path d="M16 13H8" />
  <path d="M16 17H8" />
</svg></span><span class="hostx-kb-related__name">Cum construiesc primul flow în LangFlow</span></a></div></section></template>