@deepraxis/sdk 0.1.1-dev.604ca9a → 0.1.1-dev.607b136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -358,52 +358,11 @@ export const getAgentAppearance = (options) => (options.client ?? client).get({
358
358
  ...options
359
359
  });
360
360
  /**
361
- * Create customer grant code
361
+ * Get agent embed policy
362
362
  *
363
- * Sign your logged-in customer in to a service agent from your backend with a one-time grant code that Agent Kit exchanges for a customer access token.
364
- *
365
- * Call this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget (US dollars, at most 2 decimals), system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {"customer_id":"cus_8f2a91","origin":"https://shop.example.com"}.
366
- */
367
- export const createCustomerGrantCode = (options) => (options.client ?? client).post({
368
- security: [{
369
- key: 'BearerAuth',
370
- scheme: 'bearer',
371
- type: 'http'
372
- }, {
373
- key: 'ApiKeyAuth',
374
- name: 'X-API-Key',
375
- type: 'apiKey'
376
- }],
377
- url: '/agent/v1/agents/{agent_id}/customers/auth/grant_codes',
378
- ...options,
379
- headers: {
380
- 'Content-Type': 'application/json',
381
- ...options.headers
382
- }
383
- });
384
- /**
385
- * Create customer access token
386
- *
387
- * Exchange a grant code, or the agent's publishable key for an anonymous visitor, for a customer access token that authorizes the agent's embedded sessions.
388
- *
389
- * No Authorization header is required: the grant code or the publishable key is the credential. Agent Kit calls this from the browser, so send the page Origin. With grant_code, the code is consumed atomically: concurrent attempts have exactly one winner, and unknown, used, expired and other-agent codes all return the same 401 GRANT_CODE_INVALID. The sign-in starts now and lasts the code's max_session_seconds. Unlike Shopify, a visitor without an account gets a token too: send publishable_key instead and a new anonymous customer (anon_…) is created, bound to the request Origin, for 7 days. The access token lasts at most two hours and never outlives the sign-in; renew it with access_tokens/renew before expires_at. Both forms share the per-IP minute limit of anonymous issuance (default 20). Example body: {"grant_code":"cgc_…"}.
390
- */
391
- export const createCustomerAccessToken = (options) => (options.client ?? client).post({
392
- url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens',
393
- ...options,
394
- headers: {
395
- 'Content-Type': 'application/json',
396
- ...options.headers
397
- }
398
- });
399
- /**
400
- * Renew customer access token
401
- *
402
- * Get a fresh customer access token in the same sign-in, authenticated with the current one.
403
- *
404
- * Send the current customer access token as the Bearer credential, with no body, a few minutes before expires_at. The new token keeps the version, budget, context, metadata and origin binding of the sign-in and lasts at most two hours, never past session_expires_at. Unlike Shopify, renewal does not revoke the presented token: it stays valid until its own expiry, so a reply that is streaming on it is not cut off. When less than 60 seconds of the sign-in remain, renewal returns 401 CUSTOMER_SESSION_EXPIRED; sign the customer in again with a new grant code from your backend. A token that was logged out or merged returns 401 ACCESS_TOKEN_REVOKED.
363
+ * Read a service agent's embed settings: the pages allowed to open its Kit chat (allowed_origins), the development switch (allow_localhost), what an embedded end user may upload (uploads) and whether the agent may be shared by link with the daily caps its visitors count against (share_links). The allow list decides where the agent can be embedded at all, so after deploying an application, add that application's URL origin here (scheme, host and port, never a path) before the page loads the agent — otherwise its Kit chat answers ORIGIN_NOT_ALLOWED. Budgets, monthly caps and token lifetime are set in the console and are not part of this API. An agent of another organization answers 404; an agent that is not a service agent answers 400.
405
364
  */
406
- export const renewCustomerAccessToken = (options) => (options.client ?? client).post({
365
+ export const getAgentEmbedPolicy = (options) => (options.client ?? client).get({
407
366
  security: [{
408
367
  key: 'BearerAuth',
409
368
  scheme: 'bearer',
@@ -413,17 +372,15 @@ export const renewCustomerAccessToken = (options) => (options.client ?? client).
413
372
  name: 'X-API-Key',
414
373
  type: 'apiKey'
415
374
  }],
416
- url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/renew',
375
+ url: '/agent/v1/agents/{agent_id}/embed_policy',
417
376
  ...options
418
377
  });
419
378
  /**
420
- * Log out customer
379
+ * Update agent embed policy
421
380
  *
422
- * Log the customer out by revoking the sign-in of the presented access token and every token issued in it.
423
- *
424
- * Send the current customer access token as the Bearer credential, with no body, when the customer logs out of your site. Every token of the sign-in, including renewed ones, stops working, and their live event streams close; the customer's conversations are kept. Returns 204. Calling it again with the same token returns 401 ACCESS_TOKEN_REVOKED, so treat that as already logged out.
381
+ * Change some of a service agent's embed settings. Only the fields you send change: everything you leave out, including the budgets and the token lifetime set in the console, is kept exactly as it was. Send allowed_origins so the pages that load the agent are allowed — an application's URL origin must be in the list before the application can embed the agent, or its Kit chat answers ORIGIN_NOT_ALLOWED. Send allow_localhost while developing on http://localhost, and uploads to open, close or bound file attachments for the embedded end user. Send share_links to let the agent be shared by link and to set the daily session and spending caps its share links count against; turning it on is refused unless the agent has an identity number. Values are checked by the service: an origin is normalized and must be https, and at most one leading wildcard label may match a single subdomain level. max_file_bytes is 1 to 104857600 bytes and max_files_per_session is 1 to 100. Example: POST /agent/v1/agents/{agent_id}/embed_policy with {"allowed_origins": ["https://my-app.example.com"]}.
425
382
  */
426
- export const deleteCurrentCustomerAccessToken = (options) => (options.client ?? client).delete({
383
+ export const updateAgentEmbedPolicy = (options) => (options.client ?? client).post({
427
384
  security: [{
428
385
  key: 'BearerAuth',
429
386
  scheme: 'bearer',
@@ -433,8 +390,12 @@ export const deleteCurrentCustomerAccessToken = (options) => (options.client ??
433
390
  name: 'X-API-Key',
434
391
  type: 'apiKey'
435
392
  }],
436
- url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens/current',
437
- ...options
393
+ url: '/agent/v1/agents/{agent_id}/embed_policy',
394
+ ...options,
395
+ headers: {
396
+ 'Content-Type': 'application/json',
397
+ ...options.headers
398
+ }
438
399
  });
439
400
  /**
440
401
  * List Computers
@@ -718,7 +679,7 @@ export const releaseComputerLease = (options) => (options.client ?? client).dele
718
679
  /**
719
680
  * List Toolsets
720
681
  *
721
- * Discover tool names, input schemas, read-only status and default permission policies before configuring an agent. The catalog is read-only: enable tools through agents.create or agents.update. agent_toolset_20260401 includes bash, edit, glob, grep, read, write, web_search, web_fetch, task_output, task_stop, monitor, agent, send_message, codemode and skill, plus todo_write, enter_plan_mode, ask_user_question and goal_read, which are listed so they can be switched off. Native additions require bash enabled; codemode requires bash (enabling it with bash disabled returns 400; keep bash enabled with permission_policy always_ask to restrict it); send_message also requires agent. To keep only some tools, set default_config.enabled to false and enable the wanted tools in configs; unlisted tools follow default_config. The catalog includes plugin names and versions. Sessions created through /anthropic/v1 expose only the eight official tools.
682
+ * Discover tool names, input schemas, read-only status and default permission policies before configuring an agent. The catalog is read-only: enable tools through agents.create or agents.update. agent_toolset_20260401 includes bash, edit, glob, grep, read, write, web_search, web_fetch, task_output, task_stop, monitor, agent, send_message, codemode and skill, plus todo_write, ask_user_question and goal_read, which are listed so they can be switched off. Native additions require bash enabled; codemode requires bash (enabling it with bash disabled returns 400; keep bash enabled with permission_policy always_ask to restrict it); send_message also requires agent. To keep only some tools, set default_config.enabled to false and enable the wanted tools in configs; unlisted tools follow default_config. The catalog includes plugin names and versions. Sessions created through /anthropic/v1 expose only the eight official tools.
722
683
  */
723
684
  export const listToolsets = (options) => (options?.client ?? client).get({
724
685
  security: [{
@@ -777,6 +738,54 @@ export const forkSession = (options) => (options.client ?? client).post({
777
738
  ...options.headers
778
739
  }
779
740
  });
741
+ /**
742
+ * Rename Session (Extension)
743
+ *
744
+ * Give a session a short, branch-like name; the main session is always main and cannot be renamed.
745
+ *
746
+ * Available only on /agent/v1. The name is normalized first (surrounding whitespace trimmed, upper case folded to lowercase, runs of whitespace become one hyphen, characters the rule does not admit dropped, and no hyphen left hanging at either end) and then validated: non-empty, at most 32 display columns wide (a Han character counts as two), made only of Han characters, lowercase ASCII letters, digits and hyphens, and never the reserved word main. A name another of the caller's own sessions already holds is not an error: the answer carries a numeric suffix (base-2, base-3, …). Renaming the main session returns 400; a missing session, one that belongs to another caller, or one the caller cannot write returns 404. Returns 200 with the same Session shape as retrieval, name set to the new name; one rename writes a session.renamed event. Example: POST /agent/v1/sessions/sesn_login/name with body {"name":"login-fix"}.
747
+ */
748
+ export const renameSession = (options) => (options.client ?? client).post({
749
+ security: [{
750
+ key: 'BearerAuth',
751
+ scheme: 'bearer',
752
+ type: 'http'
753
+ }, {
754
+ key: 'ApiKeyAuth',
755
+ name: 'X-API-Key',
756
+ type: 'apiKey'
757
+ }],
758
+ url: '/agent/v1/sessions/{session_id}/name',
759
+ ...options,
760
+ headers: {
761
+ 'Content-Type': 'application/json',
762
+ ...options.headers
763
+ }
764
+ });
765
+ /**
766
+ * Update session agent version
767
+ *
768
+ * Move one session to a version of its agent
769
+ *
770
+ * Without `version`, the session moves to the agent's active version — the version new sessions get now, which is not necessarily the newest saved one. With `version`, it moves to that existing version. The change is idempotent: asking for the version the session is already on answers the session and writes nothing, so the call may be repeated freely. A session that is running a turn answers 409 SESSION_CONFLICT and changes nothing, because a turn finishes on the version it started with; ask again once it is idle. The move writes a `session.updated` event carrying the agent version and the caller as its actor, so every version change is attributable. Main sessions additionally follow their agent's active version at the start of a person-started turn; this endpoint is the same move made explicitly, and it works on every kind of session, including worker sessions that never follow on their own.
771
+ */
772
+ export const updateSessionAgentVersion = (options) => (options.client ?? client).post({
773
+ security: [{
774
+ key: 'BearerAuth',
775
+ scheme: 'bearer',
776
+ type: 'http'
777
+ }, {
778
+ key: 'ApiKeyAuth',
779
+ name: 'X-API-Key',
780
+ type: 'apiKey'
781
+ }],
782
+ url: '/agent/v1/sessions/{session_id}/agent_version',
783
+ ...options,
784
+ headers: {
785
+ 'Content-Type': 'application/json',
786
+ ...options.headers
787
+ }
788
+ });
780
789
  /**
781
790
  * List Session Artifacts (Extension)
782
791
  *
@@ -965,6 +974,46 @@ export const listSessionCompactions = (options) => (options.client ?? client).ge
965
974
  url: '/agent/v1/sessions/{session_id}/compactions',
966
975
  ...options
967
976
  });
977
+ /**
978
+ * Upload a File (Extension)
979
+ *
980
+ * Start an upload for an embedded end user, so the browser can PUT the file's bytes straight to the File service and then attach the resulting file id to its own session. Use it only with an end-user token: a grant-bound end_user token uploads for its own agent, and an organization-level customer token must name the agent in the body (agent). A member, robot or user_key credential uses /file/v1 instead and gets 404 here. Body: filename (1–255 characters, its extension decides the blocked-type refusal), bytes (the positive byte length) and content_type (1–255 characters). Returns 201 with the File signed-upload answer: upload_id and expires_at, and url for a small file, or part_size, parts, complete_url and status_url for a large one; the addresses are returned here only and must never be stored or logged. The browser PUTs the bytes to the address (or to each part and then complete_url), which answers the File object and its file_id; then POST the file_id to /agent/v1/sessions/{session_id}/resources, and reference it in the message attachments. Refusals: 403 UPLOADS_DISABLED when uploads are off on the agent, 413 FILE_TOO_LARGE when bytes exceeds its uploads.max_file_bytes, 400 FILE_TYPE_REFUSED for a blocked executable or script extension, and 429 UPLOAD_RATE_LIMITED on the 31st unattached upload from the same user on the same agent within an hour. Example: POST /agent/v1/uploads with {"filename":"report.pdf","bytes":48211,"content_type":"application/pdf"}.
981
+ */
982
+ export const createAgentUpload = (options) => (options.client ?? client).post({
983
+ security: [{
984
+ key: 'BearerAuth',
985
+ scheme: 'bearer',
986
+ type: 'http'
987
+ }, {
988
+ key: 'ApiKeyAuth',
989
+ name: 'X-API-Key',
990
+ type: 'apiKey'
991
+ }],
992
+ url: '/agent/v1/uploads',
993
+ ...options,
994
+ headers: {
995
+ 'Content-Type': 'application/json',
996
+ ...options.headers
997
+ }
998
+ });
999
+ /**
1000
+ * Create Upload Content URL (Extension)
1001
+ *
1002
+ * Mint a short-lived read address for one file an embedded end user uploaded, so the page can show or download its own file again. Use it only with an end-user token; file_id is the id the File service returned after the bytes were uploaded. Returns 200 with url (an address that works for 900 seconds) and expires_at; never store or log the address. Only the caller's own upload answers: a file that belongs to someone else, a missing one, or one that did not start as an upload returns 404 FILE_NOT_FOUND, so a stranger cannot learn whether another person's file exists. The request body is empty. Example: POST /agent/v1/uploads/file-Ab12.../content_url.
1003
+ */
1004
+ export const createAgentUploadContentUrl = (options) => (options.client ?? client).post({
1005
+ security: [{
1006
+ key: 'BearerAuth',
1007
+ scheme: 'bearer',
1008
+ type: 'http'
1009
+ }, {
1010
+ key: 'ApiKeyAuth',
1011
+ name: 'X-API-Key',
1012
+ type: 'apiKey'
1013
+ }],
1014
+ url: '/agent/v1/uploads/{file_id}/content_url',
1015
+ ...options
1016
+ });
968
1017
  /**
969
1018
  * Generate speech
970
1019
  *
@@ -3028,7 +3077,7 @@ export const designateOrganizationPositionHead = (options) => (options.client ??
3028
3077
  /**
3029
3078
  * Hire into a position
3030
3079
  *
3031
- * Seats an existing member or agent in a vacant position; use it to fill a position that nobody holds, and use replace_holder to swap the current holder in one step. An actor is a person (human:usr_...) or an agent (agent:agent_...), treated identically, and must exist in your organization and not be archived. The position must be active and vacant, and a position has at most one active assignment. An actor may hold several positions, and exactly one of its active assignments is primary: omit primary to make the first assignment primary and later ones concurrent; primary true makes this one primary and turns the previous primary into a concurrent one; primary false for an actor that holds nothing is refused. request_id makes the call idempotent: repeating it returns the first assignment and seats nobody else. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing request_id, a candidate.kind other than member, an empty candidate.actor, a non-boolean primary or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND when the actor is not an active member or agent of your organization; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED; 409 PRIMARY_ASSIGNMENT_REQUIRED for primary false on an actor that holds nothing. Example body: {"candidate":{"kind":"member","actor":"human:usr_123"},"request_id":"hire-support-1"}.
3080
+ * Seats an existing member or agent in a vacant position; use it to fill a position that nobody holds, and use replace_holder to swap the current holder in one step. An actor is a person (human:usr_...) or an agent (agent:agent_...), treated identically, and must exist in your organization and not be archived. An agent created moments ago may not be in the organization roster yet (agents enter it asynchronously): that answers 503 ACTOR_SYNCING with a Retry-After header and retryable true, and the same call succeeds after that wait. The position must be active and vacant, and a position has at most one active assignment. An actor may hold several positions, and exactly one of its active assignments is primary: omit primary to make the first assignment primary and later ones concurrent; primary true makes this one primary and turns the previous primary into a concurrent one; primary false for an actor that holds nothing is refused. request_id makes the call idempotent: repeating it returns the first assignment and seats nobody else. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing request_id, a candidate.kind other than member, an empty candidate.actor, a non-boolean primary or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND when the actor is not an active member or agent of your organization; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED; 409 PRIMARY_ASSIGNMENT_REQUIRED for primary false on an actor that holds nothing. Example body: {"candidate":{"kind":"member","actor":"human:usr_123"},"request_id":"hire-support-1"}.
3032
3081
  */
3033
3082
  export const hireOrganizationPosition = (options) => (options.client ?? client).post({
3034
3083
  security: [{
@@ -3836,7 +3885,7 @@ export const sessionsDelete = (options) => (options.client ?? client).delete({
3836
3885
  /**
3837
3886
  * Get session
3838
3887
  *
3839
- * Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on a light machine; no environment lookup or provisioning is needed for a codemode calculation.
3888
+ * Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on the agent version's default environment, node22.
3840
3889
  */
3841
3890
  export const sessionsRetrieve = (options) => (options.client ?? client).get({
3842
3891
  security: [{
@@ -3894,7 +3943,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
3894
3943
  /**
3895
3944
  * Create agent
3896
3945
  *
3897
- * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, enter_plan_mode, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; omit computer_id to register a new computer named after the agent without starting an instance, or provide an existing computer_id; vault_ids are accepted, bindings and environment_id are refused. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
3946
+ * Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. kind defaults to service when it is omitted and no computer_id is given, and to general when computer_id is given; it cannot change after creation. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; omit computer_id to register a new computer named after the agent without starting an instance, or provide an existing computer_id; vault_ids are accepted, bindings and environment_id are refused. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
3898
3947
  */
3899
3948
  export const agentsCreate = (options) => (options.client ?? client).post({
3900
3949
  security: [{
@@ -4010,7 +4059,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
4010
4059
  /**
4011
4060
  * Create session
4012
4061
  *
4013
- * Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (light for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion. Assume agents return 400 INVALID_PARAMS; drive them over MCP at /agent/v1/agents/{id}/mcp instead.
4062
+ * Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (node22 for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. The retired "light" returns 400 naming the two forms that work: "node22", or null for no machine. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion. Assume agents return 400 INVALID_PARAMS; drive them over MCP at /agent/v1/agents/{id}/mcp instead.
4014
4063
  */
4015
4064
  export const sessionsCreate = (options) => (options.client ?? client).post({
4016
4065
  security: [{
@@ -6966,6 +7015,193 @@ export const canvasRestoreCanvas = (options) => (options.client ?? client).post(
6966
7015
  ...options.headers
6967
7016
  }
6968
7017
  });
7018
+ /**
7019
+ * List contents
7020
+ *
7021
+ * Discover the video contents of the API key's organization and obtain the content_id each later call takes. Archived contents stay out of the list unless status is archived; results are ordered by update_time, newest first. Filter with status (draft, published, unpublished or archived), kind (video), asset_id (the Media asset a content was made from) and q (a substring of the title). page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null, keeping the same filters.
7022
+ */
7023
+ export const contentListContents = (options) => (options?.client ?? client).get({
7024
+ security: [{
7025
+ key: 'BearerAuth',
7026
+ scheme: 'bearer',
7027
+ type: 'http'
7028
+ }, {
7029
+ key: 'ApiKeyAuth',
7030
+ name: 'X-API-Key',
7031
+ type: 'apiKey'
7032
+ }],
7033
+ url: '/content/v1/contents',
7034
+ ...options
7035
+ });
7036
+ /**
7037
+ * Create a content
7038
+ *
7039
+ * Create a video content from one asset of a Media library, before publishing it to end users. Send library_id and asset_id from `praxis.media` (assets.create, assets.list or the asset you uploaded return them); the create pins asset_version (default 1) and immediately asks Media to transcode the wanted renditions, so the content reports readiness processing until they are ready. kind is video, the only kind today. settings is optional and its four groups are merged over the service defaults: source (library_id and asset_id required, asset_version 1, follow_new_versions false, renditions 480/720/1080), access (capability_seconds 600 within 100 to 3000, encryption false, allowed_origins empty), player (poster null, show_title true, accent_color null, default_quality auto, speeds 0.75/1/1.25/1.5/2, storyboard true, autoplay false, remember_position true) and description (at most 2000 characters). An unknown field — including mode, which was removed because a content is always signed — is refused by name with 400. Returns the new content with HTTP 201; save its id for publish, versions and playback calls.
7040
+ */
7041
+ export const contentCreateContent = (options) => (options.client ?? client).post({
7042
+ security: [{
7043
+ key: 'BearerAuth',
7044
+ scheme: 'bearer',
7045
+ type: 'http'
7046
+ }, {
7047
+ key: 'ApiKeyAuth',
7048
+ name: 'X-API-Key',
7049
+ type: 'apiKey'
7050
+ }],
7051
+ url: '/content/v1/contents',
7052
+ ...options,
7053
+ headers: {
7054
+ 'Content-Type': 'application/json',
7055
+ ...options.headers
7056
+ }
7057
+ });
7058
+ /**
7059
+ * Get a content
7060
+ *
7061
+ * Read one content with the settings that decide its playback: the source it publishes, its access settings, its player settings, its description, and the version numbers publish and versions calls need. Use it to see the status and readiness before publishing, or to read the live_version a playback will play. A content of another organization, and an archived or unknown id, all answer 404 CONTENT_NOT_FOUND.
7062
+ */
7063
+ export const contentGetContent = (options) => (options.client ?? client).get({
7064
+ security: [{
7065
+ key: 'BearerAuth',
7066
+ scheme: 'bearer',
7067
+ type: 'http'
7068
+ }, {
7069
+ key: 'ApiKeyAuth',
7070
+ name: 'X-API-Key',
7071
+ type: 'apiKey'
7072
+ }],
7073
+ url: '/content/v1/contents/{content_id}',
7074
+ ...options
7075
+ });
7076
+ /**
7077
+ * Update a content
7078
+ *
7079
+ * Change a content's title, its settings, or both. Send only what changes: each settings group left out keeps its current value, and a group sent is a deep merge, so changing only access.capability_seconds leaves allowed_origins alone. A settings change makes a new version and never touches the live one, except access settings (capability_seconds, encryption, allowed_origins), which a playback reads from the latest version and so take effect at once with no republish (ADR-145 §4). A title-only change makes no version. Changing source (library_id, asset_id, asset_version, library_id, asset_id or renditions) asks Media to transcode again and needs a republish to play. An archived content is final and answers 409 CONTENT_INVALID_STATE.
7080
+ */
7081
+ export const contentUpdateContent = (options) => (options.client ?? client).patch({
7082
+ security: [{
7083
+ key: 'BearerAuth',
7084
+ scheme: 'bearer',
7085
+ type: 'http'
7086
+ }, {
7087
+ key: 'ApiKeyAuth',
7088
+ name: 'X-API-Key',
7089
+ type: 'apiKey'
7090
+ }],
7091
+ url: '/content/v1/contents/{content_id}',
7092
+ ...options,
7093
+ headers: {
7094
+ 'Content-Type': 'application/json',
7095
+ ...options.headers
7096
+ }
7097
+ });
7098
+ /**
7099
+ * Publish a content
7100
+ *
7101
+ * Make a content playable: publish the latest version, or pin the version you send in version to become the live one. Use it after the content's readiness is ready; publishing a version whose renditions are still transcoding answers 409 SOURCE_NOT_READY, and you retry once Media reports ready. A content that is already published can be published again with another version, which swaps the live one; an archived content answers 409 CONTENT_INVALID_STATE. Returns the content with status published and the new live_version. Only a published content opens a playback session.
7102
+ */
7103
+ export const contentPublishContent = (options) => (options.client ?? client).post({
7104
+ security: [{
7105
+ key: 'BearerAuth',
7106
+ scheme: 'bearer',
7107
+ type: 'http'
7108
+ }, {
7109
+ key: 'ApiKeyAuth',
7110
+ name: 'X-API-Key',
7111
+ type: 'apiKey'
7112
+ }],
7113
+ url: '/content/v1/contents/{content_id}/publish',
7114
+ ...options,
7115
+ headers: {
7116
+ 'Content-Type': 'application/json',
7117
+ ...options.headers
7118
+ }
7119
+ });
7120
+ /**
7121
+ * Unpublish a content
7122
+ *
7123
+ * Take a published content offline without deleting it or losing a version. No playback opens on it afterwards, while capabilities already issued run out by themselves within their lifetime (at most 3000 seconds). Publishing it again with a version brings it back. Only a published content can be unpublished; any other state answers 409 CONTENT_INVALID_STATE. Returns the content with status unpublished and its live_version kept for the next publish.
7124
+ */
7125
+ export const contentUnpublishContent = (options) => (options.client ?? client).post({
7126
+ security: [{
7127
+ key: 'BearerAuth',
7128
+ scheme: 'bearer',
7129
+ type: 'http'
7130
+ }, {
7131
+ key: 'ApiKeyAuth',
7132
+ name: 'X-API-Key',
7133
+ type: 'apiKey'
7134
+ }],
7135
+ url: '/content/v1/contents/{content_id}/unpublish',
7136
+ ...options
7137
+ });
7138
+ /**
7139
+ * Archive a content
7140
+ *
7141
+ * Close a content permanently when it is no longer published. A published content must be unpublished first, because a live content is never archived directly; archiving a published content answers 409 CONTENT_INVALID_STATE. An archived content is final: it cannot be republished, edited or archived again, it stays out of the list unless status is archived, and no playback opens on it. Returns the content with status archived and archive_time set.
7142
+ */
7143
+ export const contentArchiveContent = (options) => (options.client ?? client).post({
7144
+ security: [{
7145
+ key: 'BearerAuth',
7146
+ scheme: 'bearer',
7147
+ type: 'http'
7148
+ }, {
7149
+ key: 'ApiKeyAuth',
7150
+ name: 'X-API-Key',
7151
+ type: 'apiKey'
7152
+ }],
7153
+ url: '/content/v1/contents/{content_id}/archive',
7154
+ ...options
7155
+ });
7156
+ /**
7157
+ * List versions
7158
+ *
7159
+ * Read the immutable version history of a content, newest version first. Each entry is a snapshot of the settings at the time it was saved, with live telling whether that version is the one a playback plays. Use it to find the version number to pin in publish, or to read the access settings a playback is currently reading (they come from the latest version). page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null.
7160
+ */
7161
+ export const contentListVersions = (options) => (options.client ?? client).get({
7162
+ security: [{
7163
+ key: 'BearerAuth',
7164
+ scheme: 'bearer',
7165
+ type: 'http'
7166
+ }, {
7167
+ key: 'ApiKeyAuth',
7168
+ name: 'X-API-Key',
7169
+ type: 'apiKey'
7170
+ }],
7171
+ url: '/content/v1/contents/{content_id}/versions',
7172
+ ...options
7173
+ });
7174
+ /**
7175
+ * Get a version
7176
+ *
7177
+ * Read one immutable version of a content: the settings exactly as they were saved, the live flag, when it was created and which actor created it. Use it to compare a version with the live one before pinning it in publish, or to check the access settings a playback is currently reading. The version segment is the positive version number from the versions list; an unknown number answers 404 VERSION_NOT_FOUND and an unknown content 404 CONTENT_NOT_FOUND.
7178
+ */
7179
+ export const contentGetVersion = (options) => (options.client ?? client).get({
7180
+ security: [{
7181
+ key: 'BearerAuth',
7182
+ scheme: 'bearer',
7183
+ type: 'http'
7184
+ }, {
7185
+ key: 'ApiKeyAuth',
7186
+ name: 'X-API-Key',
7187
+ type: 'apiKey'
7188
+ }],
7189
+ url: '/content/v1/contents/{content_id}/versions/{version}',
7190
+ ...options
7191
+ });
7192
+ /**
7193
+ * Open a playback session
7194
+ *
7195
+ * Open one playback of a published content for an end user and get the manifest address a player loads. No platform API key is needed: the caller is the end user's own Praxis customer access token carried as `Authorization: Bearer <access_token>`, verified by this door exactly as the customer exchange verifies it. A caller with no token is left to the service, which refuses it RESOURCE_NOT_GRANTED, because a content is always signed and there is no public playback. The organization is taken from the content row, never from the token, and a token that claims another organization is refused. The content must be published (otherwise 403 CONTENT_NOT_PUBLISHED), its allowed_origins must accept the request Origin when the list is not empty (otherwise 403 ORIGIN_NOT_ALLOWED), the token must cover a resource for this content (otherwise 403 RESOURCE_NOT_GRANTED) and the pinned version must be ready (otherwise 409 SOURCE_NOT_READY; retry once readiness is ready). Returns HTTP 201 with the session id, manifest_url (https://content.praxisusercontent.com/{content_id}/{capability}/master.m3u8), expire_time, the renditions, the poster, the title when the player shows it, and the player settings. The playback reads access settings from the content's latest version and source and player from the live version, so a tightened origin or lifetime takes effect without a republish. This door has its own per-IP request budget: over it answers 429 RATE_LIMITED with Retry-After.
7196
+ */
7197
+ export const contentCreatePlaybackSession = (options) => (options.client ?? client).post({
7198
+ url: '/content/v1/playback/sessions',
7199
+ ...options,
7200
+ headers: {
7201
+ 'Content-Type': 'application/json',
7202
+ ...options.headers
7203
+ }
7204
+ });
6969
7205
  /**
6970
7206
  * List records
6971
7207
  *
@@ -7556,6 +7792,241 @@ export const crmLayoutsUpdate = (options) => (options.client ?? client).put({
7556
7792
  ...options.headers
7557
7793
  }
7558
7794
  });
7795
+ /**
7796
+ * Create a grant code
7797
+ *
7798
+ * Sign one of your logged-in end users in from your backend, after your own login succeeded, by handing out a one-time grant code that the browser exchanges for an access token. Call it with the organization API key; never from the browser, because the API key must stay on your server. customer_id is your own identifier for the person (an opaque value such as your database user id, not an email address or phone number); a value starting with anon_ is reserved for anonymous visitors. resources name what the sign-in may reach and is required: each entry is a scope string in the form agent:<id>:chat, content:<id>:play or application:<id>:visit, or an object with that scope plus product params this service stores without interpreting; use the id form for one object and * for every object of a type. expires_in shortens the code's life in seconds (900 seconds, fifteen minutes, by default) and max_session_seconds shortens the sign-in's life (7 days by default); merge_customer_id merges an anonymous visitor's record into this person; origin pins the page the sign-in may be made from. When the browser still holds that visitor's own access token, send it as anonymous_access_token instead of merge_customer_id: the door verifies it and merges the visitor it names, which is the usual way a merchant continues a session the browser already began. The code is single use and unknown, used or expired codes all answer 401 GRANT_CODE_INVALID at the exchange. Returns the code with HTTP 201; pass it to the Kit in the browser and never call this route with it.
7799
+ */
7800
+ export const customerCreateGrantCode = (options) => (options.client ?? client).post({
7801
+ security: [{
7802
+ key: 'BearerAuth',
7803
+ scheme: 'bearer',
7804
+ type: 'http'
7805
+ }, {
7806
+ key: 'ApiKeyAuth',
7807
+ name: 'X-API-Key',
7808
+ type: 'apiKey'
7809
+ }],
7810
+ url: '/customer/v1/grant_codes',
7811
+ ...options,
7812
+ headers: {
7813
+ 'Content-Type': 'application/json',
7814
+ ...options.headers
7815
+ }
7816
+ });
7817
+ /**
7818
+ * Exchange a grant code or publishable key
7819
+ *
7820
+ * Turn a grant code, or a publishable key for an anonymous visitor, into the Praxis customer access token that authorizes the Kit's sessions and playbacks. It is PRE-AUTH: no platform API key is needed, because the grant code or the publishable key is the credential; the Kit calls it from the browser, so send the page Origin when the code or key is bound to one. Send exactly one of grant_code or publishable_key — the door refuses any other combination with 400. With grant_code the code is consumed atomically: concurrent attempts have exactly one winner, and unknown, already used, expired and foreign codes all answer 401 GRANT_CODE_INVALID. With publishable_key a new anonymous customer (anon_…) is created and merged into the identified one later if it signs in. The sign-in may be bound to an origin at creation; when the request Origin does not satisfy it, the exchange answers 403 ORIGIN_NOT_ALLOWED, and a blocked end user answers 403 CUSTOMER_BLOCKED. The access token lasts at most two hours and never outlives the sign-in; renew it with praxis.customer.accessTokens.renew before expires_at. This door has its own per-IP anonymous budget: over it answers 429 RATE_LIMITED with Retry-After.
7821
+ */
7822
+ export const customerCreateAccessToken = (options) => (options.client ?? client).post({
7823
+ url: '/customer/v1/access_tokens',
7824
+ ...options,
7825
+ headers: {
7826
+ 'Content-Type': 'application/json',
7827
+ ...options.headers
7828
+ }
7829
+ });
7830
+ /**
7831
+ * Renew an access token
7832
+ *
7833
+ * Replace a live access token with a fresh one so a signed-in end user stays signed in without signing in again. It is PRE-AUTH: the credential is the token the caller already carries as `Authorization: Bearer <access_token>`, verified by this door, and the token names the sign-in it renews. Call it before the token's expires_at; the sign-in and its resource scopes stay the same, so what the end user may reach does not change. A missing, unverifiable or foreign token answers 401 ACCESS_TOKEN_EXPIRED, and a sign-in that is over answers 401 SIGN_IN_EXPIRED or SIGN_IN_REVOKED, in which case the end user signs in again through praxis.customer.accessTokens.create. A blocked end user answers 403 CUSTOMER_BLOCKED. When the sign-in itself has ended, the renewal does not extend it. This door has its own per-IP anonymous budget: over it answers 429 RATE_LIMITED with Retry-After.
7834
+ */
7835
+ export const customerRenewAccessToken = (options) => (options?.client ?? client).post({ url: '/customer/v1/access_tokens/renew', ...options });
7836
+ /**
7837
+ * Sign out the current token
7838
+ *
7839
+ * Sign out: end the sign-in the caller's token belongs to and revoke every token issued from it, exactly as a logout does. It is PRE-AUTH: the credential is the token the caller carries as `Authorization: Bearer <access_token>`. Use it when the end user asks to sign out, and after it every token of that sign-in stops working and a later session or playback answers 401 SIGN_IN_REVOKED; other sign-ins of the same end user are untouched (revoke every token of one end user, organization-wide, with praxis.customer.customers.revokeTokens). A missing or unverifiable token answers 401 ACCESS_TOKEN_EXPIRED. The call answers 200 with an empty body. This door has its own per-IP anonymous budget: over it answers 429 RATE_LIMITED with Retry-After.
7840
+ */
7841
+ export const customerRevokeCurrentTokens = (options) => (options?.client ?? client).delete({ url: '/customer/v1/access_tokens/current', ...options });
7842
+ /**
7843
+ * List end users
7844
+ *
7845
+ * Read the organization's end-user directory and obtain the customer_id the administrative acts take. Results are ordered by last_seen_at, most recently seen first. Filter with type (identified for people who signed in through a grant code, anonymous for visitors admitted with a publishable key), blocked (true or false), resource (one product in the form agent:<id>, content:<id> or application:<id>, giving that product's own view of the directory) and q (a prefix of the customer id). Identified and anonymous end users both appear; an anonymous one that later signs in shows merged_into and its record joins that person. page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null, keeping the same filters.
7846
+ */
7847
+ export const customerListCustomers = (options) => (options?.client ?? client).get({
7848
+ security: [{
7849
+ key: 'BearerAuth',
7850
+ scheme: 'bearer',
7851
+ type: 'http'
7852
+ }, {
7853
+ key: 'ApiKeyAuth',
7854
+ name: 'X-API-Key',
7855
+ type: 'apiKey'
7856
+ }],
7857
+ url: '/customer/v1/customers',
7858
+ ...options
7859
+ });
7860
+ /**
7861
+ * Delete an end user
7862
+ *
7863
+ * Delete one end user on the merchant's own confirmation, for a deletion request the person made to you. The confirm query parameter must repeat the path's customer_id; the door passes it through verbatim and the service refuses any other value with 400 INVALID_PARAMS, so a missing confirm never deletes anything. The deletion is announced on the platform event bus and each product deletes its own sessions, events and files for that person, so the call returns as soon as the directory record is gone, not when every product has finished. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
7864
+ */
7865
+ export const customerDeleteCustomer = (options) => (options.client ?? client).delete({
7866
+ security: [{
7867
+ key: 'BearerAuth',
7868
+ scheme: 'bearer',
7869
+ type: 'http'
7870
+ }, {
7871
+ key: 'ApiKeyAuth',
7872
+ name: 'X-API-Key',
7873
+ type: 'apiKey'
7874
+ }],
7875
+ url: '/customer/v1/customers/{customer_id}',
7876
+ ...options
7877
+ });
7878
+ /**
7879
+ * Get an end user
7880
+ *
7881
+ * Read one end user of the organization: the id, its kind, whether it is blocked, its metadata and when it was first and last seen. Add expand=products,sign_ins,usage (comma separated, any combination) to also receive the products it has used with their counts, its sign-ins with their resource scopes, and its recorded usage over the whole time. An unknown id, and an id of another organization, answer 404 CUSTOMER_NOT_FOUND.
7882
+ */
7883
+ export const customerGetCustomer = (options) => (options.client ?? client).get({
7884
+ security: [{
7885
+ key: 'BearerAuth',
7886
+ scheme: 'bearer',
7887
+ type: 'http'
7888
+ }, {
7889
+ key: 'ApiKeyAuth',
7890
+ name: 'X-API-Key',
7891
+ type: 'apiKey'
7892
+ }],
7893
+ url: '/customer/v1/customers/{customer_id}',
7894
+ ...options
7895
+ });
7896
+ /**
7897
+ * Read end-user usage
7898
+ *
7899
+ * Read what one end user has cost the organization, per product and per day. The directory stores no cost itself: this reads billing by the customerId dimension shared by every product, so it is the money figure the platform charged for that person. Send from and/or to as RFC 3339 times to narrow the window; omit both for everything recorded. Returns the total, the per-product breakdown and the per-day breakdown. An unknown id answers 404 CUSTOMER_NOT_FOUND.
7900
+ */
7901
+ export const customerGetUsage = (options) => (options.client ?? client).get({
7902
+ security: [{
7903
+ key: 'BearerAuth',
7904
+ scheme: 'bearer',
7905
+ type: 'http'
7906
+ }, {
7907
+ key: 'ApiKeyAuth',
7908
+ name: 'X-API-Key',
7909
+ type: 'apiKey'
7910
+ }],
7911
+ url: '/customer/v1/customers/{customer_id}/usage',
7912
+ ...options
7913
+ });
7914
+ /**
7915
+ * Block an end user
7916
+ *
7917
+ * Block one end user across every product of the organization. From then on no grant code, sign-in, renewal or new session and no playback is accepted for this id — each product's admission door refuses it at once. A stream already running and a playback capability already issued ride out their own token, at most two hours and 3000 seconds; they are not cut off. Send reason to record why, and the response's blocked field carries the block time, the reason and the actor. Blocking an already blocked end user is idempotent: the first block time is kept. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
7918
+ */
7919
+ export const customerBlockCustomer = (options) => (options.client ?? client).post({
7920
+ security: [{
7921
+ key: 'BearerAuth',
7922
+ scheme: 'bearer',
7923
+ type: 'http'
7924
+ }, {
7925
+ key: 'ApiKeyAuth',
7926
+ name: 'X-API-Key',
7927
+ type: 'apiKey'
7928
+ }],
7929
+ url: '/customer/v1/customers/{customer_id}/block',
7930
+ ...options,
7931
+ headers: {
7932
+ 'Content-Type': 'application/json',
7933
+ ...options.headers
7934
+ }
7935
+ });
7936
+ /**
7937
+ * Unblock an end user
7938
+ *
7939
+ * Lift a block from one end user, so the products accept its grant codes, sign-ins, renewals and new sessions again. Tokens that were revoked to enforce the block are not restored: the end user signs in again for a fresh sign-in. Unblocking an end user that is not blocked is idempotent and returns it unchanged. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
7940
+ */
7941
+ export const customerUnblockCustomer = (options) => (options.client ?? client).post({
7942
+ security: [{
7943
+ key: 'BearerAuth',
7944
+ scheme: 'bearer',
7945
+ type: 'http'
7946
+ }, {
7947
+ key: 'ApiKeyAuth',
7948
+ name: 'X-API-Key',
7949
+ type: 'apiKey'
7950
+ }],
7951
+ url: '/customer/v1/customers/{customer_id}/unblock',
7952
+ ...options
7953
+ });
7954
+ /**
7955
+ * Revoke every token of an end user
7956
+ *
7957
+ * End every sign-in of one end user at once, everything of the organization's, not one product's and not one token's. Use it when credentials may have leaked and the end user must not be trusted until it signs in again; a single sign-in is ended instead with praxis.customer.accessTokens.revoke. After it every token of that end user stops working and a new session or playback answers 401 SIGN_IN_REVOKED, while the end user itself stays in the directory and may sign in again. The response counts how many sign-ins were revoked. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
7958
+ */
7959
+ export const customerRevokeTokens = (options) => (options.client ?? client).post({
7960
+ security: [{
7961
+ key: 'BearerAuth',
7962
+ scheme: 'bearer',
7963
+ type: 'http'
7964
+ }, {
7965
+ key: 'ApiKeyAuth',
7966
+ name: 'X-API-Key',
7967
+ type: 'apiKey'
7968
+ }],
7969
+ url: '/customer/v1/customers/{customer_id}/revoke_tokens',
7970
+ ...options
7971
+ });
7972
+ /**
7973
+ * List publishable keys
7974
+ *
7975
+ * List the organization's publishable keys, newest first, so you can see which anonymous admittance is open and what each one may reach. A publishable key is public by design (it ships in the browser page); use it from the Kit to admit anonymous visitors, and never expose an API key this way. The plaintext value is not in this list: it is returned once, by the create call, and only its hash is stored. page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null.
7976
+ */
7977
+ export const customerListPublishableKeys = (options) => (options?.client ?? client).get({
7978
+ security: [{
7979
+ key: 'BearerAuth',
7980
+ scheme: 'bearer',
7981
+ type: 'http'
7982
+ }, {
7983
+ key: 'ApiKeyAuth',
7984
+ name: 'X-API-Key',
7985
+ type: 'apiKey'
7986
+ }],
7987
+ url: '/customer/v1/publishable_keys',
7988
+ ...options
7989
+ });
7990
+ /**
7991
+ * Create a publishable key
7992
+ *
7993
+ * Mint a publishable key so a page can admit anonymous visitors without you signing each one in from your backend. name labels the key for the console and the key list. resources is required and names what an anonymous visitor may reach, in the same form as the grant-code scopes: agent:<id>:chat, content:<id>:play or application:<id>:visit, with * for every object of one type; give it only what the anonymous experience needs, because any visitor who has the page can use the key. The response carries the plaintext key once, in key, and the store keeps only its hash — save it then, because no later call returns it. Returns HTTP 201; the exchange that consumes it is praxis.customer.accessTokens.create with publishable_key.
7994
+ */
7995
+ export const customerCreatePublishableKey = (options) => (options.client ?? client).post({
7996
+ security: [{
7997
+ key: 'BearerAuth',
7998
+ scheme: 'bearer',
7999
+ type: 'http'
8000
+ }, {
8001
+ key: 'ApiKeyAuth',
8002
+ name: 'X-API-Key',
8003
+ type: 'apiKey'
8004
+ }],
8005
+ url: '/customer/v1/publishable_keys',
8006
+ ...options,
8007
+ headers: {
8008
+ 'Content-Type': 'application/json',
8009
+ ...options.headers
8010
+ }
8011
+ });
8012
+ /**
8013
+ * Delete a publishable key
8014
+ *
8015
+ * Delete a publishable key, closing that anonymous admittance for good. A page that still carries the plaintext key can no longer exchange it; any anonymous sign-ins it already made keep working until their own sign-in expires, so end users already admitted are not signed out by this call. Get the key id from the publishable key list, not from the plaintext value (only its hash is stored). An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
8016
+ */
8017
+ export const customerDeletePublishableKey = (options) => (options.client ?? client).delete({
8018
+ security: [{
8019
+ key: 'BearerAuth',
8020
+ scheme: 'bearer',
8021
+ type: 'http'
8022
+ }, {
8023
+ key: 'ApiKeyAuth',
8024
+ name: 'X-API-Key',
8025
+ type: 'apiKey'
8026
+ }],
8027
+ url: '/customer/v1/publishable_keys/{key_id}',
8028
+ ...options
8029
+ });
7559
8030
  /**
7560
8031
  * List projects
7561
8032
  *
@@ -7758,8 +8229,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
7758
8229
  * - `transform` — Position, scale, rotation, opacity, crop, blur.
7759
8230
  * - `fit` — contain, cover, fill or none.
7760
8231
  * - `blend` — Layer blend mode; null clears.
7761
- * - `style` — Text styling: font, fill, strokes, glow, position.
7762
- * - `style.position` — top, middle or bottom; omit it, never null.
8232
+ * - `style` — Text styling in Shotstack's rich shape: font, gradient, stroke, shadow, box, border, align, per-word animation.
8233
+ * - `style.align.vertical` — top, middle or bottom; omit it, never null.
7763
8234
  * - `playback` — Rate, direction, audio policy, or freeze.
7764
8235
  * - `volumeDb` — Audio level in dB; 0 is source level.
7765
8236
  * - `gain` — Keyframed audio level in dB.
@@ -7780,6 +8251,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
7780
8251
  * - `JOIN_CONFLICT` — A join is invalid or blocks this edit.
7781
8252
  * - `INVALID_TRANSITION` — Bad transition kind, parameter or length.
7782
8253
  * - `INVALID_STYLE` — A style value is out of range.
8254
+ * - `UNSUPPORTED_STYLE_FIELD` — A Shotstack style field this platform cannot render yet.
8255
+ * - `STYLE_LEGACY_FIELDS` — A style written in the old flat shape; it still works.
7783
8256
  * - `INVALID_MASK` — A mask definition is malformed.
7784
8257
  * - `MASK_IN_USE` — The edit would break a live mask.
7785
8258
  * - `TOO_MANY_MASKS` — At most 16 masks per project.
@@ -8807,6 +9280,20 @@ export const devopsTestReportsUpload = (options) => (options.client ?? client).p
8807
9280
  ...options.headers
8808
9281
  }
8809
9282
  });
9283
+ /**
9284
+ * Retrieve the merge gate's test plan at a commit
9285
+ *
9286
+ * Ask what the merge gate would require at one commit before running anything: the packages the base...commit diff affects, each package's input hash at that commit's own tree, and whether evidence already answers it. Read a package as passed when a recorded run covered every case the package has at the gate's sizes and they passed, failed when the newest evidence at its input hash failed, and missing when no run has a row for that (package, input hash). Use it before running tests — `praxis devops test --gate` asks this and runs exactly the missing and failed packages — or to explain a gate verdict, because it is the same required set and the same (package, input hash) lookup the gate itself decides on. The call is read-only: it starts no run, runs no case and writes nothing. The commit must already be pushed, since the hashes are recomputed from the tree GitHub holds; a commit whose tree cannot be read answers COMMIT_NOT_FOUND instead of an empty plan. A selection of nothing means every changed path belongs to no test package, which is a pass and not a failure.
9287
+ */
9288
+ export const devopsTestPlanGet = (options) => (options.client ?? client).get({
9289
+ security: [{
9290
+ key: 'devops-bearerAuth',
9291
+ scheme: 'bearer',
9292
+ type: 'http'
9293
+ }],
9294
+ url: '/devops/v1/projects/{project}/test-plan',
9295
+ ...options
9296
+ });
8810
9297
  /**
8811
9298
  * List projects
8812
9299
  *
@@ -9533,6 +10020,38 @@ export const devopsChangesMarkLastSlice = (options) => (options.client ?? client
9533
10020
  ...options.headers
9534
10021
  }
9535
10022
  });
10023
+ /**
10024
+ * Open a change's pull request
10025
+ *
10026
+ * Open the pull request for a change: its branch into the project's default branch, opened by DevOps's own GitHub App. A cloud workspace holds no GitHub credential, so this is how work pushed with the unit push becomes a pull request; `praxis devops change pr` calls it from the workspace. Push first: a branch with no commits beyond the default branch is refused with PULL_REQUEST_REFUSED and GitHub's words. A branch that already has an open pull request answers that one with created=false, so calling again is safe; when the call passes a title or a body, those fields are written onto that pull request (GitHub PATCH /pulls/{number}) and the answer says updated=true, while a field not passed is left as it is — which is how a wrong or missing description is corrected, and how the merge gate's exposure-declared check is re-evaluated from the new body. Only an open pull request can be rewritten: once it is merged or closed its head branch is usually deleted with it, so a call that names a title or a body is refused with PULL_REQUEST_NOT_OPEN, naming that pull request and the branch, instead of trying to open a second one. The pull request then appears on the change and runs its merge gate as usual. The id is the branch name; give it as it comes back (fix/expired-links) — the SDK and the CLI encode the slash themselves, and only a hand-written HTTP request sends fix%2Fexpired-links.
10027
+ */
10028
+ export const devopsChangesOpenPullRequest = (options) => (options.client ?? client).post({
10029
+ security: [{
10030
+ key: 'devops-bearerAuth',
10031
+ scheme: 'bearer',
10032
+ type: 'http'
10033
+ }],
10034
+ url: '/devops/v1/changes/{id}:openPullRequest',
10035
+ ...options,
10036
+ headers: {
10037
+ 'Content-Type': 'application/json',
10038
+ ...options.headers
10039
+ }
10040
+ });
10041
+ /**
10042
+ * Get a change workspace's read-only git credential
10043
+ *
10044
+ * A read-only git credential for the repository a change's project is bound to: a GitHub App installation token limited to that one repository with contents read, which GitHub expires within an hour. It exists for git's credential helper inside the change's cloud workspace (`praxis devops change git-credential`, installed by DevOps when it clones the repository), so `git fetch`, history and lazily fetched file contents work there; the helper hands the token to that one git request and keeps nothing. Writing is never possible with it: commits reach the branch only through the unit push. You do not need to call this yourself. Anyone who can read the change can read its repository already through the code reads, so this grants no new access. An abandoned change is refused with INVALID_ARGUMENT and a project without a repository with SOURCE_NOT_CONFIGURED. The id is the branch name and its slash must be percent-encoded in the path (fix%2Fexpired-links).
10045
+ */
10046
+ export const devopsChangesGitCredential = (options) => (options.client ?? client).post({
10047
+ security: [{
10048
+ key: 'devops-bearerAuth',
10049
+ scheme: 'bearer',
10050
+ type: 'http'
10051
+ }],
10052
+ url: '/devops/v1/changes/{id}:gitCredential',
10053
+ ...options
10054
+ });
9536
10055
  /**
9537
10056
  * List a project's pull requests
9538
10057
  *
@@ -10702,7 +11221,7 @@ export const mediaBatchAssets = (options) => (options.client ?? client).post({
10702
11221
  /**
10703
11222
  * Get job
10704
11223
  *
10705
- * Read the current batch or generation Job status and progress. For generation, inspect outputs and failures; a successful output has already landed in the library as an asset.
11224
+ * Read a generation, edit or batch Job; poll it after every generation or edit until status is terminal, every few seconds (an image takes seconds, a video a few minutes; an edit of a video took about four). status: queued is waiting (queue_reason says why, queue_position its place in line; provider_queue means the model’s supplier holds the task in its own queue, which can take hours when it is busy — the job keeps waiting for as long as the supplier keeps the task, and only past the supplier’s own task lifetime fails with detail_code UPSTREAM_WAIT_EXCEEDED, uncharged); in_progress or running is generating; completed means every output succeeded; completed_with_errors means some did; failed means none did; canceled or cancelled means it was stopped. Read the result output by output. A succeeded entry of outputs[] has asset_id and viewer_url, because the output is already a library asset: give viewer_url to the person. Its seed is present only when the model reports one (Doubao Seedance 2.x neither takes nor reports a seed); where present, send it back as seed with an adjusted prompt to vary that take. A failed entry has its reason in the failures[] entry with the same index: code is the error to branch on, for example CONTENT_REJECTED when the model's moderation refused an input or the result (a real human face in a reference is one cause; change the prompt or the reference, because retrying unchanged fails again) or GENERATION_FAILED when the model call failed (retrying may succeed); detail_code is the model's finer reason and model_request_id the model call to trace. usage is what the job has cost so far and is final at a terminal status; failed and refused outputs are not charged, so usage counts succeeded outputs only, and it is absent when nothing was charged.
10706
11225
  */
10707
11226
  export const mediaGetJob = (options) => (options.client ?? client).get({
10708
11227
  security: [{
@@ -10794,7 +11313,7 @@ export const mediaGetAssetLineage = (options) => (options.client ?? client).get(
10794
11313
  /**
10795
11314
  * Generate image
10796
11315
  *
10797
- * Generate one or more images from a text prompt and store them straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still generate. The request body is the image request itself: prompt is required, and n, size, background, output_format, output, references, seed, model, asset_folder and understanding are optional. Set output to sticker for a cut-out with a transparent background. references attach existing assets with a role — edit_target, style, structure or subject — and a model that cannot honour a role returns REFERENCE_TYPE_MISMATCH. A reference may also be an element id (a character, product, scene or brand from the materials endpoints): the service expands it into the element’s pictures and appends its description to the prompt, so the same subject stays consistent across requests. Aspect ratio is not accepted for images; name size instead. Generation is billed by the model usage it consumes, at the same prices as the model API, and the job reports the charge in usage (US dollars, six decimals, final once the job is completed or failed) and each produced asset carries its own part in provenance.cost; nothing is charged for a request refused before it starts. When the job is done, tell the person the usage amount and give them each output’s viewer_url, which opens the asset in the Console. The response is 202 with a queued Job whose type is image and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced assets from the library. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice. Example: POST /media/v1/libraries/default/images/generations with {"prompt":"A red kite above a calm sea at sunrise","n":1,"output":"sticker"}.
11316
+ * Generate images into a library from a prompt, optionally guided by existing pictures. {library_id} also accepts default, the organization’s default library. prompt is required; n (1 to 10), size, background, output_format, output, references, seed, model, asset_folder and understanding are optional. Name size, not an aspect ratio. Set output to sticker for a cut-out with a transparent background. references attach pictures of the same library with a role: subject keeps a person, product or scene consistent (several subjects put several characters in one picture), edit_target is the picture to change, style is the look to follow, structure the composition. Only a model whose modes in GET /media/v1/generation/capabilities include image takes references; any other answers INVALID_PARAMS naming the models that do, and a role a model cannot honour answers REFERENCE_TYPE_MISMATCH, both before anything is charged. A reference may be an element id (a character, product, scene or brand from the materials endpoints), which expands into its pictures and appends its description to the prompt. To draw several candidates of one key frame, send n and keep the ones you want; delete the rest. Charges are per image at the model API prices and appear in the Job’s usage; a refused or failed image costs nothing. The response is 202 with a queued Job; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} for each output’s asset and viewer_url, give viewer_url to the person and tell them usage. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice.
10798
11317
  */
10799
11318
  export const mediaGenerateImage = (options) => (options.client ?? client).post({
10800
11319
  security: [{
@@ -10812,7 +11331,7 @@ export const mediaGenerateImage = (options) => (options.client ?? client).post({
10812
11331
  /**
10813
11332
  * Generate video
10814
11333
  *
10815
- * Generate one or more videos from a text prompt and store them straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still generate. mode says what the video is anchored to: text needs only a prompt, image animates the existing image named by first_frame, and first_last interpolates between first_frame and last_frame. The frames must be image or sticker assets of the same library; a fetchable URL for each is sent to the model and recorded in the produced asset’s provenance. mode reference keeps 1 to 9 pictures named in references consistent (role subject or style; not combinable with frames; a model may take fewer); a reference may be an element id, which the service expands into the element’s pictures and description. output gif is refused with OPERATION_NOT_SUPPORTED in this release, and negative_prompt, references outside mode reference and an unknown mode are refused before anything is charged. Every output lands in the library as a video asset as soon as it is ready — there is no candidate state and nothing expires, so outputs.save is not part of this lane. Generation is billed per second by the model usage it consumes, at the same prices as the model API, and the job reports the charge in usage (US dollars, six decimals) and each produced asset carries its own part in provenance.cost; a refused request costs nothing. When the job is done, tell the person the usage amount and give them each output’s viewer_url. The response is 202 with a queued Job whose type is video and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced assets from the library. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice. Example: POST /media/v1/libraries/default/videos/generations with {"prompt":"A red kite above a calm sea at sunrise","mode":"text","n":1}.
11334
+ * Generate videos into a library: from a prompt, from frames, from reference pictures or videos, or by editing an existing video. {library_id} also accepts default, the organization’s default library. mode picks the anchor: text (prompt only); image (animates first_frame); first_last (between first_frame and last_frame); reference (1 to 9 references: pictures with role subject or style keep a person, product or look consistent, and video assets with role video give the camera and motion to follow; an element id expands into its pictures and description); edit (keeps the video named by source, at least 4 s, and changes what the prompt says, such as replacing its person with a subject picture; the output is as long as the source). Frames and references are assets of the same library; in the prompt call them @video1 and @image1, @image2… in request order. Read GET /media/v1/generation/capabilities first: a model takes only the modes it lists. To draw several takes of one shot and keep the best, send n (1 to 4); 480p is the cheapest way to compare takes. Charges are per output second at the model API prices and appear in the Job’s usage; a job with an input video is metered on input plus output seconds, so it costs more than the output length suggests (a 5 s edit of a 5 s source bills about 6 s); a refused or failed output costs nothing, and so does a request refused before the job starts. A real human face in a source or reference is refused by the model with CONTENT_REJECTED. Refused before any charge: output gif (OPERATION_NOT_SUPPORTED), negative_prompt, references outside reference and edit, and an unknown mode. The response is 202 with a queued Job; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} for each output’s asset and viewer_url, give viewer_url to the person and tell them usage. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice.
10816
11335
  */
10817
11336
  export const mediaGenerateVideo = (options) => (options.client ?? client).post({
10818
11337
  security: [{
@@ -10830,7 +11349,7 @@ export const mediaGenerateVideo = (options) => (options.client ?? client).post({
10830
11349
  /**
10831
11350
  * Edit asset
10832
11351
  *
10833
- * Edit an existing asset and store the result as a new asset. Use library_id from creation or listing and asset_id from asset creation or listing; library_id also accepts the literal default, which resolves to the organization’s default library before the credential check. The source asset is never overwritten: the new asset hangs under it in the edit chain, records it in derived_from, and reads back with assets.lineage, so earlier steps stay reachable. The body is operation plus the optional model, asset_folder, understanding and idempotency_key; operation.type selects the edit and carries that operation’s own fields. This release performs variations, inpaint, erase, replace_object, recolor and replace_background on images, remove_background on an image or a video, upscale, enhance_voice, reframe and redact through Media’s processing lane (upscale on a picture or a video; enhance_voice on a recording or a video, whose audio is used; reframe and redact on a video), and to_video, frame and resynthesize on the material each takes; every other type in the operation vocabulary is refused with OPERATION_NOT_SUPPORTED. The processing lane takes its model from the platform model catalogue, judged by the operation’s capability and overridable with operation.model, and bills per second of input; each edit is idempotent on the source, the operation and the parameters, so a second request that would make the same asset answers the asset already made instead of paying again, and an operation whose catalogue list is empty is refused with OPERATION_NOT_SUPPORTED, 尚未上架. remove_background on a video produces a portrait matte video for compositing without a green screen: output picks mask (a black-and-white matte as a small H.264 video, person white and background black: use it as a Cut track mask with channel luma under the original video to lay a lecturer over slides — the choice for compositing) or alpha (the default: the person on a transparent background as ProRes 4444, which is very large, about 870 MB per 15 seconds of 1080p, so ask for it only when a transparent file itself is the deliverable), and model picks the matting model from types.matting.models of the generation capabilities — read it first, because a request that names none takes the first available matting model and a video is refused with OPERATION_NOT_SUPPORTED, in the model field, when the platform has published none. output and model mean nothing for an image source and are refused with INVALID_PARAMS naming the field rather than ignored. inpaint takes mask, a PNG File identifier beginning with file- whose transparent area marks the region to replace, plus the prompt describing what belongs there. Aspects beyond the source asset’s material type return REFERENCE_TYPE_MISMATCH. Editing is billed by the model usage it consumes, at the same prices as the model API, and the job reports the charge in usage (US dollars, six decimals) and the new asset carries it in provenance.cost; when the job is done, tell the person the usage amount and give them the output’s viewer_url. The response is 202 with a queued Job whose type is image, whose operation is the edit applied, and whose source_asset_id is the asset edited; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until it is completed or failed, then read the produced asset. Example: POST /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/edits with {"operation":{"type":"variations","strength":"subtle"}}.
11352
+ * Change an existing asset and store the result as a new asset; the source is never overwritten. {library_id} also accepts default, the organization’s default library. The body is operation (its type selects the edit and carries that edit’s own fields) plus optional model, asset_folder, understanding and idempotency_key. Edits by material: on an image, variations (near copies of a take you like), inpaint (mask, a PNG File id beginning with file-, whose transparent area is replaced by what prompt describes), erase, replace_object, recolor, replace_background, remove_background, upscale and talking_avatar (the portrait speaks a recording of the same library); on a video, upscale, reframe, redact, trim, mute, crop, extract_audio (pulls the sound out of a video as its own audio asset), erase (removes burned-in subtitles, captions and corner watermarks, found automatically or inside the boxes given), replace_person (puts the person of an image of the same library in place of the video’s person), lip_sync (re-syncs the lips to a recording of the same library), animate_person (an image of the same library performs the video’s motion), edit_video (the video changed by a one-line instruction, optionally guided by one image of the same library) and remove_background; on a recording or a video’s audio, enhance_voice; and to_video, frame and resynthesize on the material each takes. Any other type answers OPERATION_NOT_SUPPORTED, and an edit that does not fit the source’s material answers REFERENCE_TYPE_MISMATCH. Video and audio edits take their model from the platform catalogue (override with operation.model; extract_audio takes no model, it has exactly one function); an edit whose catalogue is empty answers OPERATION_NOT_SUPPORTED, 尚未上架. remove_background on a video makes a portrait matte: output mask is a small black-and-white video to use as a Cut track mask (the choice for compositing), output alpha (the default) a transparent ProRes 4444 file of about 870 MB per 15 s of 1080p, for when the transparent file itself is the deliverable; pick model from types.matting.models of the generation capabilities. output and model on an image source answer INVALID_PARAMS. The new asset records the source in derived_from; assets.lineage reads the whole edit chain. Charges are at the model API prices (video and audio edits per second of input) and appear in the Job’s usage; repeating the same edit of the same source answers the asset already made instead of paying again. The response is 202 with a queued Job whose source_asset_id is the edited asset; poll GET /media/v1/libraries/{library_id}/jobs/{job_id}, give the output’s viewer_url to the person and tell them usage.
10834
11353
  */
10835
11354
  export const mediaEditAsset = (options) => (options.client ?? client).post({
10836
11355
  security: [{
@@ -10944,7 +11463,7 @@ export const mediaListUnderstandingsByLibrary = (options) => (options.client ??
10944
11463
  /**
10945
11464
  * List jobs
10946
11465
  *
10947
- * List batch and generation jobs in a library. Filter by status or by pipeline_run_id (the jobs one automation run started) and continue with next_cursor. Poll a generation Job until terminal; every produced output is already a library asset.
11466
+ * List the batch and generation jobs of a library, newest first, to find a job whose id you lost or to watch several takes at once. Filter by status or by pipeline_run_id (the jobs one automation run started) and continue with next_cursor. Each entry is the same Job that GET /media/v1/libraries/{library_id}/jobs/{job_id} returns, with outputs, failures and usage.
10948
11467
  */
10949
11468
  export const mediaListJobs = (options) => (options.client ?? client).get({
10950
11469
  security: [{
@@ -10958,7 +11477,7 @@ export const mediaListJobs = (options) => (options.client ?? client).get({
10958
11477
  /**
10959
11478
  * Cancel job
10960
11479
  *
10961
- * Cancel a queued or running generation job. Outputs already produced remain in the library; poll or read the returned Job to confirm its status. A video cannot be cancelled once the provider has started generating it: the call answers 409 JOB_INVALID_STATE (details VIDEO_ALREADY_RUNNING), and the task still finishes, is saved to the library and is charged.
11480
+ * Stop a generation job you no longer need, for example after the first takes of a draw show the prompt is wrong. Outputs that are queued are cancelled and never charged; outputs already produced stay in the library and stay charged. A video cannot be stopped once the provider has started generating it: the call answers 409 JOB_INVALID_STATE (details VIDEO_ALREADY_RUNNING), and that output still finishes, is saved to the library and is charged. Read the returned Job, or poll it, to see which outputs ended.
10962
11481
  */
10963
11482
  export const mediaCancelJob = (options) => (options.client ?? client).post({
10964
11483
  security: [{
@@ -11594,7 +12113,7 @@ export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).ge
11594
12113
  /**
11595
12114
  * Create sandbox (v2)
11596
12115
  *
11597
- * Create a sandbox from a template. Every sandbox declares its lifecycle at creation. On the own face (X-Praxis-Face: own-v1) send ephemeral: true for an ephemeral sandbox (never pauses, cannot be snapshotted, deleted when it ends; for jobs such as transcodes, scripts and builds) or ephemeral: false for a persistent one (pauses and resumes, snapshots, mounts volumes, kept after it stops; for long-lived computers). Leaving ephemeral out returns INVALID_PARAMS. autoPause: true, onExpire: pause, autoPauseMemory, autoResume, idleTimeout, retention and volumes belong to persistent sandboxes and need ephemeral: false. Choose persistent only for long-lived computers. On the E2B-compatible face autoPause is the declaration: true is persistent, false or absent is ephemeral and ends at its timeout. Responses carry ephemeral. When a sandbox's machine has ended (timeout, kill, retention, provider loss), reaching it returns SANDBOX_EXPIRED (410) with terminationReason in the message: its files are gone, create a new sandbox.
12116
+ * Create a sandbox from a template. Every sandbox declares its lifecycle at creation. On the own face (X-Praxis-Face: own-v1) send ephemeral: true for an ephemeral sandbox (never pauses, cannot be snapshotted, deleted when it ends; for jobs such as transcodes, scripts and builds) or ephemeral: false for a persistent one (pauses and resumes, snapshots, mounts volumes, kept after it stops; for long-lived computers). Leaving ephemeral out returns INVALID_PARAMS. autoPause: true, onExpire: pause, autoPauseMemory, autoResume, idleTimeout, retention and volumes belong to persistent sandboxes and need ephemeral: false. Choose persistent only for long-lived computers. On the E2B-compatible face autoPause is the declaration: true is persistent, false or absent is ephemeral and ends at its timeout. Responses carry ephemeral. When a sandbox's machine has ended (timeout, kill, retention, provider loss), reaching it returns SANDBOX_EXPIRED (410) with terminationReason in the message: its files are gone, create a new sandbox. To keep results, declare outputs: [{ path }] on the own face (up to eight absolute paths, a directory or a file): when the sandbox ends for any reason except provider loss or a failed start, each path is packed as .tar.gz and stored in File, and the killed event of GET /sandbox/v1/events/sandboxes/{sandboxID} lists each fileId or the reason it was not kept. Paths not declared are not kept. The E2B face refuses outputs.
11598
12117
  */
11599
12118
  export const postSandboxV1Sandboxes = (options) => (options.client ?? client).post({
11600
12119
  security: [
@@ -12690,7 +13209,7 @@ export const shareListPermissions = (options) => (options?.client ?? client).get
12690
13209
  /**
12691
13210
  * Create share
12692
13211
  *
12693
- * Make one file readable by anyone holding a link, before sending the link to a person or embedding it. Name the object as resource {type, id}, with the file id from the File API. The response is 201 and is the only time link.web_url is returned; store it, because later reads omit it and a lost address means creating another share (the old one keeps working until you delete it). The link is anonymous and read-only. A type other than file answers 400 RESOURCE_TYPE_UNSUPPORTED, and a file that is missing or outside your organization answers 404 RESOURCE_NOT_FOUND.
13212
+ * Make one object readable by anyone holding a link, before sending the link to a person or embedding it. Name the object as resource {type, id} — a file id from the File API, a canvas id, a media asset's library_id/asset_id, or an agent id (agent_...) of a service agent whose owner turned share links on. The response is 201 and is the only time link.web_url is returned; store it, because later reads omit it and a lost address means creating another share (the old one keeps working until you delete it). Opening a file or media link signs a short-lived read address; opening a canvas link shows a snapshot rendered at that moment; opening an agent link starts a Hosted conversation with that agent as the visitor, so each browser keeps its own history. The link is anonymous, and for every type so far read-only. A type that cannot be shared answers 400 RESOURCE_TYPE_UNSUPPORTED; an agent whose share links are switched off answers 400 RESOURCE_NOT_SHAREABLE and its owner turns them on in the agent's embed settings (share_links), which also requires the agent to have a short number; an object that is missing or outside your organization answers 404 RESOURCE_NOT_FOUND.
12694
13213
  */
12695
13214
  export const shareCreatePermission = (options) => (options.client ?? client).post({
12696
13215
  security: [{