Skip to main content

FluidAPI: Natural Language API Requests

Join our Discord Subscribe on YouTube Connect on LinkedIn Follow on X.com

Overview

FluidAPI is an enterprise-grade framework that enables natural language interaction with APIs. Eliminate the complexity of JSON formatting, header management, and complex request structures by simply describing your requirements in plain English. FluidAPI automatically handles the rest.

Built on the robust Swarms Framework and developed by Kye Gomez, FluidAPI revolutionizes API integration workflows for enterprise applications.


Key Features

  • Natural Language Processing: Transform natural language descriptions into fully functional API requests
  • AI-Powered Execution: Leverages the Swarms Framework for intelligent and dynamic API handling
  • Seamless Integration: Replace complex API workflows with intuitive, human-readable commands
  • Enterprise Reliability: Built-in retry mechanisms and comprehensive error handling for production environments
  • Dynamic Authentication Management: Automated token management and secure credential injection

Installation

Install the fluid-api-agent package using pip:

pip install fluid-api-agent

Quick Start

Basic Implementation

from fluid_api_agent.main import (
    fluid_api_request,
)

# Basic API Request Example
basic_request = fluid_api_request(
    "Generate an API request to get a random cat fact from https://catfact.ninja/fact"
)

print(basic_request.model_dump_json(indent=4))

Advanced Implementation

from fluid_api_agent.main import (
    fluid_api_request,
    batch_fluid_api_request,
)

# Basic API Request
# Execute a simple API request with default parameters
basic_request = fluid_api_request(
    "Generate an API request to get a random cat fact from https://catfact.ninja/fact"
)
print("\n=== Basic Request ===")
print(basic_request.model_dump_json(indent=4))

# Raw Response Request
# Retrieve unprocessed response data
raw_request = fluid_api_request(
    "Generate an API request to get a random joke from https://official-joke-api.appspot.com/random_joke",
    return_raw=True
)
print("\n=== Raw Request ===") 
print(raw_request.model_dump_json(indent=4))

# Verbose Request Processing
# Enable comprehensive logging during request execution
verbose_request = fluid_api_request(
    "Generate an API request to get weather data for New York from OpenWeatherMap",
    verbose=True
)
print("\n=== Verbose Request ===")
print(verbose_request.model_dump_json(indent=4))

# Custom Documentation Integration
# Enhance request generation with specific API documentation
docs = """
API Endpoint: https://api.example.com/v1/users
Methods: GET, POST
Authentication: Bearer token required
"""
custom_doc_request = fluid_api_request(
    "Generate a request to get all users",
    documentation=docs,
    verbose=True
)
print("\n=== Request with Documentation ===")
print(custom_doc_request.model_dump_json(indent=4))

# Batch Processing
# Execute multiple API requests sequentially
print("\n=== Batch Request ===")
batch_results = batch_fluid_api_request(
    tasks=[
        "Generate an API request to get a random dog fact from https://dogapi.dog/api/v2/facts",
        "Generate an API request to get a random quote from https://api.quotable.io/random",
        "Generate an API request to get Bitcoin price from CoinGecko public API"
    ],
    verbose=True
)
for i, result in enumerate(batch_results, 1):
    print(f"\nBatch Result {i}:")
    print(result.model_dump_json(indent=4))

Execution Flow

FluidAPI executes the following workflow:

  1. Request Interpretation: Analyzes and processes natural language input
  2. API Generation: Constructs appropriate API calls based on requirements
  3. Response Handling: Processes and returns API responses

Additional Examples

Refer to the example.py file for comprehensive usage examples.


Configuration

Environment Variables

FluidAPI utilizes environment variables for secure credential management:

  • OPENAI_API_KEY: Your OpenAI API key for AI-powered request processing

Configure these variables in your .env file:

OPENAI_API_KEY=your-openai-api-key
WORKSPACE_DIR="agent_workspace"

Enterprise Features

Retry Mechanisms

FluidAPI incorporates intelligent retry logic to handle transient failures automatically. Retry configurations can be customized directly within the agent settings.

Performance Optimization

Frequent requests are optimized through intelligent caching mechanisms to enhance performance and reduce API latency.


Development Setup

Repository Cloning

git clone https://github.com/The-Swarm-Corporation/fluidapi.git
cd fluidapi

Dependency Installation

pip install -r requirements.txt

Architecture

FluidAPI leverages the Swarms Framework to provide:

  1. Natural Language Parsing: Advanced NLP capabilities for request interpretation
  2. Dynamic Request Construction: Intelligent API request generation
  3. Intelligent Response Processing: Automated response handling and error management

For comprehensive information about the Swarms Framework, visit here.


Development Roadmap

  • Comprehensive API documentation
  • Unit and integration test suite
  • Extended usage examples
  • Performance benchmarking tools

Contributing

We welcome contributions from the community. To contribute:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request with detailed descriptions

License

FluidAPI is licensed under the MIT License. See the LICENSE file for complete terms and conditions.


Contact Information


Transform your API integration experience. With FluidAPI, complex API workflows become simple, natural language commands.

Metadata

Release files for fluid-api-agent 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fluid-api-agent 0.3.0
File Size Uploaded
fluid_api_agent-0.3.0.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fluid-api-agent 0.3.0
File Interpreter ABI Platform
fluid_api_agent-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.5 kB

Release files / fluid_api_agent-0.3.0.tar.gz

Download URL fluid_api_agent-0.3.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3ab4ae05d310966895f5b1a2f1b5c82f1f47cfd0401bb72f0c6bba87e034f5dd
BLAKE2b-256 checksum
How to use checksums
f21e1752c05e2d377814739416da2eb13b47f6c1c152436501c8d81a9dd41178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.3 Darwin/24.5.0

Release files / fluid_api_agent-0.3.0-py3-none-any.whl

Download URL fluid_api_agent-0.3.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3fe873fcede3aa188a18335e5f0d280e736e1500adc84a224abf3ebd67061f2
BLAKE2b-256 checksum
How to use checksums
71ef7ca00761275ad586697ed775e0386b9ae59d84dc246316c2c9ae54c0a0bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.3 Darwin/24.5.0

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page