Workflows
Blocks
Tools
API Tool

API Tool Block

What it does: Give AI agents the ability to call external APIs, enabling them to fetch data, perform actions, or integrate with any web service.

🌐

In simple terms: The API Tool turns any web service into a capability your AI can use. Need to check weather, look up stock prices, or send data to another platform? Create an API Tool and your AI assistant can do it automatically.

When to Use This

Use API Tools when you need:

  • ✅ AI agents to fetch real-time data from web services
  • ✅ Integration with external platforms
  • ✅ Automated actions in third-party systems
  • ✅ Data retrieval during AI conversations
  • ✅ Workflow automation across different services

Example: Create an API Tool that checks weather, so when a customer asks "What's the weather in New York?", your AI can actually look it up and respond with current conditions.

Key Features

  • Flexible Methods: Support for GET, POST, PUT, DELETE and other HTTP methods
  • Authentication: Handle API keys, tokens, and OAuth
  • Dynamic Parameters: Pass values from conversation to API calls
  • Response Handling: AI interprets and uses API responses
  • Error Management: Graceful handling when APIs are unavailable

How API Tools Work

  1. You configure the API: Define the endpoint and authentication
  2. You describe the tool: Tell AI what this API is for
  3. AI recognizes need: During conversation, AI sees when to use the tool
  4. API is called: Parameters from conversation are sent to the API
  5. Response flows back: AI uses the data to answer the user

Setup Guide

Step 1: Define Basic Information

Give your API Tool a clear identity:

  • Name: Short identifier (e.g., "get_weather")
  • Description: What this API does and when to use it

Step 2: Configure the Endpoint

Set up the API connection:

SettingWhat It Means
URLThe API endpoint address
MethodHTTP method (GET, POST, etc.)
HeadersAdditional info like API keys
AuthenticationHow to prove you're authorized

Step 3: Define Parameters

Specify what information can be sent to the API:

  • Parameter name: What the API expects (e.g., "city")
  • Type: What kind of data (text, number, etc.)
  • Description: What this parameter is for
  • Required: Whether it must be provided

Step 4: Configure Response

Tell the tool what to expect back:

  • Response format: Usually JSON
  • Key fields: Which data points are important
  • Error handling: What to do if the call fails

Common Use Cases

Weather Information

Fetch current conditions, forecasts, or alerts for any location based on user queries.

Product Lookup

Search external catalogs or databases to find product information, pricing, or availability.

Payment Processing

Initiate payment actions through payment gateway APIs during transactions.

Shipping and Tracking

Look up delivery status, calculate shipping rates, or create shipments.

Data Enrichment

Enhance user-provided information with data from external sources.

Social Media Actions

Post updates, fetch feeds, or interact with social platforms.

Authentication Options

API Key

Most common method. Include your API key in headers or query parameters.

Bearer Token

Use OAuth tokens for services requiring user authorization.

Basic Auth

Username and password combination for simple authentication.

Custom Headers

Some APIs require specific header formats for authentication.

What You Get Back

After the API Tool runs:

  • Response Data: The information returned by the API
  • Status: Whether the call succeeded or failed
  • Formatted Result: Data ready for AI to use in responses

Tips for Success

  1. Write clear descriptions - Help AI understand when to use this API
  2. Document parameters well - AI needs to know what to pass
  3. Handle errors gracefully - APIs sometimes fail; plan for it
  4. Test with real data - Verify the tool works before deployment
  5. Monitor API limits - Stay within rate limits to avoid blocks

Troubleshooting

ProblemLikely CauseSolution
Authentication failedWrong credentialsVerify API key or token
Connection timeoutAPI slow or unreachableCheck API status, add timeout handling
Wrong data returnedParameter mapping issuesVerify parameter names match API docs
Rate limitedToo many requestsAdd delays or caching
AI doesn't use toolDescription unclearRewrite to be more specific

Best Practices

  • Secure credentials - Never expose API keys in descriptions
  • Use environment variables - Store sensitive data securely
  • Cache when possible - Reduce redundant API calls
  • Set reasonable timeouts - Don't hang on slow APIs
  • Log API calls - Track usage for debugging and optimization
  • Plan for failure - Always have a fallback response
Indite Documentation v1.4.0
PrivacyTermsSupport