API Access
You can access your flow programmatically using REST API calls. LLM Controls supports integration using Python, JavaScript (fetch), and cURL.
Generating Your API Key
To authenticate API requests, you need a valid LLM Controls API key. Follow the steps below to create one:- Go to the Settings panel in your LLM Controls dashboard.
- In the left sidebar, click on “LLM Controls API Keys”.
- Click the “Add New” button in the top-right corner.
- Give your key a name (e.g., my_project_key) and save it.
- Your new API key will appear in the list. Make sure to copy it immediately ,this is the only time it will be fully visible.
ImportantKeep your API key secure. Do not expose it in frontend code or share it publicly. Use environment variables or server-side storage to manage keys safely. Once created, you can use this key in your API requests by setting it as the x-api-key header.
How to Use the API
Depending on your preferred language, follow the example below- Python
- Javascript
- curl
Temporary Overrides
Each flow has customizable input parameters that you can override:- These input fields are part of the payload (e.g. input_value)
- You can override them via the API or directly through the UI
- To add more override options, add input boxes in the UI and connect them to relevant components
Overrides are not persistent, but they are applied to that particular API run.
Execution Modes: Static vs. Polling
LLM Controls lets you run flows in two modes based on your needs: Static (synchronous) or Polling (asynchronous). You can control this using the sync query parameter in the URL.Overview
Static Mode (stream=false)
In static mode, the API waits for the full result before returning the response. When to use:- Short or fast-executing flows
- Real-time user interaction (e,.g. chat widgets)
Polling Mode (sync=false)
In polling mode, the API returns immediately with a task_id and task_url. You must poll this URL to retrieve the final result once it’s ready. When to use:- Long-running flows
- Flows that perform multi-step background operations
- When using external data sources or embeddings
Best Practices
- Use static mode for user-facing interactions.
- Use polling mode when a flow takes more than 10 seconds.
- Always check status in polling responses (PENDING, RUNNING, COMPLETED, FAILED).
Embed into Site
You can embed your flow as a chat widget or a full-screen application.Features:
- Supports two-way communication between frontend and backend
- Can be embedded in HTML, React, or other frontend frameworks
- Full control over the input/output elements
- Styling customization available (light/dark themes, widget position)