Skip to content

API protocol overview ​

AxonX exposes Jobs through ordinary HTTP JSON, HTTP SSE, and MCP tools. All three share business Schemas and JobResponse; consult the capability pages for Task, Agent, and file-operation parameters. The service must be running; confirm its token and actual public catalog before calling it.

Three entry points for invoking Jobs

Studio API catalog

Studio's API interfaces displays Jobs exposed by the current machine and generates forms from their parameter Schemas. No call has been made in the illustration above; see Getting started with Studio for a complete call response.

Routes ​

MethodPathPurposeSuccessful response
GET/healthWhether the current Application is runningJobResponse, answer.running
GET/jobsActual public Job catalogJobResponse, answer.items/total
POST/jobs/{name}Ordinary callJobResponse
POST/jobs/{name}/eventsLive eventstext/event-stream, ending with result
POST/filesUpload raw bytes to stagingJobResponse, with FileCopy in answer
DELETE/files?path=...Clean up staged filesJobResponse, answer.path
MCP/mcpStreamable HTTP tool interfaceMCP containing JobResponse
Multiple HTTP methods/proxy/{name}/{path}Configured upstream proxyUpstream response

All business requests execute on the current service by default. GET /jobs?target=http%3A%2F%2Fnode-b%3A1024 queries a configured target's catalog; target in Job requests follows the same configuration-matching rules. proxy is a separate upstream-forwarding capability; see HTTP proxy.

Authentication and the public catalog ​

When service.token is configured, both the root paths and subpaths of /health, /jobs, /files, and /mcp require:

http
Authorization: Bearer your-service-token

OPTIONS requests skip this check. Studio's static pages and /proxy are outside these protocol-protected root paths; proxy uses the upstream request's credentials. requires_auth=false does not bypass a configured service token.

Two conditions determine which Jobs are public:

  1. enable_serve=true.
  2. The service has a token configured, or the Job has requires_auth=false.

Jobs default to requires_auth=true, so without a token in the default configuration, you cannot assume every default Job appears in the catalog. Jobs with enable_stream=false accept ordinary calls, but local /events returns 404. Restart the service after changing configuration; the catalog is determined when the HTTP application is built.

Request envelope ​

json
{
  "arguments": { "task": "demo", "x": 1, "y": 2 },
  "target": "http://node-b:1024"
}

arguments is the business-parameter dictionary, defaulting to {}; target is optional and defaults to local execution. The envelope rejects additional top-level fields. target must be listed in this service's targets. The service configuration stores the remote token; the browser submits only the address.

CLI --target instead connects directly to the address using the client's own token, without requiring this service's targets. MCP tools receive only Job business parameters, without the HTTP target envelope described above.

Minimal calls ​

Assume the service address is http://127.0.0.1:1024 and the token is stored in AXONX_SERVICE_TOKEN.

bash
curl -s http://127.0.0.1:1024/health \
  -H "Authorization: Bearer $AXONX_SERVICE_TOKEN"

curl -s http://127.0.0.1:1024/jobs \
  -H "Authorization: Bearer $AXONX_SERVICE_TOKEN"

curl -s -X POST http://127.0.0.1:1024/jobs/version \
  -H "Authorization: Bearer $AXONX_SERVICE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"arguments":{}}'

Health response:

json
{ "answer": { "running": true }, "success": true, "metadata": {} }

The catalog returns JobCatalog. Only one item is shown below to illustrate the field structure; the actual Schema is more complete:

json
{
  "answer": {
    "items": [
      {
        "name": "version",
        "description": "Return the installed AxonX version.",
        "input_schema": { "type": "object", "properties": {} },
        "output_schema": { "type": "object" }
      }
    ],
    "total": 1
  },
  "success": true,
  "metadata": {}
}

output_schema describes the shared JobResponse and does not guarantee that every capability-specific answer type is modeled separately. Task definitions' output_schema is supplied separately by the task-catalog endpoints.

Responses and errors ​

FieldTypeDefaultExplanation
answerAny JSON-serializable value""Business answer or error text
successbooleantrueFinal business outcome of the Job
metadataobject{}Additional information; the Agent provides session_id and related values here
json
{ "answer": "KeyError: 'base#demo#missing'", "success": false, "metadata": {} }

This is an example of a business failure within HTTP 200. Clients must check both the HTTP status and success; a 200 alone is insufficient.

HTTP statusCommon triggerResponse and handling
401Missing or mismatched token{"detail":"Invalid bearer token"}; check the connection target and token source
404Job is not public, name is unknown, or streaming is disabled{"detail":"Unknown job"}; query the catalog again
422Invalid request envelope, parameter Schema, or target configurationdetail text or FastAPI validation details; revise the request
502Connection or protocol failure in an ordinary remote calldetail text; check remote health and credentials
413Upload exceeds the size limitdetail text; reduce the artifact size
409Staging destination conflictdetail text; inspect staged content and symbolic links

Exceptions within executing Steps usually become success=false. After a streaming call starts, exceptions become failed result events and can no longer be represented by HTTP status. A stream that disconnects without a terminal result is not successful.

MCP and events ​

MCP automatically registers tool names, descriptions, and parameters for public Jobs; tools return ordinary JobResponse. MCP's Streamable HTTP is a transport mode and does not replace the AxonX SSE event protocol at /jobs/{name}/events. Live task logs, Agent thinking, and tool blocks use the Event protocol.

File uploads do not pass bytes directly through Job arguments or MCP tools; first use the file-transfer routes.

Implementation references: axonx/constants.py, components/service/http/app.py, jobs.py, files.py, components/job/contracts.py.

Agent-native quant research.