Connect Retool to DeepAI using a REST API Resource with your DeepAI API key passed as an api-key header. Point the resource at https://api.deepai.org and build queries against DeepAI's image generation, text summarization, and sentiment analysis endpoints. The result is an internal AI tool panel that lets team members run image processing and text analysis tasks without ML infrastructure or custom code.
| Fact | Value |
|---|---|
| Tool | DeepAI |
| Category | AI/ML |
| Method | REST API Resource |
| Difficulty | Beginner |
| Time required | 15 minutes |
| Last updated | April 2026 |
Build an Internal AI Tool Panel in Retool Using DeepAI
DeepAI offers one of the simplest AI API experiences available — single-purpose endpoints that accept text or images and return processed results without requiring model configuration, prompt engineering expertise, or ML infrastructure. For operations and content teams that need quick AI-powered capabilities (summarizing support tickets, analyzing customer sentiment in feedback, generating placeholder images for content), a Retool interface connected to DeepAI's API provides a zero-complexity internal tool.
DeepAI's API catalog covers a wide range of single-task capabilities: text summarization (condenses long text into a brief summary), sentiment analysis (returns positive, neutral, or negative with a confidence score), image generation (creates images from text prompts using Stable Diffusion), image upscaling (enhances image resolution), image colorization (adds color to grayscale images), content moderation (detects explicit content), and several others. Each endpoint has its own URL and accepts either text or image data in a simple form request. This simplicity makes DeepAI an excellent choice for internal tools where the team needs AI assistance without the complexity of larger AI platforms.
The most productive Retool use case for DeepAI is a multi-function AI assistant panel — a single Retool app with a Tab component where each tab provides a different AI capability. The team can paste customer feedback text into the Sentiment tab, paste long articles into the Summarize tab, and generate placeholder images in the Image Generation tab, all from one internal interface. Because Retool handles the API calls server-side, the team gets access to AI capabilities without needing API keys themselves.
Integration method
DeepAI's API uses a straightforward API key header for authentication — every request includes api-key as a header value. Retool connects via a REST API Resource with the base URL https://api.deepai.org, passing the API key as a default header. Because Retool proxies all requests server-side, the DeepAI API key never reaches the browser. DeepAI's APIs accept multipart form data (for image inputs) or JSON (for text inputs) and return JSON responses with output URLs or processed results. JavaScript transformers format the API responses for display in Retool's Image and Text components.
Prerequisites
- A DeepAI account (free tier available at deepai.org with rate-limited API access)
- Your DeepAI API key from the DeepAI dashboard (Settings or Profile → API Key section)
- A Retool account with permission to create Resources
- Basic understanding of REST API calls with header-based authentication
- Familiarity with which DeepAI endpoints your use case requires (text, image, or both)
Step-by-step guide
Obtain your DeepAI API key
DeepAI provides a free tier that includes access to all API endpoints with rate limiting — no credit card is required for initial access. To get your API key, navigate to deepai.org and create a free account if you do not already have one. After signing in, click on your profile icon or navigate to the Dashboard section. Your API key is displayed on the Dashboard or under Account Settings. DeepAI's API keys are long alphanumeric strings. Copy the key value. Unlike some API platforms, DeepAI API keys do not expire and do not require periodic rotation. The API key is passed as a request header named api-key (lowercase, hyphenated) on every request — not in an Authorization: Bearer header. This is an important distinction when configuring the Retool resource, as you will add it as a custom header rather than selecting the Bearer Token authentication type. Immediately store your DeepAI API key in a Retool Configuration Variable: in Retool, navigate to Settings → Configuration Variables, click Add Variable, name it DEEPAI_API_KEY, paste the key value, and check the 'Is Secret' checkbox to prevent it from appearing in query logs or being accessible on the frontend. The free tier allows up to 5,000 requests per month with standard latency. For higher volumes, DeepAI offers paid plans at monthly flat rates. Note the specific API limitations for your tier — image generation endpoints typically consume more credits per call than text analysis endpoints.
Pro tip: DeepAI's free tier is sufficient for building and testing an internal tool panel for small teams. For production use with heavy usage, upgrade to a paid plan and monitor consumption in the DeepAI dashboard to avoid hitting monthly limits during critical operations periods.
Expected result: A DeepAI API key is obtained and stored as a secret Configuration Variable named DEEPAI_API_KEY in Retool.
Configure the REST API Resource in Retool
In Retool, navigate to the Resources tab and click Add Resource. Select REST API from the resource type list. Name the resource 'DeepAI API'. Set the Base URL to https://api.deepai.org. For authentication, do NOT select 'Bearer Token' — DeepAI uses a custom header name. Instead, scroll to the Headers section and add a custom header: Name → api-key, Value → {{ retoolContext.configVars.DEEPAI_API_KEY }}. Add a second header: Content-Type → application/json. This Content-Type header applies to JSON body requests; for image upload requests that use multipart form data, you will need to override or remove this header in individual queries. Click Save Resource. To test the resource, create a query in a new Retool app: set Method to POST and Path to /1.0/text-to-image. In the Body section, select Form Data type and add a field: text → a test prompt like 'sunset over mountains'. Click Preview. A successful response returns a JSON object with an output_url field containing the URL of the generated image. If you receive a 403 error, the api-key header is missing or the key value is incorrect. If you receive a 200 response with the output_url, your resource is correctly configured and ready for building queries.
Pro tip: DeepAI's API key header must be named exactly api-key (lowercase, hyphen-separated). Using Authorization: Bearer or x-api-key as the header name will cause authentication to fail silently or return a 403 response. Double-check the header name in your resource configuration.
Expected result: The DeepAI API resource is configured in Retool with the api-key header. A test text-to-image POST request returns a JSON response with an output_url pointing to a generated image.
Build text analysis queries for summarization and sentiment
Create queries for DeepAI's text processing endpoints. Create a query named 'summarizeText'. Set Method to POST and Path to /1.0/summarization. For the Body, select Form Data and add a field: text → {{ textInputArea.value }}. The DeepAI summarization API accepts plain text and returns a JSON object with an output field containing the summarized text. Create a transformer that extracts the output field and trims whitespace. Create a second query named 'analyzeSentiment'. Set Method to POST and Path to /1.0/sentiment-analysis. Body: Form Data with field text → {{ textInputArea.value }}. DeepAI's sentiment analysis returns a JSON object with an output field containing a string like 'Positive', 'Negative', or 'Neutral', and sometimes additional detail about detected sentiment categories. Create a transformer that parses the output field and adds a color property based on the sentiment value: 'green' for Positive, 'red' for Negative, 'gray' for Neutral. These color values can be used in Retool's Tag component to show color-coded sentiment labels. Note that both the summarization and sentiment analysis endpoints accept text input via form data, not JSON — ensure your query body type is set to Form Data (multipart/form-data), not JSON. Using JSON body format with DeepAI's text endpoints is a common configuration mistake.
1// Transformer: parse and enrich DeepAI sentiment response2const output = data.output || '';3const sentimentText = output.trim();45const SENTIMENT_COLORS = {6 'Positive': 'green',7 'Negative': 'red',8 'Neutral': 'gray',9 'Mixed': 'yellow'10};1112// Find the primary sentiment label13const detectedSentiment = Object.keys(SENTIMENT_COLORS).find(s =>14 sentimentText.toLowerCase().includes(s.toLowerCase())15) || 'Unknown';1617return {18 raw: sentimentText,19 sentiment: detectedSentiment,20 color: SENTIMENT_COLORS[detectedSentiment] || 'gray',21 is_positive: detectedSentiment === 'Positive',22 is_negative: detectedSentiment === 'Negative'23};Pro tip: DeepAI's text endpoints require the body to be sent as multipart form-data, not JSON. In Retool's query editor, explicitly set the Body type to 'Form Data' for these queries. If you see the error 'No text provided', the text field is not reaching the API — verify the body type and field name are correct.
Expected result: The summarizeText query returns a condensed summary of the input text, and the analyzeSentiment query returns a sentiment label with an associated color for display.
Build image generation and processing queries
Create queries for DeepAI's image-based endpoints. Create a query named 'generateImage'. Set Method to POST and Path to /1.0/text2img (DeepAI's standard image generation endpoint — verify the current endpoint path in DeepAI's documentation as it may be /1.0/text-to-image or /1.0/stable-diffusion depending on which model you want). Body: Form Data with field text → {{ imagePromptInput.value }}. The response includes an output_url field containing a direct URL to the generated image hosted on DeepAI's CDN. Create a query named 'upscaleImage'. Set Method to POST and Path to /1.0/waifu2x. Body: Form Data with field image_url → {{ imageUrlInput.value }} (the URL of an image to upscale) or upload a file using the image field type in Form Data for direct upload. The upscaled image URL is also returned in output_url. For image colorization, create a query named 'colorizeImage' with Path /1.0/colorizer and the same image_url parameter. Create a JavaScript query named 'saveGenerationToHistory'. This runs after generateImage succeeds and inserts a record into Retool Database with the prompt text, generated image URL, endpoint used, and current timestamp — building a history log of all AI generations. Configure the generateImage query's On Success event handler to trigger saveGenerationToHistory automatically.
1-- SQL: Insert generation into history table in Retool Database2INSERT INTO deepai_generations (3 prompt,4 output_url,5 endpoint,6 generated_at7) VALUES (8 {{ imagePromptInput.value }},9 {{ generateImage.data.output_url }},10 'text2img',11 NOW()12);Pro tip: For complex Retool AI tool panels combining DeepAI's single-purpose APIs with OpenAI's conversational capabilities and custom ML model endpoints, RapidDev's team can help architect a comprehensive internal AI workstation for your operations team.
Expected result: The generateImage query returns an image URL that displays in Retool's Image component, and generation history is automatically saved to Retool Database for future reference.
Assemble the AI tool panel UI
Build the complete multi-function AI tool panel in Retool using a Tab component to organize different AI capabilities. Create a Tab component with three or more tabs: 'Text Analysis', 'Image Generator', and 'Image Tools'. In the Text Analysis tab: add a Text Area component named 'textInputArea' with placeholder text and a max length note, a row of two buttons ('Summarize' and 'Analyze Sentiment'), and two result containers below. The Summarize result container shows the summarizeText.data output in a formatted Text component that becomes visible after the query runs. The Sentiment result container shows a Tag component with color bound to {{ analyzeSentiment.data.color }} and label bound to {{ analyzeSentiment.data.sentiment }}, plus the raw output below. Wire the Summarize button's onClick event to trigger summarizeText, and the Analyze Sentiment button to trigger analyzeSentiment. In the Image Generator tab: add a Text Input named 'imagePromptInput' with placeholder 'Describe the image you want to generate', a Generate button that triggers generateImage, an Image component with src bound to {{ generateImage.data.output_url }}, and a Table below showing generation history from Retool Database. Add a copy-to-clipboard button next to the image using Retool's copy icon action. In the Image Tools tab: add a Text Input for image URL input, two buttons ('Upscale' and 'Colorize'), and a before/after image comparison showing the original URL and the processed result URL. Add loading states to all buttons using Retool's loading property bound to the corresponding query's isFetching state.
Pro tip: Bind each action button's disabled property to {{ textInputArea.value.trim().length === 0 }} for text buttons and {{ imagePromptInput.value.trim().length === 0 }} for image generation. This prevents submitting empty requests to the DeepAI API, which would return error responses and waste API quota.
Expected result: A complete multi-tab AI tool panel allows team members to summarize text, analyze sentiment, generate images from prompts, and process existing images — all through a single Retool interface without needing API keys.
Common use cases
Build a text analysis workstation for the content and support team
Create a Retool panel with tabs for text summarization and sentiment analysis. Team members paste text into a Text Input area and click the appropriate action button — the result appears immediately below. The Summarize tab condenses long product documentation or customer emails into key points. The Sentiment tab analyzes customer feedback text and returns positive/neutral/negative classification with a confidence score. Both tabs run queries against DeepAI's API endpoints and display results using Retool's Text and Stat components.
Build a Retool text analysis tool using DeepAI. Create two tabs: Summarize and Sentiment. In Summarize tab: a Text Area input for pasting text and a Summarize button. Show the summary result in a formatted Text component. In Sentiment tab: a Text Area and Analyze button. Show the sentiment label (Positive/Neutral/Negative) as a color-coded Tag and the confidence score as a Stat.
Copy this prompt to try it in Retool
Build an AI image generation panel for the marketing team
Create a Retool app that lets the marketing team generate AI images by entering text prompts. Include a prompt input field, a Generate button, and an Image component that displays the generated result. Store a history of generated images and their prompts in a Retool Database table so the team can review and revisit past generations. Add a copy URL button for easy sharing of generated images.
Build a Retool AI image generator using DeepAI's text-to-image API. Show a Text Input for the image prompt, a Generate button, and an Image component displaying the result. Below, show a Table of previous generations with prompt text, image URL (as a thumbnail), and generation date. Add a Copy URL button for each row.
Copy this prompt to try it in Retool
Build a content moderation and image quality screening tool
Create a Retool tool for the trust and safety team that accepts an image URL as input and runs it through DeepAI's content moderation endpoint. Display the moderation results — NSFW score, content categories flagged, and a pass/fail determination — alongside the image preview. Track moderation results for images in a Retool Database table for audit trail purposes.
Build a Retool content moderation tool using DeepAI. A URL input accepts an image URL to check. A Check button runs the moderation query. Show the image in a preview panel alongside the moderation result: NSFW score (0-1), content categories detected, and a clear Pass (green) or Flag (red) verdict. Log each check to a Retool Database table with image URL, result, and timestamp.
Copy this prompt to try it in Retool
Troubleshooting
403 Forbidden — 'Invalid API Key' on all DeepAI requests
Cause: The api-key request header is either missing from the Retool resource configuration, contains a typo, or references an incorrect Configuration Variable name.
Solution: Open the Retool resource settings and verify the custom header is named exactly api-key (lowercase, with a hyphen, no space). Confirm the value references the correct Configuration Variable name: {{ retoolContext.configVars.DEEPAI_API_KEY }}. Go to Settings → Configuration Variables and verify the variable exists with the correct API key value. Test by temporarily hardcoding the API key directly in the header value (not the Configuration Variable reference) to isolate whether the issue is with the variable reference or the key itself.
'No text provided' error when running text summarization or sentiment queries
Cause: The text field in the query body is not reaching the DeepAI API because the body type is set to JSON instead of Form Data, or the field name does not match DeepAI's expected parameter name.
Solution: In the query editor, verify the Body type is set to 'Form Data' (multipart/form-data), not 'JSON' or 'Raw'. The field name must be exactly text (lowercase, no quotes in the field name itself). Verify that the textInputArea component has a non-empty value by checking {{ textInputArea.value }} in the query preview parameters. DeepAI's text endpoints do not accept JSON body format — only form data.
Generated image URL expires and the Image component shows a broken image
Cause: DeepAI hosts generated images on their CDN with a limited lifetime — typically 24 hours. Image URLs become invalid after this window, causing the Image component to show a broken image state.
Solution: Save generated image URLs to Retool Database immediately after generation using the saveGenerationToHistory query. For long-term storage, create a Retool Workflow that downloads the image content from the DeepAI URL and uploads it to a permanent storage location (Retool Storage, AWS S3, or Supabase Storage) before the URL expires. Update the database record with the permanent storage URL after the upload completes.
Image generation is slow or times out — query returns no result after 30+ seconds
Cause: DeepAI's image generation endpoints have variable latency depending on server load. Free tier requests may queue behind paid tier requests, resulting in longer wait times during peak usage periods.
Solution: Increase the query timeout setting in Retool: in the query's Advanced tab, set a timeout of 120000ms (2 minutes) to give image generation queries enough time to complete. Show a loading indicator while the query is running using the isFetching state. If timeouts persist on the free tier, consider upgrading to a paid DeepAI plan for priority processing, or evaluate whether a different image generation API with more predictable latency better serves your use case.
Best practices
- Store the DeepAI API key in a Retool Configuration Variable marked as secret — the API key grants access to your paid API quota and should never be exposed in query logs or browser-accessible JavaScript
- Add input validation to all text fields before triggering DeepAI queries — disable submit buttons when inputs are empty using {{ textInputArea.value.trim().length === 0 }}, preventing wasted API calls on blank submissions
- Save all DeepAI generation outputs (image URLs, text analysis results) to a Retool Database table with a timestamp and the user's Retool username — this creates an audit trail and allows the team to retrieve and reuse previous results
- Set appropriate query timeouts for image generation endpoints (120 seconds minimum) since DeepAI's AI processing time varies by endpoint and server load — the default 10-second timeout is too short for image generation
- Display loading states on action buttons while DeepAI queries are running using Retool's isFetching state — processing time ranges from 2-30 seconds and users need visual feedback that the request is in progress
- Use Retool's rate limit handling by adding a cooldown period between rapid successive generations — if team members click Generate repeatedly, implement a disabled state that persists for 5 seconds after each generation to prevent accidental quota consumption
- For the sentiment analysis endpoint, normalize the output text before displaying it since DeepAI may return different formats or capitalization across versions — use a transformer to standardize to 'Positive', 'Negative', 'Neutral' labels
- Test each DeepAI endpoint individually in the Retool query editor before assembling the full UI — endpoint paths and response formats occasionally change between API versions, and per-endpoint testing makes it easier to isolate issues
Alternatives
OpenAI's GPT models offer conversational AI, advanced reasoning, and flexible text generation beyond DeepAI's single-purpose APIs — choose OpenAI if your team needs chat-based interactions, code generation, or more sophisticated language understanding.
H2O.ai provides AutoML and custom model training capabilities for data science teams — choose H2O.ai if your team needs to build and deploy custom ML models rather than consume pre-built single-purpose AI APIs.
Google Cloud AI Platform provides enterprise-grade ML services with Vertex AI for custom model deployment and Google's pre-built APIs for vision, speech, and NLP — choose Google Cloud if you need enterprise SLAs, custom model hosting, or tighter Google ecosystem integration.
Frequently asked questions
Does Retool have a native DeepAI connector?
No, Retool does not have a native DeepAI connector. You connect via a REST API Resource using DeepAI's simple api-key header authentication. The setup takes about 15 minutes and is one of the simplest API integrations available in Retool — no OAuth flows, no token refresh, and no complex header signatures. Just a static API key in a custom header.
What DeepAI endpoints are most useful for internal Retool tools?
The most commonly used DeepAI endpoints for internal tools are: text summarization (/1.0/summarization) for condensing long documents or customer messages, sentiment analysis (/1.0/sentiment-analysis) for customer feedback triage, text-to-image generation (/1.0/text2img) for placeholder image creation, and content moderation (/1.0/nsfw-detector) for content screening workflows. DeepAI also offers image upscaling, colorization, and several other specialized endpoints documented at deepai.org/api.
Are DeepAI's free tier API limits sufficient for a Retool internal tool?
DeepAI's free tier includes 5,000 API calls per month across all endpoints. For a small team using the tool occasionally for text analysis and image generation, this is typically sufficient for initial deployment and testing. For production use with multiple team members making regular calls, monitor your usage in the DeepAI dashboard and upgrade to a paid plan before hitting the monthly limit to avoid service interruptions.
How long do DeepAI generated images remain accessible?
DeepAI hosts generated images on their CDN for a limited period — typically 24 hours from generation time. After expiry, the URL becomes invalid. For long-term storage, save the image URL immediately after generation and download the image content to a permanent storage location such as Retool Storage, AWS S3, or Supabase Storage. Use a Retool Workflow triggered on successful image generation to handle the download and re-upload automatically.
Can I use DeepAI endpoints that require image file uploads rather than URLs?
Yes. For endpoints that accept file uploads (rather than image URLs), configure the Retool query body as Form Data and use a File Upload component as the input. Bind the image field in the query body to the uploaded file component's value. Retool supports binary file data in Form Data requests, allowing users to upload images directly from their browser to DeepAI's API through Retool's server-side proxy.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation