Developer documentation
Code Audit Documentation
One reference for console workflows and CI/CD automation with the Code Audit external API.
- Base URL
- https://sec.transplane.sg/v1
- API version
- v1
- Access model
- Workspace-wide access
HTTP/JSON endpoints for GitHub Actions, GitLab CI, Jenkins, and internal security platforms. New integrations should use the /v1 prefix.
Quickstart
The shortest integration path does not create a project. Omit project_id when uploading and creating a task to reuse the same default project as New Audit.
- 01
Read catalogs
GET /models · GET /analysis-types
Discover the models and analysis types actually allowed by the workspace plan.
- 02
Upload source
POST /uploads
Omit project_id to use the default project automatically.
- 03
Create an audit
POST /tasks
Send source_asset_id and analysis_type; omit model to use auto. billing_mode defaults to usage_based with reports included; send outcome_based for the lower model rate and separately unlocked reports. First request a Credits estimate and send its billing_rate_multiplier as expected_billing_rate_multiplier; refresh the estimate after a 409. Set allow_insufficient_credits only after explicit confirmation.
- 04
Poll and report
GET /tasks/{id} · POST /findings/{id}/report · POST /tasks/{id}/report/download
Poll task status. Usage-Based reports unlock automatically at no extra charge. Outcome-Based finding reports unlock explicitly with Credits or one Golden Finger; task bundles support Credits only.
BASE_URL="https://sec.transplane.sg/v1"
curl -fsS "$BASE_URL/models" \
-H "Authorization: Bearer $CODE_AUDIT_KEY"
curl -fsS -X POST "$BASE_URL/tasks" \
-H "Authorization: Bearer $CODE_AUDIT_KEY" \
-H "Content-Type: application/json" \
-d '{
"source_asset_id": "asset_uuid",
"analysis_type": 0,
"model": "auto",
"billing_mode": "usage_based",
"expected_billing_rate_multiplier": 5,
"allow_insufficient_credits": false
}'Authentication
Every request requires a Bearer API key. Keys currently have general OpenAPI access across their workspace; scopes are not yet supported. The full key is shown only once, so store it in server-side environment variables or CI secrets.
Authorization: Bearer sk-xxxxxxxxx- Access model
- Workspace-wide access
- Compatibility prefix
- https://sec.transplane.sg/openapi/v1
Models and analysis types
Read the models and analysis types allowed by the current plan before creating a task. Both catalog endpoints are read-only GET requests and do not consume quota.
GET /models
Available models
Successful responses always include auto and set it as default_model. Non-Max plans receive only auto; Max plans also receive models the user can select.
Read-only, no charge · models_unavailable
{
"models": ["auto", "model-a"],
"default_model": "auto",
"stale": false,
"descriptions": {
"model-a": "Example model"
}
}GET /analysis-types
Available analysis types
Results are filtered by plan. code, name, and description are fixed English metadata; analysis_type remains required when creating a task.
Read-only, no charge · analysis_types_unavailable
{
"analysis_types": [
{
"value": 0,
"code": "flexible",
"name": "Flexible audit",
"description": "Flexible 0-day vulnerability audit"
}
],
"default_analysis_type": 0
}Endpoint catalog
Endpoints are grouped by discovery, projects, assets, tasks, reports, and billing. Operations that may create usage or charges use POST.
Discovery
2 endpoints| Method | Path | Description |
|---|---|---|
GET | /models | List models available to the current plan |
GET | /analysis-types | List analysis types available to the current plan |
Projects
5 endpoints| Method | Path | Description |
|---|---|---|
GET | /projects | List projects |
POST | /projects | Create project |
GET | /projects/{project_id} | Get project detail |
PATCH | /projects/{project_id} | Update project |
DELETE | /projects/{project_id} | Delete project |
Source assets
4 endpoints| Method | Path | Description |
|---|---|---|
POST | /uploads | Upload to the default project |
POST | /projects/{project_id}/uploads | Upload source ZIP |
GET | /projects/{project_id}/assets | List uploaded source assets |
DELETE | /projects/{project_id}/assets/{asset_id} | Delete source asset |
Audit tasks
9 endpoints| Method | Path | Description |
|---|---|---|
POST | /tasks | Create an audit in the default project |
POST | /projects/{project_id}/tasks | Create audit task |
GET | /tasks | List tasks |
GET | /tasks/{task_id} | Get task status |
POST | /tasks/{task_id}/cancel | Cancel queued or running task |
POST | /tasks/{task_id}/pause | Pause a running task |
POST | /tasks/{task_id}/unpause | Resume a paused task |
POST | /tasks/{task_id}/retry | Retry task |
DELETE | /tasks/{task_id} | Delete task |
Findings and reports
4 endpoints| Method | Path | Description |
|---|---|---|
GET | /tasks/{task_id}/findings | List findings |
GET | /findings/{finding_id} | Get finding detail |
POST | /findings/{finding_id}/report | Download free with Usage-Based; unlock Outcome-Based reports with Credits or one Golden Finger |
POST | /tasks/{task_id}/report/download | Download free with Usage-Based; unlock the complete Outcome-Based task report with Credits |
Billing read-only
3 endpoints| Method | Path | Description |
|---|---|---|
GET | /billing/usage | Read usage summary |
GET | /billing/subscription | Read subscription status |
GET | /billing/quota | Read plan runtime limits |
Response format
Successful JSON responses use a consistent envelope with business data in data. Downloads return a file stream directly.
Failures include a stable error_code. Integrations should branch on error_code and retain trace_id for support tracing.
Success response
{
"code": 200,
"message": "success",
"data": {},
"trace_id": "req_..."
}Error response
{
"code": 402,
"error_code": "insufficient_balance",
"message": "insufficient general credits",
"trace_id": "req_..."
}Stable error codes
error_code is the stable machine contract. message is diagnostic and may include dynamic content, so it should not control program flow.
| HTTP | error_code | Description |
|---|---|---|
| 400 | invalid_request_body | The request body cannot be parsed |
| 400 | validation_error | A field is missing or fails validation |
| 400 | invalid_pagination | Pagination parameters are invalid |
| 400 | invalid_project_id | project_id is not a valid UUID |
| 400 | unsupported_report_format | The requested report format is not supported |
| 400 | invalid_max_credits | max_credits is not a non-negative finite number |
| 400 | invalid_use_golden_finger | use_golden_finger is not true or false |
| 400 | incompatible_report_unlock_parameters | use_golden_finger=true cannot be combined with max_credits |
| 400 | golden_finger_not_supported_for_task_report | Golden Fingers are not supported for complete task reports |
| 401 | invalid_api_key | The API key is missing or invalid |
| 401 | api_key_revoked | The API key has been revoked |
| 401 | api_key_expired | The API key has expired |
| 402 | insufficient_balance | Balance is insufficient. For task create or retry, send allow_insufficient_credits only after explicit user confirmation; add Credits first if the fixed start charge is not covered. Other billed operations are not performed. |
| 403 | api_access_disabled | OpenAPI access is disabled for the workspace |
| 403 | concurrent_limit_exceeded | The concurrent task limit has been reached |
| 403 | analysis_type_not_allowed | The plan does not allow this analysis type |
| 403 | file_too_large | The file exceeds the plan size limit |
| 403 | access_denied | The resource does not belong to the current workspace |
| 404 | resource_not_found | The requested resource does not exist |
| 405 | method_not_allowed | The request used the wrong method, including report access via GET |
| 409 | conflict | The current report price exceeds max_credits; no unlock or charge occurs |
| 409 | insufficient_golden_fingers | The Golden Finger balance is insufficient; Credits are not used as a fallback |
| 429 | rate_limit_exceeded | The request rate is too high |
| 502 | upstream_error | The audit engine or an upstream service failed |
| 503 | models_unavailable | The model catalog is temporarily unavailable |
| 503 | analysis_types_unavailable | No analysis types are currently available |
| 503 | service_unavailable | A required service is temporarily unavailable |
| 500 | internal_error | An internal platform error occurred |
Client integration
The Code Audit API follows standard HTTP/JSON conventions and can be integrated with backend services, CI pipelines, and internal security platforms.
- TypeScript fetchHTTP/JSON
- Python requestsHTTP/JSON
- Go net/httpHTTP/JSON
Pagination and usage
Invalid list parameters return HTTP 400 with invalid_pagination and are never silently corrected. Use jittered exponential backoff for task polling, with separate timeouts for uploads and report downloads.
| Resource | Default page_size | Maximum page_size |
|---|---|---|
| Projects and tasks | 20 | 100 |
| Findings | 50 | 100 |
- page starts at 1 and page_size is capped at 100. Invalid values return invalid_pagination.
- OpenAPI audit tasks run in English and do not accept locale. Report exports still accept lang=en or lang=zh.
- Usage-Based reports require no additional unlock. For an Outcome-Based finding, use_golden_finger=true consumes one Golden Finger and cannot be combined with max_credits; the default uses Credits. Complete task reports do not support Golden Fingers.
- Write operations do not currently expose a public idempotency-key guarantee. Check existing results before a CI retry uploads or creates a task.
- Use jittered exponential backoff for 429 and recoverable 5xx responses. Do not blindly retry 4xx business errors.