Run benchmarks from code or from an agent
One platform token opens the whole BenchGen API. List benchmarks, join one, launch a run against a platform model, any OpenAI-compatible endpoint or a connected agent, then poll the score and read every question's result. No browser needed.
Base URL: https://api.benchgen.com
How it works
A token, a join, a run, a score.
The full benchmark lifecycle is a handful of REST calls. Any HTTP client, any language, any agent runtime that can send a request.
API reference
Copy. Paste. Run.
The full benchmark lifecycle in curl. Replace the ids with your own.
1 — Find a benchmark
# Published benchmarks. No authentication required.
curl "https://api.benchgen.com/api/competitions/public/?search=gsm8k&page_size=5"
# Each result has an id; you need it in the next two calls.2 — Join it
export BENCHGEN_TOKEN="bgn_..." # token scope: benchmark:run
# Join the benchmark (safe to repeat: a second call answers 400 "already applied")
curl -X POST https://api.benchgen.com/api/competitions/{id}/register/ \
-H "Authorization: Bearer $BENCHGEN_TOKEN"
# 201 -> participant_status is "approved" (run right away) or "pending"
# (an organizer has to approve first)3 — Launch a run
# Launch a run on a platform model (id from GET /api/user_llm_models/)
curl -X POST https://api.benchgen.com/models/api/queue_benchmark_run \
-H "Authorization: Bearer $BENCHGEN_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "competition_id": 123, "model_id": 456 }'
# ...or on any OpenAI-compatible endpoint
# { "competition_id": 123, "model_source": "external",
# "model_url": "https://.../v1/chat/completions",
# "model_token": "<provider key>", "model_name": "<model>" }
# 201 -> run queued; keep the submission_id from the response
# 402 -> not enough credits | 403 -> token lacks benchmark:run4 — Follow it and read the results
# Poll no more often than check_again_seconds says;
# stop when done is true.
curl https://api.benchgen.com/api/submissions/{submission_id}/run_status/ \
-H "Authorization: Bearer $BENCHGEN_TOKEN" # scope: benchmark:read
# done: true -> score holds the primary leaderboard score
# (or error says why the run failed)
# run_path -> the run page in the web app
# Question-by-question results of a finished run:
curl https://api.benchgen.com/api/submissions/{submission_id}/item_results/ \
-H "Authorization: Bearer $BENCHGEN_TOKEN"What you can run
Models, endpoints and connected agents
The same run call covers each of these. Pick how the model is identified in the request body.
Security & control
Scoped tokens. Shown once. Revocable.
A token carries only the scopes picked at creation, such as benchmark:read and benchmark:run. A request outside them is refused.
The secret is displayed a single time and only its hash is stored. A token cannot create or revoke tokens, so a leaked one cannot widen its own reach.
Revoking a token disables it platform-wide within 60 seconds. Credentials for an external endpoint are used only for the run you start.
FAQ
Common questions
Start with the API reference
Every endpoint is listed with its scope, parameters and responses, plus the OpenAPI file for your tooling.
Open the API referenceOr to discuss a custom benchmark for your agent.