Integrations
Each integration takes an API key, your API base URL (https://api.answerline.dev) and the engines to offer. Leave engines at their default or set them to the
engines available to you, ["CHATGPT","GEMINI","AIMODE","GOOGLE","GOOGLE_NEWS"] today.
n8n
Install the community node n8n-nodes-answerline, then create its credentials; n8n tests them with GET /v1/credits. Operations:
- Run Monitor: an engine's prompt or query, country and additional request fields as JSON, answered synchronously. For Google, a
urlin the additional fields replaces the query and country. - Create Task: the same request as an async task, with priority, idempotency key and webhook URL.
- Get Task: status and result of a task.
- Get Credits: remaining credits and billing cycle.
With Continue On Fail, a failed item outputs the error message, its description and the HTTP status.
Zapier
Connect the app with the same three settings; engines are a comma-separated list of task types.
- Run Monitor: an engine's request, run as an async task; the Zap continues with the answer, charged at the task price.
- Create Task: queues the request with the Zap's callback URL as its webhook; the Zap pauses and continues with the finished task, completed or failed.
Zapier limits how long an action may run, so both actions queue a task instead of waiting on a synchronous call.
LangChain
The LangChain packages build tools on the SDKs: one synchronous monitor tool per engine (for example monitor_chatgpt), plus
create_async_task, get_task_status and get_credits. A task's payload is validated as the request of its
taskType. In JavaScript, API errors are thrown with the response body in the message; in Python, errors are returned to the model as the tool result.
npm install @answerline/sdk @answerline/langchain
import { Client } from "@answerline/sdk";
import { createTools } from "@answerline/langchain";
const client = new Client({ apiKey: process.env.API_KEY!, baseUrl: "https://api.answerline.dev" });
const tools = createTools(client, { engines: ["CHATGPT","GEMINI","AIMODE","GOOGLE","GOOGLE_NEWS"] });
pip install answerline answerline_langchain
import os from answerline import Client from answerline_langchain import create_tools tools = create_tools(Client(os.environ["API_KEY"], base_url="https://api.answerline.dev"), engines=["CHATGPT","GEMINI","AIMODE","GOOGLE","GOOGLE_NEWS"])
Bind tools to a chat model or agent like any other LangChain tools.