Modaic sells to AI agents - live prices and self-serve payment

The agent storefront at https://agents.modaic.dev/llms.txt?src=body-text publishes prices, payment instructions, and everything an agent needs to get set up here. Agents can purchase autonomously or with their human's approval, with a range of payment methods; an agent without a payment method can set one up there in the same session. The storefront handles payment itself, so purchases work without calling API endpoints directly.

Search Modaic documentation

Find a Modaic guide or API reference

Reference›API›Protégé

Get Protégé trajectory

GET/v1/protege/{jobId}/trajectory

Authorization

Authorizationstringrequired

Send a Modaic bearer token in the Authorization header.

Path Parameters

jobIdstringrequired

Protégé job ID.

The response is the complete trajectory available at request time, encoded as newline-delimited JSON with the application/x-ndjson content type. Each nonempty line is an ACP v1 JSON-RPC record.

import json
import os
import requests

response = requests.get(
    "https://modaic.dev/api/v1/protege/44444444-4444-4444-8444-444444444444/trajectory",
    headers={"Authorization": f"Bearer {os.environ['MODAIC_API_KEY']}"},
)
response.raise_for_status()
trajectory = [json.loads(line) for line in response.iter_lines() if line]

While a job is running, poll this endpoint to receive all records flushed so far. A completed job returns its complete final trajectory. Before the first record is available, the endpoint returns 200 OK with an empty body and X-Modaic-Trajectory-Available: false.

The response includes:

  • X-Modaic-Trajectory-Available: whether a trajectory snapshot exists.
  • X-Modaic-Job-Running: whether the job is still active.
  • ETag: the identity of the current complete snapshot. Send it in If-None-Match on the next request to receive 304 Not Modified when the trajectory has not changed.

The caller must have access to the job's repository. Inaccessible and unknown jobs both return 404 protege_job_not_found.

Was this page helpful?