Actions

Learn how to create custom actions by making one or more APIs available to your AI agent. Actions allow agents to integrate external data or interact with the real-world, such as connecting agents to databases, plugging them into your emails, or making them your shopping assistant, all through APIs.

Actions are defined using the OpenAPI specification, which is a standard for describing APIs.

Create a new action

Navigate to Actions in the dashboard. Tap the + New button.

Enter a valid JSON OpenAPI specification into the Schema input. Note: The Authentication feature is not yet functional. This inconvenience is temporary and will become functional soon.

The code block below is an OpenAPI specification example that uses the Coindesk API to get the real-time price of Bitcoin.

{
  "openapi": "3.0.1",
  "info": {
    "title": "CoinDesk Price Index API",
    "description": "An API that provides the current prices for various cryptocurrencies and fiat currencies.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.coindesk.com"
    }
  ],
  "paths": {
    "/v1/bpi/currentprice/{symbol}.json": {
      "get": {
        "summary": "Get current price for a specified currency or cryptocurrency",
        "operationId": "getCurrentPrice",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The symbol for the currency or cryptocurrency to get the price for (e.g., BTC, USD, ETH)"
          }
        ],
        "responses": {
          "200": {
            "description": "Current price for the specified currency or cryptocurrency",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "time": {
                      "$ref": "#/components/schemas/Time"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "bpi": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/components/schemas/CurrencyPrice"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Time": {
        "type": "object",
        "properties": {
          "updated": {
            "type": "string",
            "description": "Human-readable updated time"
          },
          "updatedISO": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 formatted updated time"
          },
          "updateduk": {
            "type": "string",
            "description": "UK formatted updated time"
          }
        },
        "required": ["updated", "updatedISO", "updateduk"]
      },
      "CurrencyPrice": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The currency or cryptocurrency code"
          },
          "rate": {
            "type": "string",
            "description": "The current rate in the specified currency or for the specified cryptocurrency"
          },
          "description": {
            "type": "string",
            "description": "Description of the currency or cryptocurrency"
          },
          "rate_float": {
            "type": "number",
            "description": "The rate as a floating-point number"
          }
        },
        "required": ["code", "rate", "description", "rate_float"]
      }
    }
  }
}

Tap the Save button.

You should now see the custom action you just created. Note: If the OpenAPI specification is invalid, the action will not appear.

Test and confirm your new action works as expected by chatting with your AI agent.

Troubleshooting

If you need help creating a new custom action, please consider joining our Discord community for support.

Last updated