Circuit Versions
Create, validate, and manage versions of your AI circuits.
Circuit Versions
A circuit version is a specific, immutable snapshot of your circuit's definition (circuit.json). Every time you change your circuit, you create a new version. This guide covers creating, validating, fetching, and annotating versions. For the parent circuit, see Managing Circuits.
Base URL
All examples assume the following base URL:
https://modelworks.ai/apiAuthentication
All endpoints below require an API token sent as Authorization: Bearer YOUR_API_TOKEN. See Authentication. List endpoints support limit and page pagination and return a meta object with total_count, limit, and page.
Create a version
POST /users/{username}/circuits/{circuit_name}/circuit-versions
Create a new version under your circuit. Owner only. The request body contains the circuit definition JSON.
Path parameters
| Parameter | Type | Description |
|---|---|---|
username | string | Your username (the circuit owner). |
circuit_name | string | The circuit's name. |
Example
curl -X POST https://modelworks.ai/api/users/modelworks/circuits/SEC-Filing-Discovery/circuit-versions \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d @circuit.jsonAfter creation, the version enters STAGING and moves to VALIDATING, then VALIDATED once checks pass.
Validate a version
POST /circuit-versions/validate
Validate a circuit definition before creating a version. Upload your circuit.json as a multipart file. Returns validation results without persisting anything — a great way to catch schema errors during CI.
curl -X POST https://modelworks.ai/api/circuit-versions/validate \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "file=@circuit.json"| Parameter | Type | Description |
|---|---|---|
file | file | The circuit.json file to validate (multipart upload). |
Get a version
GET /circuit-versions/{uid}
Fetch a single version by its UID. Whether the source code and full schema are included depends on the circuit's visibility and whether you're the owner: public circuits expose their definition to everyone; private/protected circuits expose it only to the owner.
curl https://modelworks.ai/api/circuit-versions/8c5db2d9-d8a5-4752-a7a2-b31ae763d988 \
-H "Authorization: Bearer YOUR_API_TOKEN"| Parameter | Type | Description |
|---|---|---|
uid | string | The version's unique ID. |
Update a version's README
PUT /circuit-versions/{uid}/readme
Update the README markdown attached to a version. Owner only.
curl -X PUT https://modelworks.ai/api/circuit-versions/8c5db2d9-d8a5-4752-a7a2-b31ae763d988/readme \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: text/plain" \
-d @README.md| Parameter | Type | Description |
|---|---|---|
uid | string | The version's unique ID. |
Update a version's license
PUT /circuit-versions/{uid}/license
Update the LICENSE file attached to a version. Owner only.
curl -X PUT https://modelworks.ai/api/circuit-versions/8c5db2d9-d8a5-4752-a7a2-b31ae763d988/license \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: text/plain" \
-d @LICENSE.md| Parameter | Type | Description |
|---|---|---|
uid | string | The version's unique ID. |
Version states
Each version moves through a lifecycle. The common states are:
| State | Meaning |
|---|---|
BUILDING | The version is being built and uploaded. |
STAGING | Newly created and under development. |
VALIDATING | The system is running validation checks (syntax, schema, limits). |
VALIDATED | All checks passed; ready for production use. |
VALIDATION_FAILED | Validation failed; the version can't be used until fixed. |
RUNNING | Actively in use and healthy. |
DEPRECATED | Marked obsolete; prefer a newer version. |
EXCEPTION | Experienced a high error rate in the last 24 hours. |
DEACTIVATED | Manually disabled; the version cannot be queried. |
Get pricing
GET /circuit-versions/{uid}/circuit-pricing
Returns the pricing information for a version. Private circuits require ownership; public/protected circuits expose pricing to anyone.
curl https://modelworks.ai/api/circuit-versions/8c5db2d9-d8a5-4752-a7a2-b31ae763d988/circuit-pricing \
-H "Authorization: Bearer YOUR_API_TOKEN"| Parameter | Type | Description |
|---|---|---|
uid | string | The version's unique ID. |
List runs for a version
GET /circuit-versions/{version_uid}/circuit-runs
List the completed public runs for a version. Paginated.
curl "https://modelworks.ai/api/circuit-versions/8c5db2d9-d8a5-4752-a7a2-b31ae763d988/circuit-runs?limit=10&page=1" \
-H "Authorization: Bearer YOUR_API_TOKEN"| Parameter | Type | Description |
|---|---|---|
version_uid | string | The version's unique ID. |
limit | integer | Items per page (optional). |
page | integer | 1-based page number (optional). |
Tip: Only completed public runs are listed here. For private runs and full details, see Circuit Runs.