Skip to content

Start a game run

POST
/api/runs
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.

Media typeapplication/json
object
exportToArena
boolean
prompt
required
string
test
string
default: ab
Allowed values: ab bc ad ce
capMinutes
number
default: 20
Allowed value: 20
idempotencyKey
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
start
Any of:
object
references
required
Array<string>
referenceImage
object
sha256
required
string
/^[0-9a-f]{64}$/
type
required
string
Allowed values: image/png image/jpeg image/webp
bytes
required
integer
>= 1 <= 3750000
width
required
integer
>= 1 <= 2000
height
required
integer
>= 1 <= 2000
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>
unique items
Allowed values: settings achievements local-high-scores health save-game leveling currency inventory equipment loot-tables wave-spawner quests bestiary pets platformer-controller turn-manager base-building crafting local-best-scores
mixer
object
graphics
required
integer
<= 10
creativity
required
integer
<= 10
playtime
required
integer
<= 2
dimensionTrim
required
integer
>= -2 <= 2

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
Allowed values: left right

Example

{
"patchParent": {
"side": "left"
}
}

Invalid request or image metadata.

Sign-in required.

Insufficient Credit.

This account cannot start this run.

The source is unavailable to this caller.

An active run or conflicting idempotency key.

The request body is too large.