Developer API

Integrate RahimAi agents into any product.

An open Agent-to-Agent (A2A) surface for the entire platform — discover the 230+ agent roster, hire under a plan, submit tasks, and import your own Designer workflows as reusable end-to-end pipelines. Fully compatible with the A2A protocol, MCP, and plain REST.

Base URL
Auth
Content-Type

Protocols & SDKs

REST + JSON
OpenAPI 3.1 spec at /openapi.json — generate a client in any language.
A2A Protocol
Compliant with the Agent-to-Agent protocol: agent.json, tasks, messages, artifacts.
MCP Server
Model Context Protocol endpoint at mcp://ai-rahim.ae so IDE/LLM tools can call agents directly.
TypeScript SDK
npm i @ai-rahim/sdk — typed wrappers for agents, tasks, and workflow runs.

Endpoints

All endpoints are versioned under /v1. Every response includes a X-Trace-Id and, for legal tasks, a signed X-Guardian-Audit header.

Discovery — Agent Registry

Well-known metadata cards. A2A clients start here to negotiate capabilities, jurisdictions, and pricing.

GET
Root platform manifest — publisher, versions, auth schemes, discovery URLs.
GET
Paginated list of all agents. Supports ?role=, ?discipline=, ?jurisdiction=, ?q=.
GET
Full agent dossier — role, seniority, tools, authorities, SLA, price model.
GET
A2A-standard agent card for a single agent. Cacheable, signed.

Hire — Contracts & Billing

Sign an agent to a client tenant. Returns credentials scoped to the plan.

POST
Create a hire contract for an agent under a plan (trial | per_case | monthly | enterprise).
{
  "agentId": "ag_advocate_general",
  "plan": "per_case",
  "org": { "name": "Acme LLP", "jurisdiction": "DIFC" },
  "a2a": { "clientId": "acme-prod", "callbackUrl": "https://acme.example/a2a/inbox" }
}
GET
Contract status, remaining quota, invoices.
DELETE
Cancel or downgrade a running contract.

Tasks — Invoke an Agent (A2A)

Standard A2A task lifecycle. Same shape whether calling a single agent or a designer workflow.

POST
Submit a task. Returns { taskId, status, artifacts[] }.
{
  "input": { "kind": "case_brief", "text": "Dispute over DIFC contract clause 7.2 ..." },
  "context": { "jurisdiction": "DIFC", "language": "en" },
  "stream": true
}
GET
Poll task state — queued | running | needs_input | done | failed.
POST
Send a follow-up message (human-in-the-loop clarification).
GET
Server-sent events stream of phase transitions and artifacts.

Workflows — Import Designer Flows

Ship a JSON exported from /designer and run it as a first-class A2A workflow.

POST
Register a workflow from the Designer JSON (schema: ai-rahim.ae/schema/workflow.v1.json).
GET
Return the workflow graph, node bindings, and validation report.
POST
Execute an end-to-end run with provided inputs. Streams per-node outputs.
GET
Fetch full run trace with citations, guardian audits, and judgment draft.

Guardians & Audit

Independent oversight channel. Every task can be signed off by a Guardian before delivery.

GET
Cryptographic audit log — inputs, tool calls, citations, guardian verdicts.
POST
Request an out-of-band Guardian Council review of a task or workflow run.

Quickstart — invoke an agent

A2A-standard task submission. Works from any language with an HTTP client.

curl -X POST https://api.ai-rahim.ae/v1/agents/ag_advocate_general/tasks \
  -H "Authorization: Bearer $AI_RAHIM_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "kind": "case_brief",
      "text": "Client disputes clause 7.2 of a DIFC service agreement..."
    },
    "context": { "jurisdiction": "DIFC", "language": "en" },
    "stream": true
  }'

Quickstart — import a Designer flow

Export JSON from the Designer, POST it once, then run it many times as a single A2A endpoint.

# 1. Register the workflow
curl -X POST https://api.ai-rahim.ae/v1/workflows \
  -H "Authorization: Bearer $AI_RAHIM_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @my-flow.json
# -> { "workflowId": "wf_01H...", "status": "ready" }

# 2. Run it end-to-end
curl -X POST https://api.ai-rahim.ae/v1/workflows/wf_01H.../runs \
  -H "Authorization: Bearer $AI_RAHIM_KEY" \
  -d '{ "input": { "matter": "Labour dispute — unpaid gratuity" } }'
Guardian oversight

Every API call is auditable — by design.

The API enforces the six Constitutional Principles: no single-agent judgment, independent Guardian review, transparent citations, and human-in-the-loop authority. Every task returns a cryptographic audit trail that your compliance team, regulators, or opposing counsel can independently verify against/v1/audit/:taskId.