What is FlutterFlow?
FlutterFlow is a visual development platform that enables you to build high-quality, custom, cross-platform applications without extensive coding. By integrating Cerebras’s ultra-fast inference capabilities, you can create beautiful AI-powered apps that:- Build for Scale: Collaborate efficiently to create robust apps that grow with your needs
- Iterate Fast: Rapidly test, refine, and deploy your app, accelerating your development cycle
- Fully Integrate: Access databases, APIs, and custom widgets all in one place
- Deploy Cross-Platform: Launch on iOS, Android, web, and desktop from a single codebase
Prerequisites
Before you begin, ensure you have:- Cerebras API Key - Get a free API key here. This key provides access to Cerebras’s ultra-fast inference models.
- FlutterFlow Account - Visit FlutterFlow and create an account or log in to your existing account.
- Basic FlutterFlow Knowledge - Familiarity with the FlutterFlow Builder interface and basic app development concepts will be helpful.
Configure FlutterFlow with Cerebras
Store your Cerebras API Key securely
- Open your FlutterFlow project in the Builder
- Navigate to the App Values tab in the left sidebar
- Click Add Field to create a new app state variable
- Configure the variable:
- Field Name:
cerebrasApiKey - Type:
String - Persisted: Enable this option (so the API key is remembered even when you close the app)
- Secure Persisted Fields: Enable this option for additional security
- Field Name:
- Enter your Cerebras API key in the Default Value field
Create an API call to Cerebras
- Navigate to the API Calls tab in the left sidebar
- Click Add API Call to create a new API call
- Configure the basic settings:
- API Call Name:
CerebrasCompletion - Method Type:
POST - API URL:
https://api.cerebras.ai/v1/chat/completions
- API Call Name:
- token (String): Your Cerebras API key from App State
- model (String): The Cerebras model to use (e.g.,
llama-3.3-70b) - userMessage (String): The text input from your user
- systemPrompt (String, Optional): System instructions for the model
Configure the API call headers
-
Authorization Header:
- Key:
Authorization - Value:
Bearer [token]The[token]references the variable you defined in the previous step and authenticates your request with Cerebras.
- Key:
-
Integration Tracking Header:
- Key:
X-Cerebras-3rd-Party-Integration - Value:
FlutterFlowThis header helps Cerebras track integration usage and provide better support for FlutterFlow users.
- Key:
Define the request body
In the Body section:- Select JSON as the body type
- Add the following JSON structure:
[model], [userMessage]) will be automatically replaced with the values you pass when calling this API. The stream parameter is set to false for simpler response handling in FlutterFlow."stream": true and handle the response accordingly.Configure the response parsing
- In the Response & Test section, click Add Response
- Create a JSON path to extract the message content:
- Field Name:
responseText - JSON Path:
$.choices[0].message.content - Type:
String
- Field Name:

Use the API call in your app
- Create a page with a text input field for user messages
- Add a button that triggers the API call
- Configure the button’s action:
- Action: Backend Call → CerebrasCompletion
- Set variables:
token: Reference yourcerebrasApiKeyfrom App Statemodel:llama-3.3-70b(or any other Cerebras model)userMessage: Reference your text input fieldsystemPrompt: “You are a helpful assistant.”
- Add a text widget to display the response
- Bind the text widget to the
responseTextfield from your API call response
Available Cerebras Models
You can use any of these high-performance Cerebras models in your FlutterFlow app. Each model offers different capabilities and performance characteristics:| Model | Best For | Speed | Capabilities |
|---|---|---|---|
| llama-3.3-70b | Complex reasoning, long-form content | Fast | Best for complex reasoning, long-form content, and tasks requiring deep understanding |
| qwen-3-32b | General-purpose applications | Very Fast | Balanced performance for general-purpose applications |
| llama3.1-8b | Simple tasks, high throughput | Fastest | Fastest option for simple tasks and high-throughput scenarios |
| gpt-oss-120b | Advanced use cases | Fast | Largest model for the most demanding tasks |
| zai-glm-4.6 | Advanced reasoning | Fast | Advanced 357B parameter model with strong reasoning capabilities |
model variable in your API call to switch between models. We recommend starting with llama-3.3-70b for the best overall experience.
Testing Your Integration
Test in FlutterFlow's Test Mode
- Click the Test button in the top-right corner
- Interact with your app’s UI to trigger the Cerebras API call
- Check the API Call Logs in the bottom panel to see request and response details
- Verify that responses are displayed correctly in your UI
- Test error scenarios by temporarily using an invalid API key
Test on a real device
- Click Run → Test on Device
- Follow the instructions to install the app on your iOS or Android device
- Test the full user experience, including network conditions and performance
- Verify that API responses are fast and the UI remains responsive
Frequently Asked Questions
Can I use Cerebras models for free?
Can I use Cerebras models for free?
How do I implement streaming responses in FlutterFlow?
How do I implement streaming responses in FlutterFlow?
"stream": true in your request body. You’ll need to handle the server-sent events (SSE) format in your response parsing. Consider using custom code or a custom widget to process the streaming data as it arrives. This provides a better user experience for long-form content generation.Can I use multiple Cerebras models in the same app?
Can I use multiple Cerebras models in the same app?
llama3.1-8b for quick responses and llama-3.3-70b for complex reasoning tasks within the same app.How do I handle conversation history for multi-turn chats?
How do I handle conversation history for multi-turn chats?
messages array. This allows the model to maintain context across multiple turns. Be mindful of token limits and consider truncating older messages for very long conversations.What's the difference between Cerebras and other AI providers?
What's the difference between Cerebras and other AI providers?
Can I deploy my FlutterFlow app with Cerebras to production?
Can I deploy my FlutterFlow app with Cerebras to production?
Advanced Configuration
Adding Temperature and Max Tokens Controls
For more control over model outputs, you can add additional parameters to your API call:-
Add new variables to your API call:
- temperature (Double): Controls randomness (0.0 to 2.0, default 1.0)
- maxTokens (Integer): Maximum response length
- Update your request body:
Troubleshooting
API Call Returns 401 Unauthorized
API Call Returns 401 Unauthorized
API Call Times Out
API Call Times Out
- Check your internet connection and network settings
- Verify the API URL is correct:
https://api.cerebras.ai/v1/chat/completions - Try using a faster model like
llama3.1-8bfor quicker responses - Increase the timeout setting in FlutterFlow’s API call configuration
Response Not Displaying
Response Not Displaying
- Verify the JSON path for response parsing is correct:
$.choices[0].message.content - Check the API Call Logs to see if the response is being received
- Ensure your text widget is properly bound to the
responseTextfield - Test the API call independently using the Test API Call button
Model Not Found Error
Model Not Found Error
- Verify you’re using a valid Cerebras model name
- Check the available models documentation for the current list
- Ensure there are no typos in the model name
- Confirm the model you’re trying to use is available in your region
Rate Limiting Issues
Rate Limiting Issues
- Implement exponential backoff for retries (wait 1s, 2s, 4s, etc.)
- Consider caching responses to reduce API calls
- Review your API usage limits in the Cerebras dashboard
- Upgrade to a paid plan if you need higher rate limits
Slow Response Times
Slow Response Times
- Switch to a faster model like
llama3.1-8bfor simpler tasks - Optimize your prompts to be more concise
- Check your network connection quality
- Consider implementing response caching for common queries
Next Steps
Explore FlutterFlow
Model Documentation
FlutterFlow Community
GLM4.6 Migration Guide
Additional Learning Resources
- Cerebras API Reference - Complete API documentation with all available parameters
- OpenAI Compatibility Guide - Learn about OpenAI API compatibility
- FlutterFlow API Integration Guide - Deep dive into API calls in FlutterFlow
- FlutterFlow Templates - Browse pre-built templates to accelerate development
- Prompting Guide - Learn how to write effective prompts for better results

