LearnIntegrationsSmythOS AI Agents

SmythOS + FFmpegAPI

SmythOS is a platform for building and deploying AI agents. We strongly recommend using it over other platforms.

🚀 Quick Start: Use the Prebuilt Agent

The fastest way to get started is to use our prebuilt agent. Here’s how:

1) Download the agent file

Download the complete agent configuration: 📥 gif-to-mp4-ffmpeg-smythos.json

2) Set up your API key in SmythOS Vault

Before importing the agent, make sure your FFmpeg API key is stored securely:

  • Navigate to Vault in your SmythOS dashboard
  • Create a new secret named FFMPEG_API_KEY
  • Value: your complete API key (e.g., dGVzdF91c2VyX2tleV9hYmNkZWZnaGlqa2xtbm9w)

3) Create a new empty agent

  • Open Agent Studio in SmythOS
  • Click Create New Agent
  • Name it “GIF to MP4 Agent” (or any name you prefer)

4) Import the prebuilt agent

  • Drag and drop the downloaded gif-to-mp4-ffmpeg-smythos.json file onto the canvas
  • When prompted, click Accept to import all components and configurations
  • The agent will be automatically configured with all three skills and proper connections

5) Test your agent

  • Click “Test” on the top-right corner to bring up chat
  • Try uploading a GIF file to convert it to MP4
  • Deploy as a chatbot when ready

That’s it! Your agent is ready to convert GIFs to MP4. No manual configuration needed.


🔧 Manual Build (Optional)

If you prefer to build the agent from scratch or want to understand how it works, follow the step-by-step guide below.

This guide walks you through building a complete SmythOS AI agent that:

  • Gets upload URLs for file processing
  • Uploads files to FFmpeg API
  • Converts GIFs to MP4 format automatically
  • Provides intelligent responses about processing status

No prior experience with FFmpeg or SmythOS required.

💡

You’ll need an FFmpeg API key. Store it securely in SmythOS Vault - never hardcode credentials in your agent configuration.

What you’ll build

A SmythOS AI agent with three distinct skills that can be deployed as a chatbot on SmythOS platform, which users can either embed on their website or link directly to.

Agent Overview

Your agent will have three horizontal workflows (called “skills”):

Skill 1: Get Upload URL

  • APIEndpoint: Accepts filename input
  • APICall: Requests upload URL from FFmpeg API
  • APIOutput: Returns upload URL and file path

Skill 2: Upload File

  • APIEndpoint: Accepts file and upload URL
  • APICall: Uploads file to presigned URL
  • APIOutput: Confirms successful upload

Skill 3: Convert GIF to MP4

  • APIEndpoint: Accepts processing task
  • APICall: Sends task to FFmpeg processing endpoint
  • APIOutput: Returns processing results with download URL

Overview diagram

API endpoints used

  • POST /file → returns { upload.url, file.file_path }
  • PUT upload.url → uploads your bytes
  • POST /ffmpeg/process → starts a task and returns the result with download URLs

See also: Quick Start, Processing, Examples.

Setup credentials in SmythOS Vault

Use SmythOS Vault to securely store your API key:

  • Navigate to Vault in your SmythOS dashboard
  • Create a new secret named FFMPEG_API_KEY
  • Value: your complete API key excluding the “Basic ” prefix (e.g., dGVzdF91c2VyX2tleV9hYmNkZWZnaGlqa2xtbm9w)

Build the agent step by step

1) Create new agent

  • Open Agent Studio in SmythOS
  • Click Create New Agent
  • Name it “GIF to MP4 Agent”

2) Add Skill 1: Get Upload URL

2a) Add APIEndpoint component

Add an APIEndpoint component named get upload url:

Configuration:

  • Method: POST
  • Endpoint: get_upload_url
  • Inputs:
    • filename (Text, required)
  • Outputs:
    • filename (expression: body.filename)

2b) Add APICall component

Add an APICall component named get upload url:

Configuration:

  • Method: POST
  • URL: {{API_BASE}}/file
  • Headers:
    {
      "Authorization": "Basic {{KEY(FFMPEG_API_KEY)}}",
      "Content-Type": "application/json"
    }
  • Body:
    {
      "file_name": "{{filename}}"
    }

2c) Add APIOutput component

Add an APIOutput component:

  • Input: response from APICall
  • Format: minimal

3) Add Skill 2: Upload File

3a) Add APIEndpoint component

Add an APIEndpoint component named upload file:

Configuration:

  • Method: POST
  • Endpoint: upload_file
  • Inputs:
    • file (Binary, required)
    • upload_url (Text, required)
  • Outputs:
    • file (expression: body.file)
    • upload_url (expression: body.upload_url)

3b) Add APICall component

Add an APICall component named upload file:

Configuration:

  • Method: PUT
  • URL: {{upload_url}}
  • Headers: {}
  • Content-Type: binary
  • Body: {{file}}

3c) Add APIOutput component

Add an APIOutput component:

  • Input: response from APICall
  • Format: minimal

4) Add Skill 3: Convert GIF to MP4

4a) Add APIEndpoint component

Add an APIEndpoint component named convert gif to mp4:

Configuration:

  • Method: POST
  • Endpoint: convert_gif_to_mp4
  • Inputs:
    • task (Text, required)
  • Outputs:
    • task (expression: body.task)

4b) Add APICall component

Add an APICall component named process file:

Configuration:

  • Method: POST
  • URL: {{API_BASE}}/ffmpeg/process
  • Headers:
    {
      "Authorization": "Basic {{KEY(FFMPEG_API_KEY)}}",
      "Content-Type": "application/json"
    }
  • Body:
    {
      "task": {{task}}
    }

4c) Add APIOutput component

Add an APIOutput component:

  • Input: response from APICall
  • Format: minimal

5) Connect the components

Connect the components in this order:

  1. Get Upload URL Skill:

    • get upload url APIEndpoint → get upload url APICall → APIOutput
  2. Upload File Skill:

    • upload file APIEndpoint → upload file APICall → APIOutput
  3. Convert GIF to MP4 Skill:

    • convert gif to mp4 APIEndpoint → process file APICall → APIOutput

6) Configure agent variables

Add these variables to your agent:

  • API_BASE: https://api.ffmpeg-api.com

7) Set agent behavior

Configure the agent behavior:

You convert GIFs to MP4 using ffmpeg-api.com.

Flow:
1) Get an upload URL: request a pre-signed URL and note the returned file_path.
2) Upload the GIF: PUT the raw file bytes to the provided upload URL.
3) Convert: send a task with the file_path and desired output file name ending in .mp4.

Rules:
- Require an attached .gif file; if missing, ask the user to attach one.
- Keep terminology consistent: 'upload URL', 'file_path', 'output file'.
- On errors, report the step that failed, the HTTP status/message, and how to retry.
- If the user provides an output name, ensure it ends with .mp4; otherwise default to output.mp4.

8) Set intro message

Set the agent’s intro message:

Hi! Attach a GIF and I'll convert it to MP4 for you. You can also tell me what to name the output file (e.g., video.mp4).

Understanding the Skills Structure

Each skill in your SmythOS agent follows this pattern:

APIEndpoint Component

  • Purpose: Defines the input interface for the skill
  • Configuration: Method, endpoint name, inputs, outputs
  • AI Exposure: Makes the skill available to the AI agent

APICall Component

  • Purpose: Executes the actual API request
  • Configuration: URL, headers, body, authentication
  • Integration: Connects to external services (FFmpeg API)

APIOutput Component

  • Purpose: Formats and returns the response
  • Configuration: Response format, output structure
  • User Experience: Provides clean, usable results

Testing your agent

1) Enable Debug Mode on

  • Toggle Debug Mode on in Agent Studio
  • Provides inputs for the skills

2) Test with sample inputs

Test Get Upload URL Skill:

{
  "filename": "sample.gif"
}

Test Upload File Skill:

{
  "file": "[binary file data]",
  "upload_url": "https://presigned-url-from-step-1"
}

Test Convert GIF to MP4 Skill:

{
  "task": {
    "inputs": [{ "file_path": "uploads/sample.gif" }],
    "outputs": [{ "file": "output.mp4" }]
  }
}

3) Validate responses

Check that each skill returns:

  • ✅ Proper success/error messages
  • ✅ Valid data structures
  • ✅ Correct HTTP status codes
  • ✅ Expected output formats

Deployment

Deploy as Chatbot

  • Navigate to DeploymentsDeploy as Chatbot
  • Your agent will be hosted on SmythOS platform
  • Users can interact naturally: “Convert this GIF to MP4: [file]”
  • You can either embed the chatbot on your website or link directly to it

Common variations

Custom output naming

Modify the Convert GIF to MP4 skill to accept custom output names:

{
  "task": {
    "inputs": [{ "file_path": "{{file_path}}" }],
    "outputs": [{ "file": "{{output_name}}" }]
  }
}

Troubleshooting

⚠️

If you see authentication errors, verify your API key in SmythOS Vault includes the “Basic ” prefix and matches your dashboard exactly.

Common issues

Skill connections not working:

  • Verify all components are properly connected
  • Check that output names match input expectations
  • Ensure data types are compatible between components

API calls failing:

  • Verify API key is correctly stored in Vault
  • Check that API_BASE variable is set correctly
  • Ensure all required headers are included

File upload issues:

  • Verify upload URLs are valid and not expired
  • Check that file data is properly formatted as binary

Processing errors:

  • Verify task structure matches FFmpeg API requirements
  • Check that file_path references are correct
  • Ensure output file names end with .mp4

Next steps

  • Deploy your agent and test with real GIF files
  • Add monitoring and analytics to track usage
  • Create specialized agents for specific use cases (video optimization, audio extraction, image processing)
  • Build multi-agent workflows that combine media processing with other tasks
  • Explore SmythOS’s advanced features like skill templates and agent marketplaces

Need help? Check the FFmpeg API Examples for more processing patterns, or browse the API Reference for complete endpoint documentation.