Skip to main content
The Neural Factory REST API lets your own programs do what people do in the web app. An agent is an AI assistant your organization sets up in Neural Factory to answer questions and carry out tasks, and through the API a program can give it a task and collect the answer, run workflows, and manage agents, knowledge bases, documents and skills. A nightly script that asks an agent for a sales summary is a typical use. So is a support tool that sends a customer email to an agent for a draft reply.

Base URL

Send every request to the API address of your deployment:
  • SaaS: https://api.neuralfactory.ai
  • Enterprise: the API address of your own installation. Your administrator has it.
Paths go straight after the address, with no version prefix: https://api.neuralfactory.ai/chat. The examples in this reference use the SaaS address.

How a call works

  1. Create an API key in the web app, under Integrations › API keys. On Enterprise an Admin does this; on SaaS an Admin or a Member can, on the Pro or Business plan.
  2. Exchange the key’s secret for a token at POST /apikeys/token. The token lasts 24 hours.
  3. Send POST /chat with the token as Authorization: Bearer <token>, an agent_id and a message. This starts a run.
  4. The run works in the background. Wait for it, poll GET /runs/{run_id}, stream it, or receive a webhook when it ends.
  5. Read the agent’s answer from the finished run.
A run outlives the HTTP request that started it. If your connection drops, the run still finishes, its result is saved and it is billed once. You reattach with its run_id.

Request format

  • POST /chat takes multipart/form-data, because it accepts file uploads. Send its fields as form parts (-F in curl).
  • Other endpoints that take a body, such as POST /runs/{run_id}/resume, take application/json.
  • IDs are strings. Dates are ISO 8601 strings.
  • An error answers with an HTTP status and a detail field. See Errors.

Endpoint reference

The Endpoints section of this tab lists every operation an API key can call, generated from the platform’s own schema. Each operation names the key permission it needs. Routes that only a signed-in person can use, such as managing API keys, the Tasks list, the Inbox, toolkits and your own toolkit connections, and duplicating a workflow, are not in it.

Where to go next

Your first API call

From a new key to an agent’s answer, in curl and Python.

Authentication

Tokens, permissions and what a key can reach.

Runs and results

Starting runs, polling, idempotency, pauses and cancelling.

Streaming

Follow a run as it works.

Webhooks

Get a signed POST when a run ends or pauses.

Building workflows and agents

Turn a brief into a workflow or an agent in the background.

Errors

Status codes and the messages behind them.

Rate and concurrency limits

How many runs at once, per plan, and what a 429 means.