Start a game run
POST
/api/runs
const url = 'https://coggs.ai/api/runs';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"exportToArena":true,"prompt":"example","test":"ab","capMinutes":20,"idempotencyKey":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","start":{"references":["example"]},"referenceImage":{"sha256":"example","type":"image/png","bytes":1,"width":1,"height":1},"systems":["settings"],"mixer":{"graphics":1,"creativity":1,"playtime":1,"dimensionTrim":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://coggs.ai/api/runs \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "exportToArena": true, "prompt": "example", "test": "ab", "capMinutes": 20, "idempotencyKey": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "start": { "references": [ "example" ] }, "referenceImage": { "sha256": "example", "type": "image/png", "bytes": 1, "width": 1, "height": 1 }, "systems": [ "settings" ], "mixer": { "graphics": 1, "creativity": 1, "playtime": 1, "dimensionTrim": 1 } }'Sign in with an eligible account. Upload an optional reference image first and pass its returned descriptor. Reuse the same idempotencyKey when retrying this request.
Authorizations
섹션 제목: “Authorizations”Request Bodyrequired
섹션 제목: “Request Bodyrequired”Media typeapplication/json
object
exportToArena
boolean
prompt
required
string
test
string
capMinutes
number
idempotencyKey
required
string format: uuid
start
referenceImage
object
sha256
required
string
type
required
string
bytes
required
integer
width
required
integer
height
required
integer
systems
Game Systems for the new run. Omit it and the Patch keeps the systems of the run it patches. Accepted aliases, stored as the current id: local-best-scores for local-high-scores.
Array<string>
mixer
object
graphics
required
integer
creativity
required
integer
playtime
required
integer
dimensionTrim
required
integer
Responses
섹션 제목: “Responses”201
섹션 제목: “201”The new or previously admitted run.
Media typeapplication/json
The owner’s PublicRun, including patchParent when created by Patch.
object
id
required
string format: uuid
patchParent
object
run
required
string format: uuid
side
required
Example
{ "patchParent": { "side": "left" }}400
섹션 제목: “400”Invalid request or image metadata.
401
섹션 제목: “401”Sign-in required.
402
섹션 제목: “402”Insufficient Credit.
403
섹션 제목: “403”This account cannot start this run.
404
섹션 제목: “404”The source is unavailable to this caller.
409
섹션 제목: “409”An active run or conflicting idempotency key.
413
섹션 제목: “413”The request body is too large.