The published 0.1.0 registry packages do not include platform clients. Install the
current SDK source using the commands below. Existing tracing, real app testing
and simulation APIs remain compatible. Development and production credentials
are separate.
BenchPlatform (Platform in Go) manages Bench accounts and saved resources.
It is separate from the existing Bench tracing and application-test client.
Each call makes one API request; it does not automatically retry writes, start
an evaluation, or execute application code. All 135 API operations are listed in
the operation reference.
Install the platform clients
Use the testedmain source until a registry release containing platform clients
is published. Pin the resolved commit in your project’s lockfile:
- TypeScript
- Python
- Go
- Rust
https://api.usebench.ai in production or
https://api.staging.usebench.ai for development. The examples below use development
to keep test data separate from your production account.
Authenticate
Use a Bench API key for scoped data access. For GitHub setup, API-key management, workspace membership and billing, use a Bench OAuth account credential obtained by the authenticated MCP connector, or a normal authenticated Bench session. API keys cannot mint broader credentials or gain account authority. An AuthKit token is exchanged through theexchange_oauth_token operation and
must have the configured MCP resource audience. Do not forward it as a bearer
credential for ordinary Bench API operations. TypeScript, Python and Go accept a
token supplier for refresh; Rust supports set_credential after refresh. Never
put token values in source or logs. Public authentication operations are available
without a Bench credential.
Read systems and results
- TypeScript
- Python
- Go
- Rust
operations() / Operations() method returns the pinned catalog without a
network call. list_operations retrieves the API’s current catalog.
Request shape
MCP tools added with this release use the same
path, query, body, form
shape. Earlier tools keep their existing input shape, such as system_id or
run_id; inspect the MCP tool schema before calling one.
Upload a dataset
Preview before choosing and approving the column mapping:{'name': 'cases.csv', 'content': bytes_or_text}. Go uses
bench.PlatformFile{Name: "cases.csv", Content: data}; Rust uses
PlatformFile { name: "cases.csv".into(), content: data }. Binary XLSX uploads
retain their bytes. Context documents are limited to 60 KB; datasets to 4 MB;
prompt uploads to 2 MB in total.
Save understanding and run a bench
context_changed error requires re-reading and reconciling the saved version.
Do not blindly retry a write. Use the test-library MCP tools or the documented
context-source contract to add golden cases and criteria. Historical reports
retain the evidence used at the time of evaluation.
Add test cases and criteria
Save each entry as a versioned context source. Use a component ID returned byget_system, preserve structured expected values, and re-read the context version
before each write. For example:
manual-library-… ID, category rules_constraints,
scope system, and JSON text with type: 'criterion', component_id, enabled,
statement, pass_condition and fail_condition. Reuse the same source ID to
edit or pause it. Setting enabled: false pauses an entry; delete_context_source
removes it. These edits affect future evaluations, not historical reports.
Publish real app results
Execute your real app with the existing SDK evaluation API, then callpublishSystemEvaluation / publish_system_evaluation on the tracing client or
publish_runtime_evaluation on the platform client with the complete report as
body. See Real app testing. Reading or publishing a
report does not execute the application or start a paid Bench evaluation.
Errors, streams and cancellation
Clients preserve API errorstatus, code, message and reference, plus the
complete server error in details (Details in Go). Plan-limit errors include
pricing_url, upgrade_url, billing_url and payment_confirmation_required.
Show the upgrade link to the developer; completing payment remains their choice.
API-key cap errors instead include manage_key_url, since a plan upgrade does
not change that cap. A plan,
credential or repository error needs an account/configuration change. A response
larger than 16 MB requires a smaller page. HTTP redirects are not followed with
credentials. Endpoints must use HTTPS, except loopback HTTP during local tests.
Legacy stage endpoints return NDJSON: the platform client returns the full event
array and raises an error for a terminal error event. Prefer background evaluation
runs and explicit polling for long work. TypeScript accepts an AbortSignal, Go
accepts a context, and dropping the Rust future cancels its request. Python calls
are synchronous. The default request timeout is 120 seconds.

