Overview
The local API is a Prism Pro feature for managing profiles in bulk from your own scripts: create profiles from your own data, start them in order, check their status and close them when you are done. It manages profiles only — it does not read cookies, passwords, proxy credentials or page content, and it offers no Puppeteer / Playwright debugging endpoint. To let an AI read pages, click and fill in forms, use MCP.
| Area | Description |
|---|---|
| Address | http://127.0.0.1:<port>; a random port is assigned each time the API starts, and only requests from this computer are accepted |
| Authentication | Request header Authorization: Bearer <token>; the token is shown once when the API starts and stops working when the API stops |
| Data format | JSON (UTF-8); successful results are in the result field |
| Request body | Only the creation endpoints accept a JSON body, up to 96 KiB |
| Rate limit | Up to 120 requests per 60 seconds, shared with MCP |
| Timeout | Each request waits at most 60 seconds |
| Availability | Prism Pro; identical on macOS and Windows; the creation endpoints need 0.3.22 or later |
Quick start
Start the local API
In Prism, open “Automation API” on the left and click “Start Local API”. This feature requires Prism Pro.
Copy the address and token
The window shows the “API Address” and the “Session Access Token”. The token is shown only once, when the API starts, so copy it right away; to get a new token later, stop and restart the API.
Send your first request
Set two variables in a terminal, then check the service status and list your profiles. A response containing
"state": "running"means the address and token work.
PRISM_API='http://127.0.0.1:43123' # the API address shown in Prism
PRISM_TOKEN='<token>' # the token shown in Prism
curl -H "Authorization: Bearer $PRISM_TOKEN" "$PRISM_API/v1/status"
curl -H "Authorization: Bearer $PRISM_TOKEN" "$PRISM_API/v1/profiles"In Windows PowerShell, curl is an alias for a different command: type curl.exe instead, or use PowerShell’s built-in Invoke-RestMethod:
$api = 'http://127.0.0.1:43123'
$headers = @{ Authorization = 'Bearer <token>' }
(Invoke-RestMethod -Uri "$api/v1/profiles" -Headers $headers).result | Format-Table serialNumber, name, statusRequest rules
The API accepts only requests sent by scripts or programs on this computer. A request that breaks one of these rules is not executed and returns the error shown:
| Rule | HTTP | Error |
|---|---|---|
Use 127.0.0.1, not localhost: the Host request header must match the API address exactly | 403 | invalid_host |
Send Authorization: Bearer <token> with every request | 401 | unauthorized |
| No browser Origin header, so JavaScript in web pages and browser extensions cannot call the API | 403 | browser_origin_not_allowed |
No query parameters in the URL (?…) | 400 | query_not_allowed |
| Only the paths and methods listed below | 404 | not_found |
Only the creation endpoints accept a request body; start, close and other requests must not send even {} | 400 | body_not_allowed |
The creation endpoints use Content-Type: application/json, and the body is a JSON object | 400 | json_body_required / invalid_json_body |
| The request body is at most 96 KiB | 413 | request_too_large |
| Up to 120 requests per 60 seconds; failed requests and MCP requests count too | 429 | rate_limited |
Prism handles local API and MCP requests one at a time, in the order received. Starting a profile includes a proxy check and opening the browser, which usually takes a few seconds; later requests wait in line. Wait for each request to return before sending the next.
Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /v1/status | Check that the service is available |
| GET | /v1/profiles | List all profiles (excluding the Trash) |
| GET | /v1/profiles/{id}/status | Get one profile |
| POST | /v1/profiles/{id}/start | Start a profile |
| POST | /v1/profiles/{id}/close | Close a profile; its data is kept |
| POST | /v1/profiles | Create one profile (0.3.22 and later) |
| POST | /v1/profiles/batch | Create 1–50 profiles at once (0.3.22 and later) |
{id} is a profile ID, taken from the result of GET /v1/profiles. Successful responses use HTTP status 200; except for GET /v1/status, the result is in the result field. The API has no endpoints for editing or deleting profiles.
Profile object
The profile list, profile status, start and close all return the same profile object:
| Field | Type | Description |
|---|---|---|
id | string | Profile ID, used by the other endpoints |
serialNumber | integer | Profile number shown in the app; never reused after deletion |
name | string | Profile name |
group | string | Group; an empty string when the profile has none |
tags | array of strings | Tags |
status | string | closed, starting, running, stopping (closing), orphaned (leftover process) or error |
lastOpenedAt | string | Time the profile was last opened (ISO 8601, UTC); absent for profiles that were never opened |
{
"result": {
"id": "8f0c2b9e-4d6a-4f51-9a7e-2f1c3d5b6a70",
"serialNumber": 12,
"name": "Shop A",
"group": "Project A",
"tags": ["automation"],
"status": "running",
"lastOpenedAt": "2026-10-02T08:30:00.000Z"
}
}Responses never include proxy addresses or credentials, fingerprint settings, cookies, passwords, site data or extension data.
Query, start and close
GET /v1/status
Returns the service status, to confirm that the address and token work. This is the only response not wrapped in result:
{
"state": "running",
"transport": "loopback",
"protocolVersion": 1
}GET /v1/profiles
Returns an array of profile objects, most recently modified first. Profiles in the Trash are not included.
GET /v1/profiles/{id}/status
Returns the current state of one profile. A profile that does not exist or is in the Trash returns 404 PROFILE_NOT_FOUND.
POST /v1/profiles/{id}/start
- Works like clicking “Open” in the app: Prism checks the kernel and the Pro kernel license, tests the proxy and exit IP changes, then opens the browser window. On success it returns the profile object with status
running. - If the profile is already running, its current state is returned and nothing is opened twice.
- Prism handles the next request only after a start request returns. To start many profiles, call the endpoint for each in turn; how many can run at the same time depends on your computer’s memory and CPU.
- If the kernel is missing, the proxy check fails, the proxy exit IP has changed (with the
blockpolicy) or a leftover process remains, the start fails with 502 anderror.messageexplains why. - Cases where the app would ask you to confirm fail outright through the API — for example, when geolocation sources disagree about the proxy exit. For these errors, open the profile in the Prism app or switch its network identity to
manual. - Profiles you call the start endpoint for (including ones that were already running) are tracked, and “Emergency Stop” in the “Automation API” window closes them. “Stop API” and the stop and emergency-stop buttons in the MCP window only stop the API; these profiles stay open.
POST /v1/profiles/{id}/close
Closes the browser window, keeps the profile data and returns the profile object with status closed; if the profile is not running, closed is returned right away. If the browser has not exited after 8 seconds and still holds the data folder, the status is orphaned; calling close again ends the leftover process.
PROFILE_ID='8f0c2b9e-4d6a-4f51-9a7e-2f1c3d5b6a70' # an id from GET /v1/profiles
curl -X POST -H "Authorization: Bearer $PRISM_TOKEN" "$PRISM_API/v1/profiles/$PROFILE_ID/start"
curl -X POST -H "Authorization: Bearer $PRISM_TOKEN" "$PRISM_API/v1/profiles/$PROFILE_ID/close"Create profiles
The creation endpoints save new profiles in the closed state; no browser is opened. Every field is optional: omitted fields take the same defaults as “New Profile” in the app, and each profile gets a new fingerprint seed. Unknown fields are rejected.
Create one profile
curl -X POST "$PRISM_API/v1/profiles" \
-H "Authorization: Bearer $PRISM_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: shop-b-001" \
-d '{
"name": "Shop B",
"group": "Project A",
"tags": ["automation"],
"startUrls": ["https://example.com/"],
"proxy": { "protocol": "socks5", "host": "203.0.113.10", "port": 1080, "username": "user", "password": "pass" }
}'On success, the new profile is returned:
{
"result": {
"id": "3b1f7a52-9c4e-4d2b-8f60-1a2b3c4d5e6f",
"serialNumber": 13,
"name": "Shop B",
"group": "Project A",
"tags": ["automation"],
"status": "closed"
}
}Create in batches
The body of POST /v1/profiles/batch is a profiles array of 1–50 items, each written like a single creation, except that requestKey goes at the top level or in the header. Prism validates every profile first: if any is invalid, nothing is created and the error names the profile and the field (profiles[1] is the second profile; counting starts at 0). Results are returned in input order:
{
"requestKey": "shops-batch-001",
"profiles": [
{ "name": "Shop C", "group": "Project A" },
{ "name": "Shop D", "group": "Project A", "fingerprint": { "platform": "windows" } }
]
}{
"result": {
"profiles": [
{ "id": "…", "serialNumber": 14, "name": "Shop C", "group": "Project A", "tags": [], "status": "closed" },
{ "id": "…", "serialNumber": 15, "name": "Shop D", "group": "Project A", "tags": [], "status": "closed" }
],
"count": 2
}
}Profile fields
| Field | Description | If omitted |
|---|---|---|
name | Name, 1–60 characters | “API” plus a number, such as API 8: the current number of profiles plus 1, counting up within a batch; it may repeat an existing name |
group | Group, up to 40 characters | No group |
tags | Array of tags: up to 20, each up to 30 characters | None |
note | Note, up to 500 characters | None |
color | Marker color, #RRGGBB | Rotates through the palette |
startUrls | Array of start pages, up to 50; http / https only, without user name or password; addresses without a scheme use https | Prism website |
proxy | Proxy; see the table below | Direct connection |
fingerprint | Fingerprint options; see the table below | Same as a new profile in the app |
extensionIds | Prism’s internal IDs of installed extensions, up to 50. In the “Extensions” window, the folder name in the extension path …/<ID>/extension is this ID; it is not the Chrome Web Store extension ID | No extensions |
kernelVersion | Pins a kernel version: four numbers, such as 144.0.7559.132; that version must be installed when the profile starts | Follows the default kernel |
requestKey | Request key for safe retries; see “Safe retries” | None |
Proxy fields
| Field | Description |
|---|---|
protocol | Required: direct, http, https or socks5 |
host | Host name or IP, without scheme, port or credentials; required unless direct |
port | Integer from 1 to 65535; required unless direct |
username、password | Optional. The password is stored encrypted on this computer and never returned by any endpoint |
Fingerprint fields
| Field | Description | If omitted |
|---|---|---|
platform | macos or windows | Follows the hardware template; without a template, this computer’s operating system |
hardwareProfileId | Hardware template; see the table below. The OS version, CPU cores and screen size come from the template | The seed-based template for that system |
seed | Fingerprint seed, an integer from 0 to 4294967295; the same seed with the same other fingerprint settings gives the same fingerprint | Random |
brand | Chrome or Edge | Chrome |
brandVersion | Browser version. Usually left empty to use the kernel version; if set, its major version must match the kernel the profile starts with, or the profile cannot start | Follows the kernel |
language | Interface language, such as en-US | This computer’s system language |
acceptLanguages | Accept-Language request header | Derived from the language |
timezone | IANA time zone, such as America/New_York | This computer’s time zone |
networkIdentityMode | proxy: test the proxy exit before starting; the time zone and geolocation follow the exit, and so does the language when the exit country is recognized; manual: always use the values you set | proxy |
proxyExitPolicy | When the proxy exit IP differs from the last check: block makes this start fail, and starting again counts as confirmation, so scripts should not retry this error automatically; warn only warns | block |
webrtcPolicy | proxy_only leak protection; public_only public interface only; default system default | proxy_only |
Hardware templates
| ID | System | Description |
|---|---|---|
macos-seeded-apple | macOS | Seed-based Apple GPU, suited to many profiles; macOS default |
macos-host | macOS | This computer’s own hardware; Mac only |
macos-m1 | macOS | Apple M1 · 8GB |
macos-m3-pro | macOS | Apple M3 Pro · 18GB |
macos-m4-pro | macOS | Apple M4 Pro · 24GB |
windows-seeded-nvidia | Windows | Seed-based NVIDIA GPU, suited to many profiles; Windows default |
windows-host | Windows | This computer’s own hardware; Windows PCs only |
windows-10-rtx3060 | Windows | Windows 10 · RTX 3060 · 16GB |
windows-11-rtx4060 | Windows | Windows 11 · RTX 4060 · 16GB |
windows-11-rtx4070 | Windows | Windows 11 · RTX 4070 · 32GB |
A template that does not match platform is rejected. Window position and size, cookies, extension data and similar settings cannot be set through the API; change them in the Prism app after creation.
Safe retries
When the network drops or a request times out, you may not know whether the profile was created. Give each creation a request key, and a retry will never create it twice:
- Send a key in the
Idempotency-Keyheader or therequestKeybody field: 8–128 characters made of ASCII letters, digits and. _ : -. If you send both, they must match. - Retrying with the same key and the same content within 24 hours returns the profiles created the first time (HTTP 200), even after Prism restarts.
- The same key with different content returns 409
IDEMPOTENCY_CONFLICT. If a profile from the first request has been deleted (including moved to the Trash), the API returns 409IDEMPOTENCY_RESULT_GONEinstead of quietly creating it again; use a new key to create it again. - After 24 hours, the same key counts as a new request.
- Up to 1,000 keyed requests are kept for 24 hours, a limit shared with MCP creation (each MCP creation uses one); at the limit the API returns 429
IDEMPOTENCY_CAPACITYuntil old records expire. - Keys and request contents are kept on this computer only as keyed digests, never as plain text, so no proxy password is stored with them.
Build keys from your own data, such as a spreadsheet row or an order number: shop-b-001.
Errors
When a request is rejected at the entrance (see “Request rules”), error is a string such as {"error":"unauthorized"}. When Prism fails while handling a request, error is an object:
{
"error": {
"code": "INVALID_PROFILE_INPUT",
"message": "Invalid profile creation request; see details",
"retryable": false,
"details": [
{ "path": "profiles[1].proxy.port", "message": "Too big: expected number to be <=65535" }
]
}
}Programs should rely on the HTTP status and code; message is a human-readable explanation, partly in Chinese, and its wording may change between versions. When retryable is true, the same request can be retried later. details appears only for invalid creation fields, with at most 20 entries, and never repeats the submitted values.
| HTTP | Error | Meaning | What to do |
|---|---|---|---|
| 400 | INVALID_PROFILE_INPUT | Invalid creation fields; details lists each field and reason | Fix the fields named in details and resend |
| 400 | query_not_allowed、body_not_allowed、json_body_required、invalid_json_body | The request breaks a request rule | Fix it using “Request rules” |
| 401 | unauthorized | Wrong or expired token | Restart the API in Prism and use the new token |
| 403 | invalid_host、browser_origin_not_allowed | The address or the request origin is not accepted | Use 127.0.0.1 and call from a script, not a web page |
| 403 | PRO_REQUIRED | The Pro license has lapsed, or a pinned kernel needs Pro | Renew or reactivate Pro |
| 404 | not_found | No such path or method | Check “Endpoints” |
| 404 | PROFILE_NOT_FOUND | The profile does not exist or is in the Trash | Fetch the profile list again |
| 409 | IDEMPOTENCY_CONFLICT、IDEMPOTENCY_RESULT_GONE | Request key conflict, or a profile it created has been deleted | Use a new request key |
| 413 | request_too_large | Request body larger than 96 KiB | Split it into several batches |
| 429 | rate_limited、IDEMPOTENCY_CAPACITY | Too many requests, or 1,000 request keys within 24 hours | Try again later |
| 502 | MCP_REQUEST_FAILED and others | Other failures — for example, a missing kernel, a failed proxy check or a leftover process | Act on message |
| 504 | BROKER_TIMEOUT | Prism did not answer within 60 seconds; the operation may still be in progress | Check the status first; retry creation requests with the same key |
MCP_REQUEST_FAILED is a general error name used inside Prism; the local API uses it too.
Code examples
Replace the address and token in the examples with the values shown in Prism. The examples create profiles, then start and close the new one.
Python
Requires requests (pip install requests):
import requests
API = "http://127.0.0.1:43123" # the API address shown in Prism
TOKEN = "<token>" # the token shown in Prism
session = requests.Session()
session.headers["Authorization"] = f"Bearer {TOKEN}"
def call(method, path, **kwargs):
response = session.request(method, API + path, timeout=70, **kwargs)
body = response.json()
if not response.ok:
raise RuntimeError(f"{response.status_code}: {body['error']}")
return body.get("result", body)
created = call("POST", "/v1/profiles/batch",
headers={"Idempotency-Key": "shops-batch-002"},
json={"profiles": [{"name": "Shop C"}, {"name": "Shop D"}]})
for profile in created["profiles"]:
print("created", profile["serialNumber"], profile["id"])
profiles = call("GET", "/v1/profiles")
for profile in profiles:
print(profile["serialNumber"], profile["name"], profile["status"])
first = created["profiles"][0]["id"]
print(call("POST", f"/v1/profiles/{first}/start")["status"]) # running
print(call("POST", f"/v1/profiles/{first}/close")["status"]) # closedNode.js
Node.js 18 and later include fetch, so nothing needs to be installed:
// prism.mjs — run with: node prism.mjs (Node.js 18 or later)
const API = 'http://127.0.0.1:43123' // the API address shown in Prism
const TOKEN = '<token>' // the token shown in Prism
async function call(method, path, body, headers = {}) {
const response = await fetch(API + path, {
method,
headers: { Authorization: `Bearer ${TOKEN}`, ...(body ? { 'Content-Type': 'application/json' } : {}), ...headers },
body: body ? JSON.stringify(body) : undefined,
signal: AbortSignal.timeout(70_000),
})
const data = await response.json()
if (!response.ok) throw new Error(`${response.status}: ${JSON.stringify(data.error)}`)
return data.result ?? data
}
const profile = await call('POST', '/v1/profiles', {
name: 'Shop E',
fingerprint: { language: 'en-US', timezone: 'America/New_York', networkIdentityMode: 'manual' },
}, { 'Idempotency-Key': 'shop-e-001' })
console.log('created', profile.serialNumber, profile.id)
console.log((await call('POST', `/v1/profiles/${profile.id}/start`)).status) // running
console.log((await call('POST', `/v1/profiles/${profile.id}/close`)).status) // closedLocal API and MCP
The local API is meant for your own scripts; AI clients should connect to Prism through MCP. MCP has its own token and permissions: only the profiles allowed in “Local AI · MCP” are visible to the AI, and the AI cannot call the local API. Both share the same local service and the limit of 120 requests per 60 seconds; stopping MCP or using its emergency stop also stops the local API.
An AI can also create profiles with the MCP tools prism_create_profile and prism_create_profiles, which take the same fields as this page. This requires turning on “Allow AI to create profiles” in “Local AI · MCP” (off by default); whether the AI may control the new profiles depends on your profile access mode. MCP and the local API keep separate request keys but share the limit of 1,000 records per 24 hours.
Security
- The token is the key to managing profiles on this computer: keep it out of code repositories, logs and chats. If it may have leaked, stop and restart the API; the old token stops working immediately.
- The API listens only on 127.0.0.1, so other devices on your network or the internet cannot reach it directly. The Host check mainly stops browsers and accidental misuse and is not access control; do not expose the API through port forwarding or a reverse proxy.
- Other programs on this computer can call the API if they get the token. Enable it only on computers you trust, and click “Stop API” when you are done.
- “Emergency Stop” in the “Automation API” window stops the API and closes the profiles started through the API in this session that are still running.
- Every request Prism executes is written to the local audit log
vault/logs/automation-audit.jsonl(in the Prism data folder) with the time, action, result, request ID, profile IDs and failure reason — never the token, request content or page content. Requests rejected by the request rules andGET /v1/statusare not logged.
FAQ
- Can I call the API from a web page or a browser extension?
- No. Requests sent by a browser carry an Origin header, which the API rejects. Call it from a terminal, a script or a local program.
- Why does localhost return 403?
- The API requires the Host header to match 127.0.0.1 and the port of the API address exactly, so localhost is rejected. Use 127.0.0.1 as the host name.
- The “Automation API” window shows the API running but no token. What should I do?
- With MCP enabled, Prism automatically starts the local service that the API and MCP share, so the window shows only the address. The token is shown only once, when “Start Local API” succeeds: click “Stop API”, then “Start Local API” to get a new token. MCP is disconnected while the service is stopped.
- Does the old token still work after Prism restarts?
- No. Every API start creates a new port and token; stopping the API or quitting Prism invalidates the old token.
- Can the API edit or delete profiles?
- No. The API can create, query, start and close profiles; edit and delete profiles in the Prism app.
- Can I connect Puppeteer, Playwright or Selenium?
- No. The API provides no debugging port or WebDriver address. For page-level actions, let an AI client do them through MCP.
- Can I start many profiles at once?
- Call the start endpoint for each profile in turn. Prism handles requests one at a time and moves on once a profile has started; how many can run together depends on your computer’s memory and CPU.
- Does it work on Windows?
- Yes. Prism Pro provides the same local API on macOS and Windows. In Windows PowerShell, use curl.exe or Invoke-RestMethod.