Skip to navigation

Langflow (gateway)

Langflow is Python-only. Route its underlying LLM calls through the Respan gateway to use 1000+ models from different providers. Only your Respan API key is needed — no separate provider keys required.

Setup

1

Install Langflow

pip install langflow
2

Point Langflow at the gateway

Set the API key environment variable before starting Langflow. Its OpenAI component reads OPENAI_API_KEY by default:

export OPENAI_API_KEY="YOUR_RESPAN_API_KEY"

No real OpenAI key needed. The Respan gateway handles provider authentication. Keep the component’s API key field at its default (OPENAI_API_KEY).

The component does not read OPENAI_BASE_URL. Set the base URL on the component itself in the next step.

3

Start Langflow and build your flow

langflow run

Open the UI and add an OpenAI component to your flow. Expand its advanced settings and set OpenAI API Base to https://api.respan.ai/api. Every run of that component is now routed and logged through Respan.

Run an exported flow programmatically (optional)

run_flow_from_json runs a flow you have already exported from the Langflow UI (Share → Export). Export the flow to a .json file first, then:

from langflow.load import run_flow_from_json
result = run_flow_from_json(
flow="path/to/your/flow.json", # exported from the Langflow UI
input_value="What is the meaning of life?",
)
print(result)

The exported flow keeps the OpenAI API Base value you set on each OpenAI component, so calls still route through Respan.

Switch models

Change the model in your flow’s OpenAI component to another model available through the gateway, for example gpt-5.5 or gpt-5-mini.

See the full model list.