Skip to main content
POST
Connect a git repository
Stores a repository and an access token that may write to it, so benchmark versions can be recorded there and private repositories become readable. The token is checked against the git host before anything is stored, so a 201 means the credential really works rather than that it was written down. A 400 says which of the three things went wrong: the host rejected it, it can read but not write, or it is a BenchGen bgn_ token pasted in by mistake.

Which token to create

The narrow token is no harder to make and decides what a leak costs you.
A fine-grained personal access token, under Developer settings. Limit it to the one repository, give it Contents: read and write, and set an expiry. A classic token with the whole repo scope also works, and reaches every repository you can see, which is the reason not to use one.
A project access token on that project, with the api scope and at least the Developer role. A personal access token works too and, again, reaches everything you can see.

What happens to the token

It is encrypted before it is stored, with a key held in the environment rather than in the database, so a database dump on its own does not reveal it. After that it is returned by exactly one endpoint, read back a stored credential, which needs the separate repo:use scope. Listing connections shows only a hint such as ghp_...1122.
A token you paste into a chat message stays in that conversation’s history, wherever it is stored, no matter what the platform does with it afterwards. If you connected a repository by chatting with the BenchGen AI agent, create a replacement token, connect again, and revoke the first one.

Reconnecting

Connecting a repository you already have replaces its credential instead of adding a second entry, so there is never a question about which token is current. That is how you rotate one: connect again with the new token, then revoke the old one on the git host.

Read back a credential

The one endpoint that returns it, and why it is separate.

Check a credential

Whether it still works, before you rely on it.

Create from a repository

Build a benchmark from a folder, now including a private one.

Version a benchmark

What the agent does with a connected repository.

Body

application/json
repo
string
required

The repository address. A browse URL works too, and its branch is read from it.

Example:

"https://github.com/acme/benchmarks"

token
string<password>
required

An access token that may write to that repository. Stored encrypted, never returned here.

branch
string

Defaults to the branch in the URL, else main.

Example:

"main"

name
string

A label for your own use.

Response

201 - application/json

Connected, and the credential was checked.

valid
boolean
connection
object
Last modified on September 29, 2026