AnswerLine Sign in Start free

Quickstart

1. Get an API key

Sign in to the dashboard and create a key on the API keys page. The key is shown once, so store it as a secret. Every account starts on the Free plan with 500 credits a month.

export API_KEY=sk_...

Install an SDK, or skip this and use curl. The TypeScript SDK runs on Node 18+, Deno, Bun and browsers; the Python SDK needs Python 3.9+.

TypeScript

npm install @answerline/sdk

Python

pip install answerline

2. Make a synchronous call

A monitor endpoint waits for the engine's answer and returns it in the response. Pass your API base URL, https://api.answerline.dev, to the SDK client.

curl

curl -X POST "https://api.answerline.dev/v1/monitor/chatgpt" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Best CRM for small agencies","country":"US","include":{"markdown":true}}'

TypeScript

import { Client } from "@answerline/sdk";

const client = new Client({ apiKey: process.env.API_KEY!, baseUrl: "https://api.answerline.dev" });

const answer = await client.chatgpt({ prompt: "Best CRM for small agencies", country: "US", include: { markdown: true } });
console.log(answer.result);

Python

import os
from answerline import Client

client = Client(os.environ["API_KEY"], base_url="https://api.answerline.dev")

answer = client.chatgpt("Best CRM for small agencies", "US", include={"markdown": True})
print(answer["result"]["markdown"])

The response is {"success": true, "result": {…}}; the fields of result are listed on each engine's page, for example ChatGPT. A synchronous call can take up to five minutes, costs the engine's price plus 2 credits (7 for this one), and holds one of your plan's concurrency slots while it runs.

3. Target a market

Set country (ISO 3166-1 alpha-2) on every request. The AI assistants also accept state for US states, and the Google endpoints add options such as location, hl and device; each engine page lists its request options. List the countries an engine supports and the US states:

curl

curl -X GET "https://api.answerline.dev/v1/countries?model=chatgpt" \
  -H "Authorization: Bearer $API_KEY"

curl -X GET "https://api.answerline.dev/v1/states?country=US" \
  -H "Authorization: Bearer $API_KEY"

TypeScript

const countries = await client.countries("chatgpt");
const states = await client.states("US");

Python

countries = client.countries("chatgpt")
states = client.states("US")

4. Queue a task and poll

An async task runs the same request in the background and answers at once with the task's id. Tasks wait in your queue until a concurrency slot is free and cost the engine's price without the synchronous surcharge. An idempotencyKey makes creating the task safe to repeat.

curl

curl -X POST "https://api.answerline.dev/v1/async/task" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"taskType":"CHATGPT","payload":{"prompt":"Best CRM for small agencies","country":"US"},"idempotencyKey":"crm-agencies-us-2026-09-15"}'

curl -X GET "https://api.answerline.dev/v1/async/task/$TASK_ID" \
  -H "Authorization: Bearer $API_KEY"

TypeScript

const { task } = await client.createTask({
  taskType: "CHATGPT",
  payload: { prompt: "Best CRM for small agencies", country: "US" },
  idempotencyKey: "crm-agencies-us-2026-09-15",
});

const done = await client.waitForTask(task.id);
console.log(done.task.status, done.credits.creditsCharged, done.response);

Python

created = client.create_task("CHATGPT", {"prompt": "Best CRM for small agencies", "country": "US"}, idempotency_key="crm-agencies-us-2026-09-15")

done = client.wait_for_task(created["task"]["id"])
print(done["task"]["status"], done["credits"]["creditsCharged"], done.get("response"))

A task moves from QUEUED to PROCESSING to COMPLETED or FAILED. Once it has finished, response holds the engine's result or the error. waitForTask and wait_for_task poll with backoff for up to 10 minutes by default.

5. Receive results by webhook

Add a webhook URL and the finished task is sent to it, signed with your account's secret, so you don't have to poll. The URL must use https and resolve to a public address. Verify each delivery as the webhooks guide shows before trusting it.

curl

curl -X POST "https://api.answerline.dev/v1/async/task" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"taskType":"CHATGPT","payload":{"prompt":"Best CRM for small agencies","country":"US"},"webhook":{"url":"https://your-app.com/hooks/answers"}}'

TypeScript

await client.createTask({
  taskType: "CHATGPT",
  payload: { prompt: "Best CRM for small agencies", country: "US" },
  webhook: { url: "https://your-app.com/hooks/answers" },
});

Python

client.create_task("CHATGPT", {"prompt": "Best CRM for small agencies", "country": "US"}, webhook_url="https://your-app.com/hooks/answers")

Next steps