Developers

API reference

Genisys Developer API 1.0.0, generated from contracts/developer-api.v1.json when this site is built.

Local API served by the Genisys desktop app on 127.0.0.1 (off until enabled in the Developer console). Authenticate with an API key: Authorization: Bearer gsk_test_… (test mode) or gsk_live_… (production). Test keys see Test, Preview and Production plugins and their runs are marked test; live keys see Production plugins only. Every key has scopes, optional project limits, a per-minute rate limit and optional daily/monthly token budgets.

Base URL: http://127.0.0.1:4319 (Default local port (configurable in the Developer console)). Authentication: Authorization: Bearer gsk_test_… or gsk_live_….

GET /v1/projects

Projects this key may use (scope projects:read)

operationId
listProjects
Scope
projects:read

Request body

No body.

Response 200: OK (application/json)

FieldTypeRequiredNotes
dataarray of Projectyes

Errors: the error envelope with any of its codes.

POST /v1/runs

Start an agent run and wait for it to finish (scope runs:write). Counts against the key's token budget.

operationId
createRun
Scope
runs:write

Parameters

NameInTypeRequiredNotes
Idempotency-Keyheaderstringnomax length 100

Request body (application/json, required)

FieldTypeRequiredNotes
projectIdstringyes
promptstringyesmax length 20000
agentIdstringno

Response 200: Finished run (application/json)

FieldTypeRequiredNotes
(body)Runyes

Errors: the error envelope with any of its codes.

GET /v1/runs/{id}

A run started with this key (scope runs:read)

operationId
getRun
Scope
runs:read

Parameters

NameInTypeRequiredNotes
idpathstringyes

Request body

No body.

Response 200: OK (application/json)

FieldTypeRequiredNotes
(body)Runyes

Errors: the error envelope with any of its codes.

GET /v1/usage

This key's token use today and this month, with its budgets (scope usage:read)

operationId
getUsage
Scope
usage:read

Request body

No body.

Response 200: OK (application/json)

FieldTypeRequiredNotes
todayUsageyes
monthUsageyes
budgetobjectyes
budget.dailyTokensinteger | nullno
budget.monthlyTokensinteger | nullno

Errors: the error envelope with any of its codes.

GET /v1/plugins

Plugins this key can invoke (scope plugins:invoke)

operationId
listPlugins
Scope
plugins:invoke

Request body

No body.

Response 200: OK (application/json)

FieldTypeRequiredNotes
dataarray of Pluginyes

Errors: the error envelope with any of its codes.

POST /v1/plugins/{id}/invoke

Run one plugin tool in the sandbox (scope plugins:invoke)

operationId
invokePlugin
Scope
plugins:invoke

Parameters

NameInTypeRequiredNotes
idpathstringyes

Request body (application/json, required)

FieldTypeRequiredNotes
toolstringyes
inputobjectyes

Response 200: OK (application/json)

FieldTypeRequiredNotes
(body)InvokeResultyes

Errors: the error envelope with any of its codes.

Errors

Every failure has the body { "error": { "code": string, "message": string } }. Branch on the code; the message is written for people.

CodeMeaning
unauthorizedNo key, an unknown key, or a revoked key.
forbiddenThe key lacks the operation’s scope, or the project is outside the key’s project limit.
not_foundThe run or plugin does not exist for this key.
invalid_requestThe request body or parameters do not match this reference.
budget_exceededThe key’s daily or monthly token budget is spent.
rate_limitedThe key made more requests in the last minute than its per-minute limit.
plugin_failedThe plugin tool threw, timed out or returned output that is too large.
internalSomething failed inside Genisys.

Schemas

Error

FieldTypeRequiredNotes
errorobjectyes
error.codestringyesone of: unauthorized, forbidden, not_found, invalid_request, budget_exceeded, rate_limited, plugin_failed, internal
error.messagestringyes

Project

FieldTypeRequiredNotes
idstringyes
namestringyes
descriptionstringno
dataModestringyesone of: local-only, cloud-allowed

Usage

FieldTypeRequiredNotes
inputTokensintegeryes
outputTokensintegeryes
totalintegeryes
callsintegeryes

Run

FieldTypeRequiredNotes
idstringyes
projectIdstringyes
agentIdstring | nullno
statusstringyesone of: queued, running, succeeded, failed, cancelled, paused
outputstring | nullyes
failurestring | nullno
usageUsageyes
testbooleanyes
createdAtstringyesformat date-time

Plugin

FieldTypeRequiredNotes
idstringyes
namestringyes
versionstringyes
stagestringyesone of: test, preview, production
toolsarray of objectyes
tools[].namestringyes
tools[].descriptionstringyes
tools[].inputobjectno

InvokeResult

FieldTypeRequiredNotes
outputany JSONyes
logsarray of stringyes
msintegeryes