Welcome to the AI Gateway! This service allows you to integrate your own AI models or utilize preconfigured AI APIs (e.g., OpenAI, Hugging Face) directly within your integrations. You can call AI endpoints, register your own, and use them seamlessly in your Integrations and Action scripts.

Getting Started

Key Features

  1. Prebuilt AI Endpoints: Use predefined APIs like ChatGPT and HuggingFace.
  2. Custom AI Endpoints: Register your own AI models or APIs.
  3. Seamless Integration: Call AI endpoints directly in the Integration scripts.

Use Case 1 - using AI to enhance results in an Integration

Your Integrations is having data from the Trigger that you want to transform with AI, or analyze it and send the result to another data storage.

Use Case 2 - always use AI when calling an API endpoint or db query

Your Integration App for Contract Management always run an AI analysis on the uploaded contract to make sure it complies with all your policies.

See also

Scripting Support in Integrations

How to Use the AI Gateway

1. Predefined AI Endpoint Example

You can start using predefined endpoints such as chatgpt without additional setup.

Example JavaScript that you can add to your Integration or Action:

var prompt = "Summarize this text: The quick brown fox jumps over the lazy dog.";
var response = await callAI("chatgpt", JSON.stringify({
    prompt: prompt,
    max_tokens: 100
}));
log(response);

2. Register Your Custom AI Endpoint

If you have your own AI model or service, you can register it for use in JINT scripts.

Step 1: Register the Endpoint

Send a POST request to the AI Gateway to register your endpoint.

Endpoint:

POST <https://api.copyl.com/ms/AIGateway/register>

Request Body:

{
    "name": "myCustomAI",
    "url": "<https://your-ai-service.com/api>"
}

Response:

{
    "success": true,
    "message": "Endpoint registered successfully."
}

Step 2: Call Your Endpoint

After registering, you can use the endpoint in your Copyl Integration and Action scripts.

Example Script: