{"openapi":"3.1.0","info":{"title":"GraphSheets API","version":"1","description":"Financial models as typed graphs: read them, evaluate them, and propose changes that land marked for review. This describes the routes a connected app may call, those an agent account also reaches, and how an agent asks for an account. Change-set operations (`op`): node.add, node.remove, node.rename, node.set_formula, node.set_kind, node.set_meta, values.set, actuals.set, constant.set, uncertainty.set, statistic.rename, group.add, group.remove, group.rename, group.set_meta, scenario.add, scenario.remove, scenario.rename, scenario.set_meta, ledger.add, ledger.remove, ledger.set_categories, ledger.splice_categories, ledger.set_date_field, ledger.set_span_field, ledger.set_union, entry.add, entry.remove, entry.set, model.set_meta, presentation.set, axis.migrate, unknown.set; a model document's schema is at /api/v1/schemas/model.json."},"externalDocs":{"url":"https://graphsheets.ai/api/v1/docs"},"servers":[{"url":"https://graphsheets.ai"}],"x-mcp-server":"https://mcp.graphsheets.ai/mcp","components":{"securitySchemes":{"oauth":{"type":"oauth2","description":"OAuth 2.1 with PKCE and dynamic client registration; metadata at /.well-known/oauth-authorization-server.","flows":{"authorizationCode":{"authorizationUrl":"https://graphsheets.ai/api/v1/oauth/authorize","tokenUrl":"https://graphsheets.ai/api/v1/oauth/token","refreshUrl":"https://graphsheets.ai/api/v1/oauth/token","scopes":{"models:read":"Read the models you can open, and keep your own private scenarios on them","models:write":"Create models and make changes, which land marked for your review","data:fetch":"Fetch market prices and company filings through GraphSheets","changes:approve":"Approve or reject the changes it proposed, when you tell it to in the conversation"}}}},"agentAccount":{"type":"oauth2","description":"An agent account (asked for at POST /api/v1/agents/register) signs in with client_credentials and a private_key_jwt client assertion; no secret exists. A JWT signed with one of your registered keys (EdDSA, ES256 or RS256), its kid the key's: iss and sub your clientId, aud the tokenEndpoint, exp at most 300 seconds after iat, and a jti never used before. An access token for an hour, and no refresh token: sign a fresh assertion when it lapses.","flows":{"clientCredentials":{"tokenUrl":"https://graphsheets.ai/api/v1/oauth/token","scopes":{"models:read":"Read the models you can open, and keep your own private scenarios on them","models:write":"Create models and make changes, which land marked for your review","data:fetch":"Fetch market prices and company filings through GraphSheets"}}}},"token":{"type":"http","scheme":"bearer","description":"A personal access token (gsp_…), made on the profile page."}}},"paths":{"/api/v1/me":{"get":{"summary":"The person the token acts for","operationId":"getMe","parameters":[],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models":{"get":{"summary":"The models the person can open","operationId":"getModels","parameters":[{"name":"archived","in":"query","required":false,"description":"`1` for the archived models instead of the working set","schema":{"type":"string","enum":["1","true"]}},{"name":"scope","in":"query","required":false,"description":"Only the reader's own, or only those shared with them","schema":{"type":"string","enum":["all","mine","shared"]}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}},"post":{"summary":"Create an empty model","operationId":"postModels","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"An empty model's name; with `granularity`, `start` and `periods`, in place of `document` or `bundle`"},"description":{"type":"string","maxLength":2000,"description":"What an empty model is for, in a sentence"},"granularity":{"type":"string","enum":["month","quarter","half","year","week"],"description":"An empty model's period"},"start":{"type":"string","description":"Its first period's label: 2027-01, 2027-Q1, 2027-H1, 2027 or 2027-W01"},"periods":{"type":"integer","minimum":1,"maximum":3600,"description":"How many periods"},"document":{"type":"object","additionalProperties":{},"description":"A whole model document (JSON, schema at /api/v1/schemas/model.json); or `bundle`; or the axis fields above"},"bundle":{"type":"object","additionalProperties":{"type":"string"},"description":"A model as a bundle of files, path to text; or `document`"},"policy":{"type":"object","additionalProperties":{},"description":"The model's verification policy; the default when absent"},"asCopy":{"type":"boolean"}},"additionalProperties":false}}}},"security":[{"oauth":["models:write"]},{"agentAccount":["models:write"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}":{"get":{"summary":"A model's document at its head","operationId":"getModelsUid","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"version","in":"query","required":false,"description":"A version's hash; the head when absent","schema":{"type":"string"}},{"name":"structure","in":"query","required":false,"description":"`true` for the structure without values","schema":{"type":"string","enum":["true"]}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}},"patch":{"summary":"Archive or unarchive a model","operationId":"patchModelsUid","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"archived":{"type":"boolean","description":"Whether the model is archived"}},"required":["archived"],"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}},"delete":{"summary":"Delete a model (restorable for thirty days)","operationId":"deleteModelsUid","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/bundle":{"get":{"summary":"A model as a bundle of files","operationId":"getModelsUidBundle","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"version","in":"query","required":false,"description":"A version's hash; the head when absent","schema":{"type":"string"}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/search":{"get":{"summary":"Find rows in a model by name or title","operationId":"getModelsUidSearch","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Words to find in rows' names and titles","schema":{"type":"string"}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/graph":{"get":{"summary":"A model's dependency graph","operationId":"getModelsUidGraph","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/history":{"get":{"summary":"A model's versions, newest first","operationId":"getModelsUidHistory","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"How many change-sets, newest first","schema":{"type":"string"}},{"name":"authorType","in":"query","required":false,"description":"Only change-sets by this kind of author","schema":{"type":"string","enum":["human","agent","import"]}},{"name":"node","in":"query","required":false,"description":"Only change-sets touching this node's uid","schema":{"type":"string"}},{"name":"review","in":"query","required":false,"description":"`awaiting` for change-sets awaiting review","schema":{"type":"string","enum":["awaiting"]}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/diff":{"get":{"summary":"The change between two versions of a model","operationId":"getModelsUidDiff","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":true,"description":"The earlier version's hash","schema":{"type":"string"}},{"name":"to","in":"query","required":true,"description":"The later version's hash","schema":{"type":"string"}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/values":{"get":{"summary":"Evaluated values of a model's rows","operationId":"getModelsUidValues","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"scenario","in":"query","required":false,"description":"A scenario's name, or a mix `a+b`; `base` when absent","schema":{"type":"string"}},{"name":"nodes","in":"query","required":false,"description":"Comma-separated row names; every row when absent","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"First period's label","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"Last period's label","schema":{"type":"string"}},{"name":"version","in":"query","required":false,"description":"A version's hash; the head when absent","schema":{"type":"string"}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/explain":{"get":{"summary":"How a value is worked out, step by step","operationId":"getModelsUidExplain","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"node","in":"query","required":true,"description":"The row's name","schema":{"type":"string"}},{"name":"period","in":"query","required":true,"description":"The period's label","schema":{"type":"string"}},{"name":"scenario","in":"query","required":false,"description":"A scenario's name, or a mix `a+b`; `base` when absent","schema":{"type":"string"}},{"name":"depth","in":"query","required":false,"description":"How many levels of inputs to expand; 1 when absent","schema":{"type":"string"}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/verify":{"post":{"summary":"Run a model's checks and lint","operationId":"postModelsUidVerify","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"ops":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string"}},"required":["op"],"additionalProperties":true}}},"additionalProperties":false}}}},"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/sensitivity":{"post":{"summary":"How outputs move with inputs","operationId":"postModelsUidSensitivity","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scenario":{"type":"string"},"overrides":{"type":"array","items":{"type":"object","properties":{"node":{"type":"string"},"factor":{"type":"number"},"delta":{"type":"number"},"set":{"type":"array","items":{"type":["number","null"]}},"periods":{"type":"array","items":{"type":"string"}}},"required":["node"],"additionalProperties":false}},"outputs":{"type":"array","items":{"type":"string"}},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string"}},"required":["op"],"additionalProperties":true}},"base":{"type":"string"}},"required":["overrides"],"additionalProperties":false}}}},"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/risk":{"post":{"summary":"A Monte Carlo run over a model's uncertain inputs","operationId":"postModelsUidRisk","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"scenario","in":"query","required":false,"description":"A scenario's name, or a mix `a+b`; `base` when absent","schema":{"type":"string"}},{"name":"version","in":"query","required":false,"description":"A version's hash; the head when absent","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"ops":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string"}},"required":["op"],"additionalProperties":true}},"outputs":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":50}},"additionalProperties":false}}}},"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/compare":{"get":{"summary":"Compare two models","operationId":"getCompare","parameters":[{"name":"left","in":"query","required":true,"description":"A model's uid, optionally `uid@hash`","schema":{"type":"string"}},{"name":"right","in":"query","required":true,"description":"A model's uid, optionally `uid@hash`","schema":{"type":"string"}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/changesets/{id}":{"get":{"summary":"A change-set and its review","operationId":"getChangesetsId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"rebase","in":"query","required":false,"description":"`1` to include what approving it would now do","schema":{"type":"string","enum":["1","true"]}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/agent-draft":{"get":{"summary":"The connection's working draft of a model","operationId":"getModelsUidAgentDraft","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}},"put":{"summary":"Save the connection's working draft","operationId":"putModelsUidAgentDraft","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"baseHash":{"type":"string","minLength":1},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string"}},"required":["op"],"additionalProperties":true}},"revision":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["baseHash","ops","revision"],"additionalProperties":false}}}},"security":[{"oauth":["models:write"]},{"agentAccount":["models:write"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}},"delete":{"summary":"Discard the connection's working draft","operationId":"deleteModelsUidAgentDraft","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth":["models:write"]},{"agentAccount":["models:write"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/private-scenarios":{"get":{"summary":"The person's own private scenarios on a model","operationId":"getModelsUidPrivateScenarios","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/private-scenarios/{name}":{"put":{"summary":"Keep one of the person's private scenarios","operationId":"putModelsUidPrivateScenariosName","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scenario":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$","maxLength":64},"title":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":2000},"dimension":{"type":"string","pattern":"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$","maxLength":64},"notes":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":4000},"propertyNames":{"minLength":1,"maxLength":64}}},"required":["name"],"additionalProperties":false},"inputs":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"},"propertyNames":{"minLength":1,"maxLength":32}},"propertyNames":{"minLength":1,"maxLength":64}},"constants":{"type":"object","additionalProperties":{"type":"number"},"propertyNames":{"minLength":1,"maxLength":64}}},"required":["scenario","inputs","constants"],"additionalProperties":false}}}},"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}},"delete":{"summary":"Delete one of the person's private scenarios","operationId":"deleteModelsUidPrivateScenariosName","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/clone":{"post":{"summary":"Clone a model","operationId":"postModelsUidClone","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"version","in":"query","required":false,"description":"A version's hash; the head when absent","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1}},"required":["title"],"additionalProperties":false}}}},"security":[{"oauth":["models:write"]},{"agentAccount":["models:write"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/scenarios/fork":{"post":{"summary":"Fork a scenario","operationId":"postModelsUidScenariosFork","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","default":"base"},"name":{"type":"string"},"title":{"type":"string"}},"required":["name"],"additionalProperties":false}}}},"security":[{"oauth":["models:write"]},{"agentAccount":["models:write"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/changesets":{"post":{"summary":"Propose a change-set, landed marked for review","operationId":"postModelsUidChangesets","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"baseHash":{"type":"string"},"message":{"type":"string","minLength":1},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string"}},"required":["op"],"additionalProperties":true}},"lintReasons":{"type":"object","additionalProperties":{"type":"string","maxLength":500}},"suggested":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"entry":{"type":"string"},"column":{"type":"string"},"word":{"type":"string"}},"required":["path","entry","column","word"],"additionalProperties":false},"maxItems":100000},"requestReview":{"type":"boolean"},"agent":{"type":"object","properties":{"threadId":{"type":"string"}},"required":["threadId"],"additionalProperties":false},"supersedes":{"type":"string"},"parts":{"type":"array","items":{"type":"object","properties":{"opCount":{"type":"integer","exclusiveMinimum":true,"minimum":0},"message":{"type":"string","minLength":1},"agent":{"type":"object","properties":{"threadId":{"type":"string"}},"required":["threadId"],"additionalProperties":false}},"required":["opCount","message"],"additionalProperties":false},"minItems":2,"maxItems":100}},"required":["baseHash","message","ops"],"additionalProperties":false}}}},"security":[{"oauth":["models:write"]},{"agentAccount":["models:write"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/changesets/{id}/apply":{"post":{"summary":"Apply a change-set","operationId":"postChangesetsIdApply","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth":["models:write"]},{"agentAccount":["models:write"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/changesets/{id}/review":{"post":{"summary":"Approve or reject the connection's own proposal","operationId":"postChangesetsIdReview","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approved","rejected"]},"comment":{"type":"string"}},"required":["decision"],"additionalProperties":false}}}},"security":[{"oauth":["changes:approve"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/market-data/providers":{"get":{"summary":"The market-data providers","operationId":"getMarketDataProviders","parameters":[],"security":[{"oauth":["data:fetch"]},{"agentAccount":["data:fetch"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/market-data/search":{"get":{"summary":"Search for a priced symbol","operationId":"getMarketDataSearch","parameters":[{"name":"provider","in":"query","required":true,"description":"The data provider","schema":{"type":"string","enum":["stooq","frankfurter","yahoo","fred"]}},{"name":"q","in":"query","required":false,"description":"Words to search for; no hits when empty","schema":{"type":"string"}}],"security":[{"oauth":["data:fetch"]},{"agentAccount":["data:fetch"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/market-data/history":{"get":{"summary":"A symbol's price history","operationId":"getMarketDataHistory","parameters":[{"name":"provider","in":"query","required":true,"description":"The data provider","schema":{"type":"string","enum":["stooq","frankfurter","yahoo","fred"]}},{"name":"symbol","in":"query","required":true,"description":"The provider's symbol","schema":{"type":"string"}},{"name":"from","in":"query","required":true,"description":"First day, YYYY-MM-DD","schema":{"type":"string"}},{"name":"to","in":"query","required":true,"description":"Last day, YYYY-MM-DD","schema":{"type":"string"}}],"security":[{"oauth":["data:fetch"]},{"agentAccount":["data:fetch"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/financials/providers":{"get":{"summary":"The company-filings providers","operationId":"getFinancialsProviders","parameters":[],"security":[{"oauth":["data:fetch"]},{"agentAccount":["data:fetch"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/financials/search":{"get":{"summary":"Search for a reporting company","operationId":"getFinancialsSearch","parameters":[{"name":"provider","in":"query","required":true,"description":"The filings provider","schema":{"type":"string","enum":["edgar","yahoo-financials"]}},{"name":"q","in":"query","required":false,"description":"A company's name or ticker; no hits when empty","schema":{"type":"string"}}],"security":[{"oauth":["data:fetch"]},{"agentAccount":["data:fetch"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/financials/facts":{"get":{"summary":"A company's reported statement lines","operationId":"getFinancialsFacts","parameters":[{"name":"provider","in":"query","required":true,"description":"The filings provider","schema":{"type":"string","enum":["edgar","yahoo-financials"]}},{"name":"symbol","in":"query","required":true,"description":"The company, by ticker or CIK","schema":{"type":"string"}},{"name":"metric","in":"query","required":true,"description":"The line item","schema":{"type":"string","enum":["revenue","cost_of_revenue","gross_profit","research_development","sga","operating_income","depreciation_amortisation","interest_expense","pretax_income","tax_expense","net_income","eps_diluted","shares_diluted","operating_cash_flow","capex","dividends_paid","buybacks","cash","total_assets","total_liabilities","total_equity","inventory","receivables","ppe_net","total_debt","ebitda"]}},{"name":"frame","in":"query","required":true,"description":"The reporting frequency","schema":{"type":"string","enum":["annual","half_year","quarterly"]}},{"name":"from","in":"query","required":true,"description":"First day, YYYY-MM-DD","schema":{"type":"string"}},{"name":"to","in":"query","required":true,"description":"Last day, YYYY-MM-DD","schema":{"type":"string"}},{"name":"deriveQ4","in":"query","required":false,"description":"`true` to derive a missing fourth quarter from the year","schema":{"type":"string","enum":["true","1"]}},{"name":"deriveH2","in":"query","required":false,"description":"`true` to derive a missing second half from the year","schema":{"type":"string","enum":["true","1"]}}],"security":[{"oauth":["data:fetch"]},{"agentAccount":["data:fetch"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/me/credit":{"get":{"summary":"The account's prepaid credit: balance, held, storage reserve, free","operationId":"getMeCredit","parameters":[],"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/billing/topup":{"post":{"summary":"Top up the account's credit in-band: answers 402 with an MPP/x402 challenge, then settles a credential sent in Payment-Authorization","operationId":"postBillingTopup","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dollars":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":10000,"description":"Dollars to add: $1.00 or more, in steps of $0.10"}},"required":["dollars"],"additionalProperties":false}}}},"security":[{"oauth":["models:read"]},{"agentAccount":["models:read"]},{"token":[]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/shares":{"get":{"summary":"Who a model is shared with","operationId":"getModelsUidShares","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:read"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}},"post":{"summary":"Share a model with a person, by address","operationId":"postModelsUidShares","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"The person's address; one without an account is invited"},"role":{"type":"string","enum":["viewer","editor"],"default":"viewer","description":"viewer or editor"}},"required":["email"],"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/shares/{userId}":{"delete":{"summary":"Stop sharing a model with a person","operationId":"deleteModelsUidSharesUserId","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/owner":{"patch":{"summary":"Hand a model over to another account","operationId":"patchModelsUidOwner","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"The account to hand the model to"}},"required":["email"],"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/models/{uid}/organisation":{"patch":{"summary":"Move a model into one of your organisations, or out","operationId":"patchModelsUidOrganisation","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"orgId":{"type":"string","minLength":1,"description":"The organisation to move it into"},"share":{"anyOf":[{"type":"string","enum":["viewer","editor"]},{"type":"null"}],"description":"Whether, and how, the organisation's members reach it"},"restricted":{"type":"boolean","description":"Whether it may be shared outside the organisation"}},"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/orgs":{"get":{"summary":"Your organisations","operationId":"getOrgs","parameters":[],"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:read"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}},"post":{"summary":"Start an organisation","operationId":"postOrgs","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"Its name"}},"required":["name"],"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/orgs/{id}":{"get":{"summary":"An organisation and its members","operationId":"getOrgsId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:read"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}},"patch":{"summary":"Rename an organisation or change its settings","operationId":"patchOrgsId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"restrictByDefault":{"type":"boolean","description":"Whether its new models start restricted"},"memberInvitesNeedApproval":{"type":"boolean","description":"Whether a member's invitation waits for one of its administrators"},"agentJoinsNeedApproval":{"type":["boolean","null"],"description":"Agent accounts apart from people: null follows people's rules, true holds agents' invitations and domain joins for an administrator, false lets members invite agents unheld"}},"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/orgs/default":{"put":{"summary":"Choose which organisation new models go to","operationId":"putOrgsDefault","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"orgId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"The organisation new models go to, or none"}},"required":["orgId"],"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/orgs/{id}/members":{"post":{"summary":"Invite somebody to an organisation (a member's invitation may wait for an administrator)","operationId":"postOrgsIdMembers","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":320,"description":"The member's address"},"role":{"type":"string","enum":["admin","member"],"default":"member","description":"admin or member"}},"required":["email"],"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/orgs/{id}/members/{userId}":{"patch":{"summary":"Change a member's role","operationId":"patchOrgsIdMembersUserId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin","member"],"description":"admin or member"}},"required":["role"],"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}},"delete":{"summary":"Remove a member, or leave","operationId":"deleteOrgsIdMembersUserId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/orgs/{id}/invitations/{email}":{"delete":{"summary":"Withdraw an organisation's invitation","operationId":"deleteOrgsIdInvitationsEmail","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"email","in":"path","required":true,"schema":{"type":"string"}}],"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/orgs/{id}/house-style":{"put":{"summary":"Set an organisation's house style for documents","operationId":"putOrgsIdHouseStyle","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"houseStyle":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"logo":{"type":"string","maxLength":400000,"pattern":"^data:image\\/(png|jpeg|webp|svg\\+xml);base64,[A-Za-z0-9+/=]+$"},"logos":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]*$","maxLength":64},"image":{"type":"string","maxLength":400000,"pattern":"^data:image\\/(png|jpeg|webp|svg\\+xml);base64,[A-Za-z0-9+/=]+$"}},"required":["name","image"],"additionalProperties":false},"maxItems":8},"accent":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"font":{},"headingFont":{},"workbook":{"type":"object","properties":{"font":{"type":"string","enum":["Calibri","Aptos","Arial","Helvetica","Verdana","Tahoma","Segoe UI","Cambria","Georgia","Times New Roman"]},"fontSize":{},"colours":{"type":"object","properties":{"input":{"type":"object","properties":{"font":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fill":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false},"calculated":{"type":"object","properties":{"font":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fill":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false},"link":{"type":"object","properties":{"font":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fill":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false},"actual":{"type":"object","properties":{"font":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fill":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false},"check":{"type":"object","properties":{"font":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fill":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false},"header":{"type":"object","properties":{"font":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fill":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false}},"additionalProperties":false},"negatives":{"type":"string","enum":["parentheses","minus","red"]},"zeros":{"type":"string","enum":["zero","dash","blank"]},"totals":{"type":"string","enum":["single","double","none"]},"dates":{"type":"string","enum":["yyyy-mm-dd","dd/mm/yyyy","mm/dd/yyyy","d mmm yyyy","mmm d, yyyy"]},"gridlines":{"type":"boolean"},"cover":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["logo","title","text","facts","firm","rule","space"]},"align":{"type":"string","enum":["left","center","right"]},"logo":{"type":"string","pattern":"^[a-z][a-z0-9_]*$","maxLength":64},"size":{"type":"string","enum":["small","medium","large"]},"text":{"type":"string","maxLength":4000}},"required":["kind"],"additionalProperties":false},"maxItems":20},"disclaimer":{"type":"object","properties":{"on":{"type":"boolean"},"title":{"type":"string","minLength":1,"maxLength":31},"text":{"type":"string","maxLength":20000}},"required":["on"],"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]}},"required":["houseStyle"],"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/orgs/{id}/join":{"post":{"summary":"Join an organisation that claimed your verified contact address's domain; 202 when the join waits for an administrator","operationId":"postOrgsIdJoin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/billing/checkout":{"post":{"summary":"Top up by card: answers a Stripe Checkout url for whoever pays for the account to open; the credit lands when Stripe confirms the payment","operationId":"postBillingCheckout","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dollars":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":100000,"description":"Dollars to add"},"saveCard":{"type":"boolean","description":"Keep the card for later top-ups"},"returnTo":{"type":"string","maxLength":500,"pattern":"^\\/(?![\\/\\\\])[^\\s\\\\]*$","description":"A path in the app to return to after paying"},"autoTopUp":{"type":"object","properties":{"thresholdDollars":{"type":"number","minimum":0,"maximum":100000},"amountDollars":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":100000}},"required":["thresholdDollars","amountDollars"],"additionalProperties":false,"description":"Top up again from the kept card when credit falls under the threshold"}},"required":["dollars"],"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:read"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/users/{id}/profile":{"get":{"summary":"An account's profile page, where its owner lets you see it: who it is and the models of theirs you may open (404 where withheld)","operationId":"getUsersIdProfile","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:read"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/me/profile":{"put":{"summary":"Set who may see your own profile page, and its picture","operationId":"putMeProfile","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["private","organisation","workspace"],"description":"Who may see the page: private, organisation or workspace"},"avatar":{"anyOf":[{"type":"string","maxLength":150000},{"type":"null"}],"description":"A PNG, JPEG or WebP picture as a data: URI, or null to remove it"}},"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/me/keys":{"get":{"summary":"The public keys you sign in with","operationId":"getMeKeys","parameters":[],"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:read"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}},"put":{"summary":"Replace your keys: the new JWK Set, and an assertion signed with a key you hold now, its aud this route's address. Your owner, your own inbox and your webhook are told","operationId":"putMeKeys","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jwks":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"kty":{"type":"string","enum":["RSA","EC","OKP"]},"kid":{"type":"string","minLength":1,"maxLength":200},"alg":{"type":"string","enum":["RS256","ES256","EdDSA"]}},"required":["kty"],"additionalProperties":true},"minItems":1,"maxItems":3}},"required":["keys"],"additionalProperties":false,"description":"The new public keys, as a JWK Set; they replace every key held"},"assertion":{"type":"string","minLength":1,"maxLength":8000,"description":"A client assertion signed with one of the keys held now — as for the token endpoint, but its aud this route's address — so a token alone cannot replace them"}},"required":["jwks","assertion"],"additionalProperties":false}}}},"x-agent-account-only":true,"description":"Agent accounts only.","security":[{"agentAccount":["models:write"]}],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/agents/register":{"post":{"summary":"Ask for an agent account: its name, its purpose, its public keys, acceptTerms: true, and at least one of ownerEmail (who answers for it), agentEmail (its own inbox) or webhookUrl. Answers the client id it will sign in as, where to ask how the request stands, and approved where the workspace needs no approval for agents and it can already be reached","operationId":"postAgentsRegister","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80,"pattern":"^[^\\p{Cc}\\p{Cf}]+$","description":"What the agent is called"},"ownerEmail":{"type":"string","format":"email","maxLength":320,"description":"The owner's email: the person who answers for the agent, mailed a link to confirm. Confirmed, it receives the owner's notices (account warnings, key changes), is shown on the profile and lets the agent join an organisation that claimed its domain"},"agentEmail":{"type":"string","format":"email","maxLength":320,"description":"The agent's own inbox, mailed a token it confirms by POSTing it to /agents/register/verify. Confirmed, it receives the agent's notices (account warnings, key changes)"},"contactEmail":{"type":"string","format":"email","maxLength":320,"description":"Deprecated: the ownerEmail"},"acceptTerms":{"type":"boolean","const":true,"description":"Required: true, accepting the Terms of Service at /terms"},"purpose":{"type":"string","minLength":10,"maxLength":1000,"description":"What it will do here, in a sentence or two"},"jwks":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"kty":{"type":"string","enum":["RSA","EC","OKP"]},"kid":{"type":"string","minLength":1,"maxLength":200},"alg":{"type":"string","enum":["RS256","ES256","EdDSA"]}},"required":["kty"],"additionalProperties":true},"minItems":1,"maxItems":3}},"required":["keys"],"additionalProperties":false,"description":"Its public keys, as a JWK Set"},"webhookUrl":{"type":"string","format":"uri","maxLength":2000,"description":"Where account warnings (credit running out, deletion due, key changes) are POSTed as JSON; it must answer a test POST with a 2xx at registration. At least one of ownerEmail, agentEmail or webhookUrl is required"}},"required":["name","acceptTerms","purpose","jwks"],"additionalProperties":false}}}},"security":[],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/agents/registrations/{id}":{"get":{"summary":"Where an agent's request stands: awaiting_approval, approved, declined, suspended (by the administrator) or blocked (by its owner); whether a contact it gave has confirmed, and whether it can be reached yet (approval waits for that)","operationId":"getAgentsRegistrationsId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/access":{"get":{"summary":"Who may come in without an administrator's approval: people and agents, each open (a verified address, or a reachable agent account, is admitted at once) or approval (an invitation, or the administrator's yes)","operationId":"getAccess","parameters":[],"security":[],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/schemas/model.json":{"get":{"summary":"The model document's JSON Schema","operationId":"getSchemasModel.json","parameters":[],"security":[],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}},"/api/v1/billing/prices":{"get":{"summary":"The price list: model list prices per million tokens and the premium discount on them, model markups by payer, the engine price list (per call, per 10,000 risk trials, per export, per data pull) and what is never metered, the people's free allowance, their starter credit and free first Builder turn, and the trial credit","operationId":"getBillingPrices","parameters":[],"security":[],"responses":{"200":{"description":"The answer, as JSON"},"400":{"description":"A required input is missing or malformed; `error.details` says which"},"401":{"description":"No credential, or one that has expired"},"403":{"description":"The credential does not open this route or this model"}}}}}}