{"components":{"schemas":{"Error":{"description":"Every non-2xx response. `code` is the stable, machine-readable part (e.g. UNAUTHORIZED, BAD_REQUEST); `message` is for humans.","properties":{"code":{"type":"string"},"data":{"description":"Code-specific detail, e.g. validation issues for BAD_REQUEST."},"defined":{"type":"boolean"},"message":{"type":"string"}},"required":["code","message"],"type":"object"},"__schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/__schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}}]},"JsonValue":{"$ref":"#/components/schemas/__schema0"}},"securitySchemes":{"apiKeyHeader":{"description":"An API key (`vg_…`) created with apiKeys.create or in the web app settings.","in":"header","name":"x-api-key","type":"apiKey"},"bearerAuth":{"description":"An OAuth access token for the API (what `vg login` saves), a session token, or an API key (`vg_…`, what `VG_TOKEN` should hold).","scheme":"bearer","type":"http"},"sessionCookie":{"description":"better-auth session cookie, set by signing in at /auth/login.","in":"cookie","name":"__Secure-better-auth.session_token","type":"apiKey"}}},"externalDocs":{"description":"Developer docs","url":"https://www.vibedgames.com/docs"},"info":{"contact":{"email":"kai@kyh.io","url":"https://www.vibedgames.com/contact"},"description":"The Vibedgames platform API: deploy browser games, generate assets, run playtests. The `vg` CLI is the reference client.\n\nEvery operation is a POST with a JSON body under /api/v1; errors are JSON with a stable `code` and a `message`.\n\nThe same procedures are also served at `POST /api/orpc/<router>/<procedure>` in oRPC's own wire format (body wrapped as `{\"json\": …}`), which the CLI and web app use.\n\nOperations without a security requirement are public. The rest take a session cookie, a bearer token from `vg login`, or an API key (`vg_…`); a few refuse API keys and need a real session.","license":{"name":"MIT","url":"https://github.com/kyh/vibedgames/blob/main/LICENSE"},"title":"Vibedgames API","version":"1.0.0"},"servers":[{"url":"https://www.vibedgames.com/api/v1"}],"openapi":"3.1.1","paths":{"/admin/credits/balances":{"post":{"operationId":"admin.credits.balances","summary":"List credit balances","description":"Returns every user's credit balance in micro-USD. A user with no ledger rows is absent and holds nothing. Admin only.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"balances":{"type":"array","items":{"type":"object","properties":{"balanceMicro":{"type":"number"},"userId":{"type":"string"}},"required":["balanceMicro","userId"],"additionalProperties":false}}},"required":["balances"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/admin/credits/grant":{"post":{"operationId":"admin.credits.grant","summary":"Grant credits","description":"Grants (positive) or claws back (negative) credits in dollars. The client-minted `key` makes retries idempotent. Admin only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amountUsd":{"type":"number","minimum":-1000,"maximum":1000},"key":{"type":"string","format":"uuid","pattern":"^([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)$"},"note":{"type":"string","maxLength":500},"userId":{"type":"string","minLength":1}},"required":["amountUsd","key","userId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"balanceMicro":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["balanceMicro"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/admin/users/create":{"post":{"operationId":"admin.users.create","summary":"Create a user","description":"Creates a user who signs in with a code emailed to their address, or a social provider using it. Admin only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1,"maxLength":100},"role":{"default":"user","type":"string","enum":["user","admin"]}},"required":["email","name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"banExpires":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"banReason":{"type":["string","null"]},"banned":{"type":["boolean","null"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"id":{"type":"string"},"image":{"type":["string","null"]},"name":{"type":"string"},"role":{"type":["string","null"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"}},"required":["createdAt","email","emailVerified","id","name","updatedAt"],"additionalProperties":false}},"required":["user"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/admin/users/list":{"post":{"operationId":"admin.users.list","summary":"List users","description":"Lists the 100 most recently created users. Admin only.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"total":{"type":"number"},"users":{"type":"array","items":{"type":"object","properties":{"banExpires":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"banReason":{"type":["string","null"]},"banned":{"type":["boolean","null"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"id":{"type":"string"},"image":{"type":["string","null"]},"name":{"type":"string"},"role":{"type":["string","null"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"}},"required":["createdAt","email","emailVerified","id","name","updatedAt"],"additionalProperties":false}}},"required":["total","users"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/apiKeys/create":{"post":{"operationId":"apiKeys.create","summary":"Create an API key","description":"Mints an API key (`vg_…`) for CI and headless agents. The raw `key` is returned only in this response. Needs a real session; an API key cannot mint keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expiresInDays":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"id":{"type":"string"},"keyPrefix":{"type":"string"},"name":{"type":["string","null"]},"key":{"type":"string"}},"required":["createdAt","expiresAt","id","keyPrefix","name","key"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/apiKeys/list":{"post":{"operationId":"apiKeys.list","summary":"List API keys","description":"Lists the caller's API keys by prefix, never the raw key. Needs a real session.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"id":{"type":"string"},"keyPrefix":{"type":"string"},"name":{"type":["string","null"]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]}},"required":["createdAt","expiresAt","id","keyPrefix","name","lastUsedAt"],"additionalProperties":false}}},"required":["keys"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/apiKeys/revoke":{"post":{"operationId":"apiKeys.revoke","summary":"Revoke an API key","description":"Deletes one of the caller's API keys. Needs a real session.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The referenced resource does not exist."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/auth/createInvites":{"post":{"operationId":"auth.createInvites","summary":"Create credit codes","description":"Creates one custom credit code or a batch of random ones, each worth `creditUsd` per redemption. Admin only; 409 when a custom code already exists.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"default":null,"anyOf":[{"type":"string","pattern":"^[A-Z0-9]{6}$","description":"6 letters or digits; surrounding whitespace is trimmed and letters are upper-cased first."},{"type":"null"}]},"count":{"default":1,"type":"integer","minimum":1,"maximum":100},"creditUsd":{"default":20,"type":"number","exclusiveMinimum":0,"maximum":1000},"expiresAt":{"default":null,"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"maxUses":{"default":1,"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"note":{"default":null,"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"codes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"createdBy":{"type":["string","null"]},"creditMicro":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Credit one redemption grants, in micro-USD."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"id":{"type":"string"},"maxUses":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"null means unlimited uses."},"note":{"type":["string","null"]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"usedCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code","createdAt","createdBy","creditMicro","expiresAt","id","maxUses","note","revokedAt","usedCount"],"additionalProperties":false}}},"required":["codes"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request conflicts with existing state."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/auth/listInvites":{"post":{"operationId":"auth.listInvites","summary":"List credit codes","description":"Lists every credit code, newest first, with its creator's email. Admin only.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"codes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"createdBy":{"type":["string","null"]},"creditMicro":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Credit one redemption grants, in micro-USD."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"id":{"type":"string"},"maxUses":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"null means unlimited uses."},"note":{"type":["string","null"]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"usedCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creatorEmail":{"type":["string","null"]}},"required":["code","createdAt","createdBy","creditMicro","expiresAt","id","maxUses","note","revokedAt","usedCount","creatorEmail"],"additionalProperties":false}}},"required":["codes"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/auth/me":{"post":{"operationId":"auth.me","summary":"Get the current user","description":"Returns the authenticated identity, whether the caller used a session cookie, a session token, an API key or an OAuth token. An OAuth token sees `email` only with the `email` scope, and `role` never. Backs `vg whoami`.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"role":{"type":["string","null"]}},"required":["email","id","name","role"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/auth/updateInvite":{"post":{"operationId":"auth.updateInvite","summary":"Update a credit code","description":"Revokes, un-revokes, or changes the use limit or value of a credit code. Omitted fields are left untouched. Admin only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"creditUsd":{"type":"number","exclusiveMinimum":0,"maximum":1000},"id":{"type":"string"},"maxUses":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"revoked":{"type":"boolean"}},"required":["id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"object","properties":{"code":{"type":"string"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"createdBy":{"type":["string","null"]},"creditMicro":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Credit one redemption grants, in micro-USD."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"id":{"type":"string"},"maxUses":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"null means unlimited uses."},"note":{"type":["string","null"]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"usedCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code","createdAt","createdBy","creditMicro","expiresAt","id","maxUses","note","revokedAt","usedCount"],"additionalProperties":false}},"required":["code"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The referenced resource does not exist."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/connectedApps/list":{"post":{"operationId":"connectedApps.list","summary":"List connected apps","description":"Lists the apps the caller has approved over OAuth, consented to or still holding a refresh token (as `vg login` does), with the scopes each was granted. Needs a real session.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"apps":{"type":"array","items":{"type":"object","properties":{"clientId":{"type":"string"},"connectedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"name":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"uri":{"type":["string","null"]}},"required":["clientId","connectedAt","name","scopes","uri"],"additionalProperties":false}}},"required":["apps"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/connectedApps/revoke":{"post":{"operationId":"connectedApps.revoke","summary":"Disconnect an app","description":"Disconnects an app: deletes the caller's consent to it and every refresh token it holds, so it can mint no further access. An access token it already holds lasts until it expires, at most an hour. Needs a real session.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","minLength":1}},"required":["clientId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string"}},"required":["clientId"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The referenced resource does not exist."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]}]}},"/credits/checkout":{"post":{"operationId":"credits.checkout","summary":"Buy credits","description":"Starts a card payment for `amountUsd` of generation credit and returns a hosted checkout URL for a person to open. The credit lands once the payment clears, usually within seconds of paying. 412 while card purchases aren't open (`purchasesEnabled` is false on `credits.me`).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amountUsd":{"type":"integer","minimum":5,"maximum":500,"description":"Whole dollars of credit to buy, 5–500. One dollar paid is one dollar of credit."}},"required":["amountUsd"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/credits/me":{"post":{"operationId":"credits.me","summary":"Get your credit balance","description":"Returns the caller's generation credit balance in micro-USD (1,000,000 = $1), their 100 most recent ledger entries, whether card purchases are open, and whether the caller must confirm their email before redeeming a code.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"balanceMicro":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"entries":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"deltaMicro":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed micro-USD: positive is a grant or refund."},"endpointId":{"type":["string","null"]},"id":{"type":"string"},"kind":{"type":"string","enum":["signup_grant","admin_grant","code_redeem","purchase","generation_hold","generation_settle","generation_release"]},"note":{"type":["string","null"]},"requestId":{"type":["string","null"]}},"required":["createdAt","deltaMicro","endpointId","id","kind","note","requestId"],"additionalProperties":false}},"mustVerifyEmail":{"type":"boolean","description":"True until the caller confirms their email address; `credits.redeem` answers 412 meanwhile."},"purchasesEnabled":{"type":"boolean","description":"Whether `credits.checkout` takes card payments; when false, credit comes from codes."}},"required":["balanceMicro","entries","mustVerifyEmail","purchasesEnabled"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/credits/redeem":{"post":{"operationId":"credits.redeem","summary":"Redeem a credit code","description":"Redeems a credit code for the caller, adding its value to their balance. Each account can redeem a given code once. 403 when the code is unknown, expired, revoked or used up; 409 when this account already redeemed it; 412 until the account's email address is confirmed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"description":"The credit code to redeem, as you were given it, e.g. `ABC123`; case and surrounding spaces don't matter"}},"required":["code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"balanceMicro":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditedMicro":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["balanceMicro","creditedMicro"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request conflicts with existing state."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/deploy/create":{"post":{"operationId":"deploy.create","summary":"Create a deployment","description":"Legacy: what `vg` up to this release called; use deploy.upload. Starts a deployment of a built game to `{slug}.vibedgames.com`, replacing the previous one at once. Returns a signed PUT URL per file (and for the optional source archive); upload each, then call deploy.finalize. 403 when the slug belongs to someone else.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","minLength":1,"maxLength":127},"path":{"type":"string","minLength":1,"maxLength":512,"description":"The file's path from the game's root, e.g. `index.html` or `assets/hero.png`; no leading `/` and no `..`"},"sha256":{"type":"string","minLength":64,"maxLength":64,"description":"The SHA-256 of the file's bytes as 64 hex characters, as `sha256sum` prints it"},"size":{"type":"integer","minimum":0,"maximum":10485760,"description":"The file's exact size in bytes, at most 10485760 (10 MB); publish checks the uploaded file has this size"}},"required":["contentType","path","sha256","size"]}},"name":{"type":"string","maxLength":120},"slug":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$"},"source":{"type":"object","properties":{"bytes":{"type":"integer","exclusiveMinimum":0,"maximum":104857600},"sha256":{"type":"string","minLength":64,"maxLength":64}},"required":["bytes","sha256"]}},"required":["files","slug"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deploymentId":{"type":"string"},"gameId":{"type":"string"},"sourceUpload":{"anyOf":[{"type":"object","properties":{"headers":{"type":"object","properties":{"content-type":{"type":"string"}},"required":["content-type"],"additionalProperties":false},"url":{"type":"string"}},"required":["headers","url"],"additionalProperties":false},{"type":"null"}]},"uploads":{"type":"array","items":{"type":"object","properties":{"headers":{"type":"object","properties":{"content-type":{"type":"string"}},"required":["content-type"],"additionalProperties":false},"url":{"type":"string"},"path":{"type":"string"}},"required":["headers","url","path"],"additionalProperties":false}}},"required":["deploymentId","gameId","sourceUpload","uploads"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/deploy/delete":{"post":{"operationId":"deploy.delete","summary":"Delete a game","description":"Permanently deletes one of the caller's games and all of its deployed files.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"gameId":{"type":"string","description":"The id of one of your games: a game's `id` in the deployments list, or the `gameId` deploy returned"}},"required":["gameId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The referenced resource does not exist."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/deploy/finalize":{"post":{"operationId":"deploy.finalize","summary":"Finalize a deployment","description":"Legacy, with deploy.create: marks an uploaded deployment ready and makes it the live version of its game. Returns the public URL.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deploymentId":{"type":"string"}},"required":["deploymentId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"url":{"type":"string"}},"required":["slug","url"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The referenced resource does not exist."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/deploy/getSource":{"post":{"operationId":"deploy.getSource","summary":"Get a game's source","description":"Returns a one-hour download URL for a game's forkable source archive. Any signed-in user may fork any game that shipped source. Backs `vg fork`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$","description":"The slug of the game to fork, as in its address `{slug}.vibedgames.com`, e.g. `space-pong`; any game deployed with source can be forked"}},"required":["slug"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":["string","null"]},"slug":{"type":"string"},"url":{"type":"string"}},"required":["bytes","name","slug","url"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The referenced resource does not exist."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/deploy/list":{"post":{"operationId":"deploy.list","summary":"List your games","description":"Lists the caller's games, most recently updated first, each with its live deployment.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"games":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"currentDeploymentId":{"type":["string","null"]},"deployment":{"anyOf":[{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"fileCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"id":{"type":"string"},"status":{"type":"string","enum":["pending","ready","failed"]},"totalBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["createdAt","fileCount","id","status","totalBytes"],"additionalProperties":false},{"type":"null"}]},"id":{"type":"string"},"name":{"type":["string","null"]},"slug":{"type":"string"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"userId":{"type":"string"}},"required":["createdAt","currentDeploymentId","deployment","id","name","slug","updatedAt","userId"],"additionalProperties":false}}},"required":["games"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/deploy/upload":{"post":{"operationId":"deploy.upload","summary":"Upload files inline and deploy","description":"Deploys a game. The usual way: pass `bundle: true`, PUT a gzipped tar of the built game (`tar -czf game.tgz -C dist .`, `index.html` at its root) to the `bundleUpload` URL it returns, then call again with the `deploymentId` and `publish: true`; publish unpacks it. Files can also be given one by one: `files` carries `utf-8` text, or with `encoding: url` the URL of an asset generate made, which the server fetches itself (up to 32 MB a call); `presign` takes a file's path, size and SHA-256 and returns a signed PUT URL for it in `uploads`. Upload URLs are on this server and last 15 minutes. A call without `deploymentId` stages a new deployment beside the live one; later calls pass it back to add or replace files. `publish: true` requires `index.html` and every presigned file at its declared size, makes the deployment live at `{slug}.vibedgames.com` and only then removes the previous one, so the game never goes dark mid-upload. With `source: true` publish also keeps the deployment's files as the game's forkable source (up to 64 MB); a caller with its own source archive passes `sourceArchive` instead and PUTs it to `sourceUpload`. 403 when the slug belongs to someone else.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bundle":{"default":false,"description":"true returns a `bundleUpload` URL to PUT the whole built game to as one gzipped tar, `index.html` at its root (`tar -czf game.tgz -C dist .`); a later call with `publish: true` unpacks it. The usual way in. Default false","type":"boolean"},"deploymentId":{"description":"The `deploymentId` an earlier deploy call for this slug returned, to add files to that staged deployment or publish it; omit to stage a new one","type":"string"},"files":{"default":[],"description":"Files sent in the call itself: text, or a generated asset's URL with `encoding: url`. A path already staged is replaced. Default none","maxItems":500,"type":"array","items":{"type":"object","properties":{"content":{"type":"string","description":"The file's text, or with `encoding: url` a generated asset's URL"},"contentType":{"description":"The MIME type to serve the file with, e.g. `text/html; charset=utf-8`; omit to infer it from the path's extension","type":"string","minLength":1,"maxLength":127},"encoding":{"default":"utf-8","description":"How to read `content`: `utf-8` (the default) stores it as the file's text; `url` fetches it from a URL a generate tool returned (other hosts are refused), up to 10 MB a file and 32 MB a call","type":"string","enum":["utf-8","url"]},"path":{"type":"string","minLength":1,"maxLength":512,"description":"The file's path from the game's root, e.g. `index.html` or `assets/hero.png`; no leading `/` and no `..`"}},"required":["content","path"]}},"name":{"description":"The game's display name, up to 120 characters, e.g. `Space Pong`; omit to keep the name it has","type":"string","maxLength":120},"presign":{"default":[],"description":"Files you PUT yourself: each returns a signed URL in `uploads`, valid 15 minutes, to PUT its bytes to with the `headers` given; list a file again to renew its URL. Default none","maxItems":500,"type":"array","items":{"type":"object","properties":{"contentType":{"description":"The MIME type to serve the file with, and the Content-Type to PUT it with, e.g. `image/png`; omit to infer it from the path's extension","type":"string","minLength":1,"maxLength":127},"path":{"type":"string","minLength":1,"maxLength":512,"description":"The file's path from the game's root, e.g. `index.html` or `assets/hero.png`; no leading `/` and no `..`"},"sha256":{"type":"string","minLength":64,"maxLength":64,"description":"The SHA-256 of the file's bytes as 64 hex characters, as `sha256sum` prints it"},"size":{"type":"integer","minimum":0,"maximum":10485760,"description":"The file's exact size in bytes, at most 10485760 (10 MB); publish checks the uploaded file has this size"}},"required":["path","sha256","size"]}},"publish":{"default":false,"description":"true makes the staged deployment live at `{slug}.vibedgames.com` once this call's files are in (it needs `index.html` and every presigned file at its declared size), then removes the previous one. Default false: the files stay staged","type":"boolean"},"slug":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$","description":"The game's slug, which makes its address `{slug}.vibedgames.com`: 3 to 40 lowercase letters, digits and hyphens, no hyphen at either end, e.g. `space-pong`. A new slug becomes your game, one another account owns is refused; pass the same one on every call of a deployment"},"source":{"default":false,"description":"With `publish: true`, also keep the deployment's files (up to 64 MB) as the game's forkable source, which fork downloads. Default false; not with `sourceArchive`","type":"boolean"},"sourceArchive":{"description":"Your own forkable source archive (a .tar.gz of the project, what `vg deploy --source` packs), which you PUT to the `sourceUpload` URL this call returns; omit for none. Not with `source: true`","type":"object","properties":{"bytes":{"type":"integer","exclusiveMinimum":0,"maximum":104857600,"description":"The archive's exact size in bytes, at most 104857600 (100 MB); publish checks the upload has this size"},"sha256":{"type":"string","minLength":64,"maxLength":64,"description":"The SHA-256 of the archive's bytes as 64 hex characters"}},"required":["bytes","sha256"]}},"required":["slug"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"bundleUpload":{"anyOf":[{"type":"object","properties":{"headers":{"type":"object","properties":{"content-type":{"type":"string"}},"required":["content-type"],"additionalProperties":false},"url":{"type":"string"}},"required":["headers","url"],"additionalProperties":false},{"type":"null"}]},"deploymentId":{"type":"string"},"fileCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gameId":{"type":"string"},"published":{"type":"boolean"},"sourceUpload":{"anyOf":[{"type":"object","properties":{"headers":{"type":"object","properties":{"content-type":{"type":"string"}},"required":["content-type"],"additionalProperties":false},"url":{"type":"string"}},"required":["headers","url"],"additionalProperties":false},{"type":"null"}]},"totalBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uploads":{"type":"array","items":{"type":"object","properties":{"headers":{"type":"object","properties":{"content-type":{"type":"string"}},"required":["content-type"],"additionalProperties":false},"url":{"type":"string"},"path":{"type":"string"}},"required":["headers","url","path"],"additionalProperties":false}},"url":{"type":["string","null"]}},"required":["bundleUpload","deploymentId","fileCount","gameId","published","sourceUpload","totalBytes","uploads","url"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The referenced resource does not exist."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/animate3d":{"post":{"operationId":"generate.animate3d","summary":"Rig and animate a 3D character","description":"Rigs a humanoid character GLB, e.g. one generate 3d made, and bakes animation clips onto that one skeleton: a GLB per `animation_action_ids` entry from Meshy's animation library, plus walking and running (Meshy rigging: `meshy/rigging/multi-animation`). The 3d reference of the model-catalog skill lists the clip ids games use. Billed against your credits; waits up to `wait_seconds`, then returns the `request_id` to follow with generate status. Backs `vg generate animate-3d`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"animation_action_ids":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"integer","minimum":0,"maximum":696},"description":"Up to 10 clips from Meshy's animation library, one GLB each, e.g. 0 for Idle"},"height_meters":{"description":"The character's height, 1.7 by default","type":"number","exclusiveMinimum":0,"maximum":100},"model_url":{"type":"string","format":"uri","description":"The character's GLB, e.g. generate 3d's model_glb"},"options":{"default":{},"description":"Any other input the model takes, per generate schema of its endpoint; the fields above win","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}},"wait_seconds":{"default":20,"description":"How long to wait for the result before returning the request id","type":"integer","minimum":0,"maximum":25}},"required":["animation_action_ids","model_url"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string"},"request_id":{"type":"string"},"result":{"description":"The model's output once COMPLETED, else null.","$ref":"#/components/schemas/JsonValue"},"status":{"type":"string","description":"`IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED` or `CANCELLED`"}},"required":["endpoint_id","request_id","result","status"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body or a field in it is over its size limit."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/image":{"post":{"operationId":"generate.image","summary":"Generate an image","description":"Generates images from a prompt, or edits and combines reference images when `image_urls` is given (GPT Image 2.5: `openai/gpt-image-2.5/flare/text-to-image`, `openai/gpt-image-2.5/flare/edit`). `background: transparent` makes sprites and props with no background to remove. Billed against your credits; waits up to `wait_seconds`, then returns the `request_id` to follow with generate status. Backs `vg generate image`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"background":{"description":"`transparent` leaves no background, for sprites and props; `opaque` always fills one; `auto` lets the model choose. Omit for the model's default","type":"string","enum":["auto","transparent","opaque"]},"image_size":{"description":"A preset; pass `{width, height}` through options for an exact size","type":"string","enum":["auto","square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"]},"image_urls":{"description":"Images to edit or combine","minItems":1,"maxItems":16,"type":"array","items":{"type":"string","format":"uri","description":"An image's URL, e.g. from generate upload"}},"num_images":{"description":"How many images to make from the one prompt, 1 to 4; omit for the model's default","type":"integer","minimum":1,"maximum":4},"options":{"default":{},"description":"Any other input the model takes, per generate schema of its endpoint; the fields above win","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}},"prompt":{"type":"string","minLength":1,"maxLength":5000,"description":"What to draw, or with image_urls how to edit or combine them, up to 5,000 characters, e.g. `pixel-art knight sprite, side view`"},"quality":{"description":"Rendering quality from `low` (quick drafts) to `max`; higher takes longer and may cost more (see generate pricing). `auto` lets the model choose; omit for the model's default","type":"string","enum":["auto","low","medium","high","xhigh","max"]},"wait_seconds":{"default":20,"description":"How long to wait for the result before returning the request id","type":"integer","minimum":0,"maximum":25}},"required":["prompt"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string"},"request_id":{"type":"string"},"result":{"description":"The model's output once COMPLETED, else null.","$ref":"#/components/schemas/JsonValue"},"status":{"type":"string","description":"`IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED` or `CANCELLED`"}},"required":["endpoint_id","request_id","result","status"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body or a field in it is over its size limit."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/model3d":{"post":{"operationId":"generate.model3d","summary":"Generate a 3D model","description":"Generates a textured 3D model (GLB) from a prompt, or from an image when `image_url` is given (Meshy 7.1: `meshy/v7.1/text-to-3d`, `meshy/v7.1/image-to-3d`); a low `target_polycount` suits games. To animate a character, model it with `pose_mode` and pass its `model_glb` to animate-3d. Billed against your credits; waits up to `wait_seconds`, then returns the `request_id` to follow with generate status. Backs `vg generate 3d`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","format":"uri","description":"An image's URL, e.g. from generate upload"},"options":{"default":{},"description":"Any other input the model takes, per generate schema of its endpoint; the fields above win","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}},"pose_mode":{"description":"Model a character in this pose, which rigs cleanly in animate-3d","type":"string","enum":["a-pose","t-pose"]},"prompt":{"description":"What to model; needed without image_url","type":"string","minLength":1,"maxLength":600},"target_polycount":{"description":"The mesh's polygon budget, 100 to 300,000; the model's default is 30,000. Games suit 5,000 to 15,000 for a prop, 15,000 to 40,000 for a hero character","type":"integer","minimum":100,"maximum":300000},"topology":{"description":"The mesh's faces: `triangle` (the model's default) keeps detail, `quad` gives smoother surfaces","type":"string","enum":["quad","triangle"]},"wait_seconds":{"default":20,"description":"How long to wait for the result before returning the request id","type":"integer","minimum":0,"maximum":25}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string"},"request_id":{"type":"string"},"result":{"description":"The model's output once COMPLETED, else null.","$ref":"#/components/schemas/JsonValue"},"status":{"type":"string","description":"`IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED` or `CANCELLED`"}},"required":["endpoint_id","request_id","result","status"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body or a field in it is over its size limit."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/music":{"post":{"operationId":"generate.music","summary":"Generate music","description":"Composes music from a prompt: genre, mood, instruments, structure (ElevenLabs Music v2.5: `elevenlabs/music/v2.5`). Billed against your credits; waits up to `wait_seconds`, then returns the `request_id` to follow with generate status. Backs `vg generate music`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"force_instrumental":{"description":"true makes a track with no vocals; omit to let the prompt decide","type":"boolean"},"music_length_ms":{"description":"The track's length in milliseconds, 3,000 to 600,000 (3 seconds to 10 minutes), e.g. 60000 for a minute; omit for the model's default","type":"integer","minimum":3000,"maximum":600000},"options":{"default":{},"description":"Any other input the model takes, per generate schema of its endpoint; the fields above win","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}},"prompt":{"type":"string","minLength":1,"maxLength":5000,"description":"The music to compose, up to 5,000 characters: genre, mood, instruments, tempo, structure, e.g. `upbeat chiptune boss battle loop, 140 bpm`"},"wait_seconds":{"default":20,"description":"How long to wait for the result before returning the request id","type":"integer","minimum":0,"maximum":25}},"required":["prompt"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string"},"request_id":{"type":"string"},"result":{"description":"The model's output once COMPLETED, else null.","$ref":"#/components/schemas/JsonValue"},"status":{"type":"string","description":"`IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED` or `CANCELLED`"}},"required":["endpoint_id","request_id","result","status"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body or a field in it is over its size limit."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/removeBackground":{"post":{"operationId":"generate.removeBackground","summary":"Remove an image's background","description":"Cuts the subject out of an image onto a transparent background, for sprites and props; `prompt` names what to keep when the cut is ambiguous (Bria Guided Remove Background: `bria/guided-remove-background`). Billed against your credits; waits up to `wait_seconds`, then returns the `request_id` to follow with generate status. Backs `vg generate remove-background`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","format":"uri","description":"An image's URL, e.g. from generate upload"},"options":{"default":{},"description":"Any other input the model takes, per generate schema of its endpoint; the fields above win","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}},"prompt":{"description":"What to keep, e.g. the knight","type":"string","minLength":1,"maxLength":500},"wait_seconds":{"default":20,"description":"How long to wait for the result before returning the request id","type":"integer","minimum":0,"maximum":25}},"required":["image_url"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string"},"request_id":{"type":"string"},"result":{"description":"The model's output once COMPLETED, else null.","$ref":"#/components/schemas/JsonValue"},"status":{"type":"string","description":"`IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED` or `CANCELLED`"}},"required":["endpoint_id","request_id","result","status"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body or a field in it is over its size limit."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/sound":{"post":{"operationId":"generate.sound","summary":"Generate a sound effect","description":"Generates a sound effect from a description: a jump, a hit, an explosion, ambience (ElevenLabs Sound Effects: `elevenlabs/sound-effects/v3`). Billed against your credits; waits up to `wait_seconds`, then returns the `request_id` to follow with generate status. Backs `vg generate sound`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"duration_seconds":{"description":"The sound's length in seconds, 0.5 to 30; omit to let the model fit the length to the sound","type":"number","minimum":0.5,"maximum":30},"loop":{"description":"Make it loop seamlessly","type":"boolean"},"options":{"default":{},"description":"Any other input the model takes, per generate schema of its endpoint; the fields above win","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}},"text":{"type":"string","minLength":1,"maxLength":5000,"description":"The sound to make"},"wait_seconds":{"default":20,"description":"How long to wait for the result before returning the request id","type":"integer","minimum":0,"maximum":25}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string"},"request_id":{"type":"string"},"result":{"description":"The model's output once COMPLETED, else null.","$ref":"#/components/schemas/JsonValue"},"status":{"type":"string","description":"`IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED` or `CANCELLED`"}},"required":["endpoint_id","request_id","result","status"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body or a field in it is over its size limit."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/speech":{"post":{"operationId":"generate.speech","summary":"Generate speech","description":"Speaks a line of text: dialogue, narration, an announcer (ElevenLabs v4, which takes audio tags for delivery: `elevenlabs/tts/eleven-v4`). Billed against your credits; waits up to `wait_seconds`, then returns the `request_id` to follow with generate status. Backs `vg generate speech`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"options":{"default":{},"description":"Any other input the model takes, per generate schema of its endpoint; the fields above win","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}},"text":{"type":"string","minLength":1,"maxLength":5000,"description":"What to say"},"voice":{"description":"A voice name, e.g. Rachel, Aria, Roger","type":"string","minLength":1},"wait_seconds":{"default":20,"description":"How long to wait for the result before returning the request id","type":"integer","minimum":0,"maximum":25}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string"},"request_id":{"type":"string"},"result":{"description":"The model's output once COMPLETED, else null.","$ref":"#/components/schemas/JsonValue"},"status":{"type":"string","description":"`IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED` or `CANCELLED`"}},"required":["endpoint_id","request_id","result","status"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body or a field in it is over its size limit."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/video":{"post":{"operationId":"generate.video","summary":"Generate a video","description":"Generates a video clip with sound from a prompt, or animates an image when `image_url` is given (Seedance 2.5: `bytedance/seedance-2.5/us/text-to-video`, `bytedance/seedance-2.5/us/image-to-video`). Video takes minutes: expect a `request_id` to follow with generate status. Billed against your credits; waits up to `wait_seconds`, then returns the `request_id` to follow with generate status. Backs `vg generate video`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"aspect_ratio":{"description":"The frame's width to height, e.g. `16:9` landscape, `9:16` portrait, `1:1` square; `auto` lets the model choose, e.g. from image_url. Omit for the model's default","type":"string","enum":["auto","21:9","16:9","4:3","1:1","3:4","9:16"]},"duration":{"description":"Seconds, 4 to 30","type":"string","enum":["4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","auto"]},"end_image_url":{"description":"The last frame, with image_url","type":"string","format":"uri"},"generate_audio":{"description":"false makes a silent clip; omit for the model's default, which generates sound with the video","type":"boolean"},"image_url":{"description":"The first frame","type":"string","format":"uri"},"options":{"default":{},"description":"Any other input the model takes, per generate schema of its endpoint; the fields above win","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}},"prompt":{"description":"What happens; needed without image_url","type":"string","minLength":1,"maxLength":5000},"resolution":{"description":"The clip's resolution; higher takes longer and may cost more (see generate pricing). Omit for the model's default","type":"string","enum":["480p","720p","1080p"]},"wait_seconds":{"default":20,"description":"How long to wait for the result before returning the request id","type":"integer","minimum":0,"maximum":25}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string"},"request_id":{"type":"string"},"result":{"description":"The model's output once COMPLETED, else null.","$ref":"#/components/schemas/JsonValue"},"status":{"type":"string","description":"`IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED` or `CANCELLED`"}},"required":["endpoint_id","request_id","result","status"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body or a field in it is over its size limit."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/docs":{"post":{"operationId":"generate.docs","summary":"Search model docs","description":"Searches the model documentation: how a model is prompted, what its inputs mean, which to pick for a task. Backs `vg generate docs`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":500,"description":"What to look up, in plain words and up to 500 characters, e.g. `how to prompt seedance camera moves`"}},"required":["query"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"description":"The upstream response body, or null when it had none.","$ref":"#/components/schemas/JsonValue"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/models":{"post":{"operationId":"generate.models","summary":"Search models","description":"Searches the models generate can run, by what they do (`query`), by category or by id, with a cursor for the next page. Backs `vg generate models`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"description":"Only models in this category, e.g. `text-to-image`, `image-to-video`","type":"string","maxLength":128},"cursor":{"description":"The `next_cursor` of a previous result, for the page after it; omit for the first page","type":"string","maxLength":512},"endpoint_id":{"description":"Endpoint ids to look up directly instead of searching, e.g. `fal-ai/flux/dev`","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}},"expand":{"description":"Extra fields to include per model: `openapi-3.0`, `enterprise_status`","type":"array","items":{"type":"string","enum":["openapi-3.0","enterprise_status"]}},"limit":{"default":20,"description":"How many models to return per page, 1 to 100; default 20","type":"integer","minimum":1,"maximum":100},"query":{"description":"Free text, e.g. `pixel art sprite`","type":"string","maxLength":500},"status":{"description":"`deprecated` or `all` to include models past their prime; omit for active models","type":"string","enum":["active","deprecated","all"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"description":"The upstream response body, or null when it had none.","$ref":"#/components/schemas/JsonValue"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/pricing":{"post":{"operationId":"generate.pricing","summary":"Model pricing","description":"A model's price per unit, which generate bills against your credits. Backs `vg generate pricing`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string","minLength":1,"maxLength":256,"description":"A model's endpoint id, as generate models lists it, e.g. `fal-ai/flux/dev`"}},"required":["endpoint_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"description":"The upstream response body, or null when it had none.","$ref":"#/components/schemas/JsonValue"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/run":{"post":{"operationId":"generate.run","summary":"Run a model","description":"Runs a model to generate an image, video, audio clip, 3D model or text, billed against your credits. Waits up to `wait_seconds` for the output; a job still running by then returns its `request_id` and status, to follow with generate.status. Needs a positive credit balance (403 `insufficient_credits`) and a priced model (400 `unknown_endpoint`) unless the caller is an admin. Backs `vg generate run`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string","minLength":1,"maxLength":256,"description":"A model's endpoint id, as generate models lists it, e.g. `fal-ai/flux/dev`"},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"},"description":"The model's input, per generate schema"},"wait_seconds":{"default":20,"description":"How long to wait for the result before returning the request id","type":"integer","minimum":0,"maximum":25}},"required":["endpoint_id","input"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string"},"request_id":{"type":"string"},"result":{"description":"The model's output once COMPLETED, else null.","$ref":"#/components/schemas/JsonValue"},"status":{"type":"string","description":"`IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED` or `CANCELLED`"}},"required":["endpoint_id","request_id","result","status"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller is authenticated but may not perform this action."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body or a field in it is over its size limit."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/schema":{"post":{"operationId":"generate.schema","summary":"Model schema","description":"A model's input and output schema: what generate.run's `input` takes. `openapi` gives the full OpenAPI document. Backs `vg generate schema`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string","minLength":1,"maxLength":256,"description":"A model's endpoint id, as generate models lists it, e.g. `fal-ai/flux/dev`"},"format":{"default":"compact","description":"`compact` (the default) returns the model's catalog entry; `openapi` adds its full OpenAPI 3.0 document, with every input and output field","type":"string","enum":["compact","openapi"]}},"required":["endpoint_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"description":"The upstream response body, or null when it had none.","$ref":"#/components/schemas/JsonValue"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/status":{"post":{"operationId":"generate.status","summary":"Follow a generation","description":"Follows a generate job: its status (`status`), its output once COMPLETED (`result`, which settles the bill), or `cancel`, which waits briefly for the queue to settle the job so its hold is refunded. Backs `vg generate status`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"default":"status","description":"`status` (the default) reports where the job is; `result` fetches its output once COMPLETED, which settles the bill; `cancel` stops a job that is still queued or running","type":"string","enum":["status","result","cancel"]},"endpoint_id":{"type":"string","minLength":1,"maxLength":256,"description":"A model's endpoint id, as generate models lists it, e.g. `fal-ai/flux/dev`"},"logs":{"default":false,"description":"Include the job's logs with its status","type":"boolean"},"request_id":{"type":"string","minLength":1,"maxLength":128,"description":"The job's `request_id`, as generate returned it, with the endpoint_id it ran on"}},"required":["endpoint_id","request_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"description":"The upstream response body, or null when it had none.","$ref":"#/components/schemas/JsonValue"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/generate/upload":{"post":{"operationId":"generate.upload","summary":"Upload a model input","description":"Opens an upload slot for a model input (a reference image, an audio clip to transform). PUT the bytes to `uploadUrl`, a 15-minute signed URL on this server, with the `headers` given; the server streams them on to generate's storage. Then pass `fileUrl` to the model. Backs `vg generate upload`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contentType":{"type":"string","minLength":1,"maxLength":127,"description":"The file's MIME type, e.g. `image/png`; PUT the bytes with this Content-Type"},"fileName":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name with its extension, e.g. `hero.png`, up to 255 characters"}},"required":["contentType","fileName"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fileUrl":{"type":"string"},"headers":{"type":"object","properties":{"content-type":{"type":"string"}},"required":["content-type"],"additionalProperties":false},"uploadUrl":{"type":"string"}},"required":["fileUrl","headers","uploadUrl"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/playtest/decide":{"post":{"operationId":"playtest.decide","summary":"Ask the playtest decision model","description":"Asks the decision model typed questions (yes/no, choice, score) about a JSON game state and returns its answers verbatim. Backs `vg playtest run`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","pattern":"^[a-z0-9][a-z0-9.-]{0,63}$"},"questions":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"oneOf":[{"type":"object","properties":{"criteria":{"type":"object","properties":{"false":{"type":"string","minLength":1,"maxLength":2000},"true":{"type":"string","minLength":1,"maxLength":2000}}},"instructions":{"type":"string","minLength":1,"maxLength":2000},"type":{"type":"string","const":"noul"}},"required":["instructions","type"]},{"type":"object","properties":{"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"instructions":{"type":"string","minLength":1,"maxLength":2000},"type":{"type":"string","const":"choice"}},"required":["criteria","instructions","type"]},{"type":"object","properties":{"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"instructions":{"type":"string","minLength":1,"maxLength":2000},"type":{"type":"string","const":"score"}},"required":["criteria","instructions","type"]}]}},"state":{"$ref":"#/components/schemas/JsonValue"}},"required":["questions","state"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"description":"The decision model's reply; `answers` is keyed by question label.","$ref":"#/components/schemas/JsonValue"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body or a field in it is over its size limit."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited; retry with backoff."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An upstream provider failed or returned an unusable response."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/playtest/session":{"post":{"operationId":"playtest.session","summary":"Mint a playtest token","description":"Mints a short-lived token, bound to the caller, that an in-page playtester presents to /api/playtest/decide. It grants nothing else.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"expiresAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Unix epoch milliseconds."},"token":{"type":"string"}},"required":["expiresAt","token"],"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No valid session cookie, bearer token or API key."},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A server-side dependency this procedure needs is not configured."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}},"security":[{"sessionCookie":[]},{"bearerAuth":[]},{"apiKeyHeader":[]}]}},"/waitlist/join":{"post":{"operationId":"waitlist.join","summary":"Join the waitlist","description":"Adds an email address to the waitlist. Public; attaches the signed-in user when a session is present.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"waitlist":{"type":"object","properties":{"email":{"type":["string","null"]},"id":{"type":"string"},"source":{"type":["string","null"]},"userId":{"type":["string","null"]}},"required":["email","id","source","userId"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The input failed validation or the request cannot be carried out as sent."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unexpected server error."}}}}}}