APIs

Connect to any REST API with flexible authentication. Make HTTP requests to external services directly from your conversations.

REST API Sources

API sources allow TorlyAI to make HTTP requests to external services. This is useful for integrating with services that don't have MCP servers but provide REST APIs.

Authentication Types

API Key

Send an API key in a header or query parameter.

Bearer Token

Send a bearer token in the Authorization header.

OAuth 2.0

Use OAuth for services requiring user authorization.

Basic Auth

Username and password authentication.

Adding an API Source

  1. Click SourcesAdd Source
  2. Select API
  3. Enter the base URL for the API
  4. Configure authentication
  5. Optionally define available endpoints
  6. Test the connection

Example Configuration

{
  "type": "api",
  "slug": "my-api",
  "name": "My API",
  "baseUrl": "https://api.example.com/v1",
  "auth": {
    "type": "bearer",
    "token": "your-api-token"
  },
  "endpoints": [
    {
      "method": "GET",
      "path": "/users",
      "description": "List all users"
    },
    {
      "method": "POST",
      "path": "/users",
      "description": "Create a new user"
    }
  ]
}

Security

API credentials are stored securely in TorlyAI's encrypted credential store at ~/.torlyai/credentials.enc. The encryption uses AES-256-GCM with a machine-specific key.