{"components":{"parameters":{"IdempotencyKey":{"description":"Optional, at most 200 bytes. Scoped to the account across all its keys. Same key and normalized request returns the original task (202); different content returns 409. Use a new value for each intended generation; reuse it on uncertain network retries. Applies only to generation endpoints.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":200,"type":"string"}},"ProviderID":{"in":"path","name":"providerId","required":true,"schema":{"description":"Connection ID returned by the administrative provider list.","type":"string"}},"TaskID":{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}},"responses":{"BadRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid request or provider configuration"},"Forbidden":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Insufficient key permissions, personal account required, or cross-origin browser mutation rejected."},"NotFound":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Resource not found"},"ServiceUnavailable":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"A dependency prevented the operation"},"TooManyRequests":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Rolling request quota exceeded or local upload admission busy. Honor Retry-After in seconds.","headers":{"Retry-After":{"description":"Minimum seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"Unauthorized":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing or invalid Gateway API key"}},"schemas":{"APIKey":{"properties":{"created_at":{"format":"date-time","type":"string"},"created_by":{"description":"User who issued the key.","format":"uuid","readOnly":true,"type":"string"},"expires_at":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"last_used_at":{"description":"Approximate usage time, updated at most once per minute.","format":"date-time","type":"string"},"name":{"type":"string"},"organization_id":{"description":"Omit for a personal key. Organization keys require current membership and use shared providers.","format":"uuid","type":"string"},"prefix":{"description":"Short recognizable prefix; cannot authenticate.","type":"string"},"purpose":{"description":"Present only for explicitly account-managed Playground and Templates keys; immutable and independent of the name.","enum":["playground_templates"],"readOnly":true,"type":"string"},"resource_mode":{"description":"Personal without organization_id; shared with organization_id. The provider source must match the key ownership.","enum":["personal","shared"],"type":"string"},"revoked_at":{"description":"Present after permanent revocation.","format":"date-time","type":"string"},"scopes":{"items":{"enum":["generation","system:manage","organizations:manage","providers:manage","storage:manage","keys:manage"],"type":"string"},"type":"array"},"user_id":{"description":"Immutable key recipient; organization membership and issuer permissions are required. Defaults to the issuer.","format":"uuid","type":"string"}},"required":["id","name","prefix","scopes","created_at"],"type":"object"},"APIKeyList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/APIKey"},"type":"array"}},"required":["data"],"type":"object"},"APIKeyMonthlyUsage":{"properties":{"actual_usd":{"description":"Confirmed charges only; incomplete while unconfirmed_tasks is nonzero.","type":"number"},"api_key_id":{"format":"uuid","type":"string"},"consumed_usd":{"description":"Known generation cost before package coverage; consumes organization balance and member weekly allowance.","type":"number"},"estimated_cost_usd":{"description":"Sum of available USD cost estimates, including any usage already reported by pending tasks. Does not include tasks with unknown cost.","minimum":0,"type":"number"},"expected_usd":{"description":"Sum of immutable admission estimates.","type":"number"},"month":{"example":"2026-09","type":"string"},"package_covered_usd":{"description":"Tariff value of bill-confirmed package units; does not reduce consumption.","type":"number"},"pending_tasks":{"description":"Queued or running tasks; their final usage may not yet be known.","minimum":0,"type":"integer"},"tasks":{"minimum":0,"type":"integer"},"unconfirmed_tasks":{"minimum":0,"type":"integer"},"unknown_cost_tasks":{"description":"Finished tasks without a USD cost estimate. These are not free tasks.","minimum":0,"type":"integer"}},"required":["api_key_id","month","estimated_cost_usd","tasks","pending_tasks","unknown_cost_tasks"],"type":"object"},"AdminProvider":{"description":"Configuration belongs to the authenticated account. Secret fields are masked. Explicit connection checks can contact the provider. A non-generating authentication check does not prove model access or funded generation; inspect status_message for its scope. Cached checks can expire or reset on restart. Separate billing credentials are used to retrieve actual generation charges.","properties":{"api_type":{"description":"Adapter type shared by independent connections.","type":"string"},"archived":{"description":"Stops new work while retaining accepted tasks and history.","type":"boolean"},"base_url":{"type":"string"},"billing_access_key_hint":{"readOnly":true,"type":"string"},"billing_configured":{"type":"boolean"},"billing_help":{"type":"string"},"check_latency_ms":{"format":"int64","type":"integer"},"configured":{"type":"boolean"},"connection":{"$ref":"#/components/schemas/ProviderConnection"},"credential_hint":{"readOnly":true,"type":"string"},"credential_source":{"type":"string"},"default_timeout_seconds":{"description":"Installation default used when connection.timeout_seconds is unset.","format":"int64","type":"integer"},"description":{"type":"string"},"enabled":{"type":"boolean"},"fields":{"items":{"$ref":"#/components/schemas/ProviderField"},"type":"array"},"hints":{"additionalProperties":{"type":"string"},"description":"Masked hints only for secret fields.","type":"object"},"icon_monochrome":{"type":"boolean"},"icon_url":{"description":"Authenticated uploaded PNG logo URL.","type":"string"},"id":{"type":"string"},"last_checked_at":{"format":"date-time","type":"string"},"media_counts":{"additionalProperties":{"type":"integer"},"type":"object"},"model_count":{"type":"integer"},"models":{"items":{"$ref":"#/components/schemas/MediaModel"},"type":"array"},"music_base_url":{"type":"string"},"music_configured":{"type":"boolean"},"music_credential_hint":{"readOnly":true,"type":"string"},"name":{"type":"string"},"region":{"type":"string"},"status":{"description":"Connection result; authenticated verifies only a non-generating account query, not model entitlement, funding or generation readiness. Availability remains controlled by enabled.","type":"string"},"status_message":{"type":"string"},"supports_billing_credentials":{"description":"Whether separate billing credentials are supported.","type":"boolean"},"updated_at":{"format":"date-time","type":"string"},"values":{"additionalProperties":{"type":"string"},"description":"Non-secret saved settings.","type":"object"},"version":{"description":"Current version required when changing connection configuration, name or archive state.","format":"int64","type":"integer"}},"required":["id","name","description","enabled","configured","credential_source","billing_configured","status","status_message","model_count","media_counts","updated_at"],"type":"object"},"AuditEvent":{"properties":{"action":{"type":"string"},"actor_email":{"type":"string"},"actor_id":{"type":"string"},"actor_name":{"type":"string"},"actor_picture":{"format":"uri","type":"string"},"actor_type":{"enum":["user","service"],"type":"string"},"calling_key_id":{"type":"string"},"correlation_id":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"details":{"additionalProperties":true,"description":"Safe change details. Organization managers receive restricted=true for Administrator-only changes; mixed changes omit internal fields.","type":"object"},"id":{"minimum":1,"type":"integer"},"legacy_id":{"type":"integer"},"legacy_source":{"type":"string"},"object_id":{"type":"string"},"object_name":{"type":"string"},"object_picture":{"description":"Current profile image when the audited object is a user.","format":"uri","type":"string"},"object_type":{"type":"string"},"organization_id":{"type":"string"},"organization_name":{"type":"string"},"outcome":{"enum":["success","denied","failed"],"type":"string"},"schema_version":{"type":"integer"},"scope":{"enum":["system","organization","personal"],"type":"string"}},"required":["id","created_at","schema_version","scope","action","object_type","object_id","outcome","details"],"type":"object"},"AuditEventPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AuditEvent"},"type":"array"},"has_more":{"type":"boolean"},"next_before_id":{"type":"integer"}},"type":"object"},"BalanceEntry":{"additionalProperties":false,"properties":{"amount_usd":{"description":"Signed balance change for this entry; zero for attempts without a credit","type":"number"},"created_at":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"kind":{"enum":["payment","promo","adjustment","attempt"],"type":"string"},"payment":{"$ref":"#/components/schemas/Payment"},"provider":{"type":"string"},"reason":{"type":"string"}},"required":["id","created_at","amount_usd","kind","reason","provider"],"type":"object"},"BonusEntry":{"properties":{"actor_id":{"type":"string"},"actor_name":{"type":"string"},"actor_picture":{"format":"uri","type":"string"},"amount_usd":{"description":"Signed ledger amount; payouts are negative.","type":"number"},"beneficiary":{"enum":["manager","supervisor"],"type":"string"},"created_at":{"format":"date-time","type":"string"},"employee_id":{"format":"uuid","type":"string"},"id":{"format":"int64","type":"integer"},"kind":{"enum":["accrual","correction","payout"],"type":"string"},"method":{"type":"string"},"paid_at":{"format":"date","type":"string"},"reason":{"type":"string"},"task_id":{"format":"uuid","type":"string"}},"type":"object"},"BonusSettings":{"additionalProperties":false,"properties":{"manager_percent":{"default":5,"maximum":100,"minimum":0,"multipleOf":0.01,"type":"number"},"starts_at":{"description":"Only requests accepted after activation participate.","format":"date-time","readOnly":true,"type":"string"},"supervisor_percent":{"default":1,"maximum":100,"minimum":0,"multipleOf":0.01,"type":"number"},"version":{"minimum":1,"type":"integer"}},"required":["manager_percent","supervisor_percent","version"],"type":"object"},"BrandAsset":{"additionalProperties":false,"properties":{"data":{"description":"Base64-encoded image bytes up to 512 KiB decoded","format":"byte","type":"string"},"mime":{"enum":["image/png","image/jpeg","image/svg+xml"],"type":"string"}},"required":["mime","data"],"type":"object"},"BrandPalette":{"additionalProperties":false,"properties":{"accent":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"accent-dark":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"accent-text":{"description":"Accent foreground text and selection/focus edges; inherits accent in legacy palettes.","pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"bg":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"blue":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"chart-1":{"description":"Primary chart series; inherits accent in legacy palettes.","pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"chart-2":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"chart-3":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"chart-4":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"chart-5":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"chart-6":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"field":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"highlight":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"line":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"muted":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"on-accent":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"on-highlight":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"on-warning":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"panel":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"panel-2":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"popup":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"red":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"success":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"switch-off":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"switch-on-border":{"description":"On switch edge; inherits accent in legacy palettes.","pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"switch-thumb":{"description":"Off switch thumb; inherits on-accent in legacy palettes.","pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"switch-thumb-on":{"description":"On switch thumb; inherits on-accent in legacy palettes.","pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"text":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"yellow":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"}},"required":["accent","accent-dark","highlight","on-accent","on-highlight","bg","panel","panel-2","field","popup","line","switch-off","text","muted","blue","red","success","yellow","on-warning","chart-2","chart-3","chart-4","chart-5","chart-6"],"type":"object"},"CatalogChange":{"properties":{"after":{},"before":{},"field":{"readOnly":true,"type":"string"},"model":{"readOnly":true,"type":"string"},"source":{"readOnly":true,"type":"string"}},"required":["model","field","source"],"type":"object"},"CatalogCompleteness":{"additionalProperties":false,"description":"Operational-v1 coverage of this connection's supported active models. Independent of publication changes. Missing on historical runs means not assessed, never complete. Prose, document acknowledgments and unchanged hashes do not verify executable fields.","properties":{"models":{"items":{"additionalProperties":false,"properties":{"contract":{"additionalProperties":true,"description":"Current adapter protocol fields. Tariffs and display metadata are omitted rather than represented as zero prices.","type":"object"},"declared_sources":{"description":"Adapter source references only; these do not establish field verification.","items":{"properties":{"title":{"type":"string"},"url":{"type":"string"}},"type":"object"},"type":"array"},"fields":{"items":{"additionalProperties":false,"properties":{"field":{"type":"string"},"reason":{"type":"string"},"required":{"description":"Whether missing verification prevents required native-contract coverage. Optional provider details do not imply unsupported capabilities.","type":"boolean"},"sources":{"items":{"$ref":"#/components/schemas/CatalogCoverageSource"},"type":"array"},"status":{"enum":["verified","unknown","not_applicable","unsupported","stale","preserved"],"type":"string"},"value":{}},"required":["field","required","status","reason"],"type":"object"},"type":"array"},"model":{"type":"string"},"status":{"enum":["complete","partial","incomplete"],"type":"string"}},"required":["model","status","contract","fields"],"type":"object"},"type":"array"},"reasons":{"items":{"type":"string"},"type":"array"},"requirements":{"enum":["operational-v1"],"type":"string"},"sources":{"items":{"$ref":"#/components/schemas/CatalogCoverageSource"},"type":"array"},"status":{"enum":["complete","partial","incomplete"],"type":"string"}},"required":["requirements","status","models","sources","reasons"],"type":"object"},"CatalogCoverageSource":{"additionalProperties":false,"properties":{"hash":{"description":"Current normalized snapshot, or failed fetched snapshot when available.","type":"string"},"previous_hash":{"description":"Last confirmed normalized snapshot retained for comparison and restoration of evidence.","type":"string"},"source":{"additionalProperties":false,"description":"Scheduled public document source or reserved internal API discovery source.","properties":{"id":{"type":"string"},"parser":{"type":"string"},"url":{"type":"string"}},"required":["id","url","parser"],"type":"object"},"status":{"description":"interpretation_failed means the fetched document was rejected by parsing or adapter interpretation; retrieval_failed means fetching failed or the legacy failure stage is unknown.","enum":["retrieved","retrieval_failed","interpretation_failed","stale","preserved","not_checked"],"type":"string"},"value":{}},"required":["source","status"],"type":"object"},"CatalogEntry":{"properties":{"contract":{"$ref":"#/components/schemas/MediaModel"},"id":{"readOnly":true,"type":"string"},"inactive":{"description":"Reviewed deactivated model retained for history, without an executable contract.","type":"boolean"},"metadata":{"$ref":"#/components/schemas/ModelMetadata"},"operational_fields":{"additionalProperties":{},"description":"Typed public operational evidence from a provider-owned interpreter. Informational evidence cannot activate models or change native admission.","type":"object"},"rates":{"items":{"$ref":"#/components/schemas/CatalogRate"},"type":"array"}},"required":["id"],"type":"object"},"CatalogModelReviewEvidence":{"additionalProperties":false,"description":"Bounded public model-column evidence from a rejected document. This label is not a runtime model ID and establishes neither adapter support nor account entitlement. Adapter review/integration is required for the published model or condition.","properties":{"line":{"description":"One-based line in that normalized document.","maximum":100000,"minimum":1,"type":"integer"},"model_label":{"maxLength":80,"pattern":"^[A-Za-z][A-Za-z0-9 .+()_-]{0,79}$","type":"string"},"snapshot":{"description":"SHA-256 of the rejected normalized document.","pattern":"^[0-9a-fA-F]{64}$","type":"string"},"source_id":{"maxLength":100,"type":"string"},"url":{"format":"uri","maxLength":2048,"type":"string"}},"readOnly":true,"required":["source_id","url","snapshot","model_label","line"],"type":"object"},"CatalogObservation":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/CatalogEntry"},"type":"array"},"error":{"readOnly":true,"type":"string"},"failure_stage":{"description":"Read-only stage of a failed source check. Absent from historical records; only the exact known historical interpretation error can identify their stage safely.","enum":["retrieval","interpretation"],"readOnly":true,"type":"string"},"fetched_hash":{"description":"Snapshot of a fetched page that failed structured parsing; confirmed hash/candidates remain unchanged.","type":"string"},"hash":{"description":"Content-addressed source snapshot hash; synthetic _api uses parser api.","type":"string"},"model_review":{"$ref":"#/components/schemas/CatalogModelReviewEvidence"},"operational_history":{"additionalProperties":{"additionalProperties":{"$ref":"#/components/schemas/CatalogCoverageSource"},"type":"object"},"description":"Read-only last-confirmed typed facts by exact model and field, retaining each source snapshot when a later observation omits that field. Historical values never establish current verification.","readOnly":true,"type":"object"},"review":{"description":"Code-reviewed acknowledgement of this exact successful document snapshot; later hashes require a new review.","properties":{"date":{"format":"date","type":"string"},"hash":{"type":"string"},"reason":{"type":"string"}},"readOnly":true,"required":["hash","date","reason"],"type":"object"},"source":{"oneOf":[{"$ref":"#/components/schemas/CatalogSource"},{"properties":{"id":{"const":"_api"},"parser":{"const":"api"},"url":{"type":"string"}},"required":["id","parser"],"type":"object"}]},"text":{"description":"Fetch-time only; omitted from state/run responses. Retrieve documents/{hash}.","type":"string"}},"required":["source","hash","entries"],"type":"object"},"CatalogRate":{"properties":{"audio":{"description":"Selects generated video audio; omitted means independent of audio.","type":"boolean"},"components":{"items":{"properties":{"estimated_units":{"type":"number"},"metric":{"readOnly":true,"type":"string"},"per":{"format":"int64","type":"integer"},"price":{"type":"number"}},"type":"object"},"type":"array"},"input_images":{"description":"Reviewed charge for reference images beyond the free allowance; frozen per task.","properties":{"free":{"minimum":0,"type":"integer"},"price":{"minimum":0,"type":"number"}},"required":["free","price"],"type":"object"},"per":{"format":"int64","type":"integer"},"price":{"description":"USD unit price, preserved to six decimal places.","type":"number"},"quality":{"readOnly":true,"type":"string"},"region":{"readOnly":true,"type":"string"},"resolution":{"readOnly":true,"type":"string"},"source":{"readOnly":true,"type":"string"},"unit":{"readOnly":true,"type":"string"},"video_input":{"description":"Selects reference-video tariffs; omitted or false means no video input.","type":"boolean"}},"type":"object"},"CatalogRun":{"properties":{"changes":{"items":{"$ref":"#/components/schemas/CatalogChange"},"type":"array"},"completed_at":{"format":"date-time","readOnly":true,"type":"string"},"completeness":{"$ref":"#/components/schemas/CatalogCompleteness"},"email_status":{"enum":["not_needed","disabled","pending","retry","sent","failed"],"type":"string"},"id":{"format":"uuid","type":"string"},"new_warnings":{"items":{"$ref":"#/components/schemas/CatalogWarning"},"type":"array"},"open_warnings":{"items":{"$ref":"#/components/schemas/CatalogWarning"},"type":"array"},"provider":{"readOnly":true,"type":"string"},"resolved_warnings":{"items":{"$ref":"#/components/schemas/CatalogWarning"},"type":"array"},"sources":{"items":{"$ref":"#/components/schemas/CatalogObservation"},"type":"array"},"started_at":{"format":"date-time","readOnly":true,"type":"string"},"status":{"enum":["partial","incomplete","unchanged","applied","warning","error"],"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["id","provider","started_at","completed_at","status","version","changes","new_warnings","open_warnings","resolved_warnings","sources","email_status"],"type":"object"},"CatalogSchedule":{"additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"last_check":{"format":"date-time","readOnly":true,"type":"string"},"next_check":{"format":"date-time","readOnly":true,"type":"string"},"provider":{"readOnly":true,"type":"string"},"requested":{"description":"Read-only queued manual check indicator.","readOnly":true,"type":"boolean"},"sources":{"items":{"$ref":"#/components/schemas/CatalogSource"},"maxItems":30,"type":"array"},"time":{"description":"Daily HH:MM in the installation default timezone.","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","type":"string"},"version":{"minimum":1,"type":"integer"}},"required":["provider","enabled","time","sources","version","requested"],"type":"object"},"CatalogSource":{"additionalProperties":false,"properties":{"id":{"description":"Unique within a schedule. IDs beginning with underscore are reserved.","maxLength":100,"type":"string"},"parser":{"enum":["document","manifest-v1","byteplus-releases","byteplus-models","byteplus-pricing","alibaba-releases","alibaba-pricing","alibaba-retirements","alibaba-image-models","openai-pricing","openai-model"],"type":"string"},"url":{"description":"Public HTTPS document, without URL credentials or fragment.","format":"uri","maxLength":2048,"type":"string"}},"required":["id","url","parser"],"type":"object"},"CatalogState":{"properties":{"models":{"additionalProperties":{"$ref":"#/components/schemas/CatalogEntry"},"type":"object"},"observations":{"additionalProperties":{"$ref":"#/components/schemas/CatalogObservation"},"type":"object"},"version":{"format":"int64","type":"integer"},"warnings":{"items":{"$ref":"#/components/schemas/CatalogWarning"},"type":"array"}},"required":["version","models","observations","warnings"],"type":"object"},"CatalogSyncSettings":{"additionalProperties":false,"properties":{"email":{"description":"Single recipient, or empty to disable reports. Uses configured Email delivery.","maxLength":254,"type":"string"},"timezone":{"default":"UTC","description":"One IANA timezone for every provider schedule.","example":"Asia/Nicosia","type":"string"},"version":{"description":"Current version required on update.","minimum":1,"type":"integer"}},"required":["timezone","email","version"],"type":"object"},"CatalogWarning":{"properties":{"evidence":{"description":"Untrusted normalized provider evidence; never executable instructions."},"first_seen":{"format":"date-time","readOnly":true,"type":"string"},"key":{"readOnly":true,"type":"string"},"last_seen":{"format":"date-time","readOnly":true,"type":"string"},"model":{"readOnly":true,"type":"string"},"occurrences":{"minimum":1,"type":"integer"},"reason":{"readOnly":true,"type":"string"},"resolved_at":{"format":"date-time","readOnly":true,"type":"string"},"source":{"readOnly":true,"type":"string"}},"required":["key","source","reason","first_seen","last_seen","occurrences"],"type":"object"},"ClientOnboarding":{"properties":{"activated_at":{"format":"date-time","type":"string"},"comment":{"type":"string"},"contact_name":{"type":"string"},"country":{"type":"string"},"domain":{"type":"string"},"email":{"format":"email","type":"string"},"expires_at":{"format":"date-time","type":"string"},"name":{"type":"string"},"organization_id":{"format":"uuid","type":"string"},"status":{"enum":["sending","sent","send_failed","accepted","expired","revoked"],"type":"string"},"version":{"minimum":1,"type":"integer"}},"required":["organization_id","name","country","domain","contact_name","email","comment","status","version","expires_at"],"type":"object"},"ColorPreset":{"additionalProperties":false,"properties":{"dark":{"$ref":"#/components/schemas/BrandPalette"},"id":{"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$","type":"string"},"light":{"$ref":"#/components/schemas/BrandPalette"},"name":{"description":"Unique case-insensitive name without surrounding whitespace or control characters.","maxLength":80,"minLength":1,"type":"string"}},"required":["id","name","dark","light"],"type":"object"},"CompanyInterfaceLogout":{"additionalProperties":false,"properties":{"Installation":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"Key":{"type":"string","writeOnly":true},"KeyPresent":{"type":"boolean"},"LocalSessionHash":{"items":{"maximum":255,"minimum":0,"type":"integer"},"maxItems":32,"minItems":32,"type":"array"},"Session":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true}},"required":["Installation","Session","LocalSessionHash"],"type":"object"},"CompanyInterfaceRedemption":{"additionalProperties":false,"properties":{"AttemptID":{"format":"uuid","type":"string"},"ConnectionRevision":{"minimum":0,"type":"integer"},"InstallationProof":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"LocalOrigin":{"format":"uri","type":"string"},"LocalSession":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"OperationID":{"format":"uuid","type":"string"},"Proof":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true}},"required":["AttemptID","OperationID","InstallationProof","Proof","LocalSession","LocalOrigin","ConnectionRevision"],"type":"object"},"CompanyInterfaceRefresh":{"additionalProperties":false,"properties":{"GrantCredential":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"LocalOrigin":{"format":"uri","type":"string"},"LocalSession":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"OperationID":{"format":"uuid","type":"string"},"RefreshToken":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"SessionID":{"format":"uuid","type":"string"},"Version":{"minimum":1,"type":"integer"}},"type":"object"},"CompanyInterfaceStart":{"additionalProperties":false,"properties":{"AttemptID":{"format":"uuid","type":"string"},"ConnectionRevision":{"minimum":0,"type":"integer"},"GrantCredential":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"InstallationProof":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"Label":{"maxLength":120,"type":"string"},"LocalOrigin":{"format":"uri","type":"string"},"LocalSession":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"Mode":{"enum":["connect","login","legacy-upgrade","rebind"],"type":"string"},"PreviousGrantID":{"type":"string"},"Proof":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"Protocol":{"additionalProperties":false,"properties":{"capabilities":{"items":{"type":"string"},"type":"array"},"purpose":{"type":"string"},"version":{"type":"integer"}},"required":["purpose","version","capabilities"],"type":"object"}},"required":["AttemptID","InstallationProof","Proof","LocalSession","LocalOrigin","Mode","ConnectionRevision","Protocol"],"type":"object"},"ContactLinks":{"description":"Opt-in shared contact links. Only http, https, mailto and tel schemes are allowed; credentials, whitespace and control characters in links are rejected.","items":{"additionalProperties":false,"properties":{"label":{"maxLength":80,"minLength":1,"type":"string"},"url":{"description":"Absolute HTTP(S)","limited to 2048 UTF-8 bytes.":null,"mailto or tel link":null,"maxLength":2048,"type":"string"}},"required":["label","url"],"type":"object"},"maxItems":20,"type":"array"},"CreateAPIKeyRequest":{"additionalProperties":false,"properties":{"created_by":{"description":"User who issued the key.","format":"uuid","readOnly":true,"type":"string"},"expires_at":{"description":"Optional future timestamp. Omit for no expiration; revoked keys always stop authenticating.","format":"date-time","type":"string"},"name":{"description":"A recognizable name, e.g. Production bot.","maxLength":80,"minLength":1,"type":"string"},"organization_id":{"description":"Omit for a personal key. Organization keys require current membership and use shared providers.","format":"uuid","type":"string"},"purpose":{"description":"Present only for explicitly account-managed Playground and Templates keys; immutable and independent of the name.","enum":["playground_templates"],"readOnly":true,"type":"string"},"resource_mode":{"description":"Personal without organization_id; shared with organization_id. The provider source must match the key ownership.","enum":["personal","shared"],"type":"string"},"scopes":{"default":["generation"],"description":"generation is required. Only a current administrator may request system:manage. Add providers:manage, storage:manage and/or keys:manage explicitly. A calling key cannot grant permissions it does not have.","items":{"enum":["generation","system:manage","organizations:manage","providers:manage","storage:manage","keys:manage"],"type":"string"},"type":"array"},"user_id":{"description":"Immutable key recipient; organization membership and issuer permissions are required. Defaults to the issuer.","format":"uuid","type":"string"}},"required":["name"],"type":"object"},"CreatedAPIKey":{"properties":{"created_at":{"format":"date-time","type":"string"},"created_by":{"description":"User who issued the key.","format":"uuid","readOnly":true,"type":"string"},"expires_at":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"last_used_at":{"description":"Approximate usage time, updated at most once per minute.","format":"date-time","type":"string"},"name":{"type":"string"},"organization_id":{"description":"Omit for a personal key. Organization keys require current membership and use shared providers.","format":"uuid","type":"string"},"prefix":{"description":"Short recognizable prefix; cannot authenticate.","type":"string"},"purpose":{"description":"Present only for explicitly account-managed Playground and Templates keys; immutable and independent of the name.","enum":["playground_templates"],"readOnly":true,"type":"string"},"resource_mode":{"description":"Personal without organization_id; shared with organization_id. The provider source must match the key ownership.","enum":["personal","shared"],"type":"string"},"revoked_at":{"description":"Present after permanent revocation.","format":"date-time","type":"string"},"scopes":{"items":{"enum":["generation","system:manage","organizations:manage","providers:manage","storage:manage","keys:manage"],"type":"string"},"type":"array"},"secret":{"description":"Full bearer secret, returned only in this creation response. Save it now; it cannot be retrieved later.","type":"string"},"user_id":{"description":"Immutable key recipient; organization membership and issuer permissions are required. Defaults to the issuer.","format":"uuid","type":"string"}},"required":["id","name","prefix","scopes","created_at","secret"],"type":"object"},"EmailDeliverySettings":{"properties":{"available_providers":{"items":{"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"type":"object"},"type":"array"},"enabled":{"description":"A provider","sender and key are saved; not a guarantee of successful delivery.":null,"type":"boolean"},"from":{"type":"string"},"key_configured":{"type":"boolean"},"provider":{"enum":["","resend"],"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["provider","from","key_configured","enabled","version","available_providers"],"type":"object"},"ErrorResponse":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"description":"Invalid field when known.","type":["string","null"]},"type":{"description":"OpenAI-style error category.","type":"string"}},"required":["code","message","type","param"],"type":"object"}},"required":["error"],"type":"object"},"ExternalPaymentSettlement":{"additionalProperties":false,"properties":{"amount_cents":{"maximum":1000000,"minimum":100,"type":"integer"},"currency":{"enum":["usd"],"type":"string"},"external_id":{"maxLength":128,"minLength":1,"type":"string"},"fee_cents":{"minimum":0,"type":"integer"},"held_cents":{"minimum":0,"type":"integer"},"organization_id":{"format":"uuid","type":"string"},"refunded_cents":{"minimum":0,"type":"integer"},"revision":{"minimum":1,"type":"integer"}},"required":["organization_id","external_id","amount_cents","currency","revision"],"type":"object"},"FrameSelection":{"additionalProperties":false,"properties":{"frame_index":{"description":"Zero-based frame index","minimum":0,"strictly less than the current session frame_count.":null,"type":"integer"},"points":{"items":{"additionalProperties":false,"properties":{"x":{"maximum":1,"minimum":0,"type":"number"},"y":{"maximum":1,"minimum":0,"type":"number"}},"required":["x","y"],"type":"object"},"maxItems":10,"minItems":1,"type":"array","uniqueItems":true}},"required":["frame_index","points"],"type":"object"},"Generation":{"description":"Always asynchronous. Keeps task extensions (options, cost, usage, storage and webhook metadata). Statuses and Unix timestamps match the OpenAI video vocabulary. Costs pass through the same customer/admin financial projection. content_url requires the same Gateway API key. No progress percentage is invented. Managers receive operational metadata only, with content_access false and without prompt, input, output links or provider errors.","properties":{"artifacts":{"description":"Present only after every result has been archived; omitted for deleted results. IDs are local, opaque selectors. Upstream IDs, source URLs, authenticated source handles and storage keys are private.","items":{"$ref":"#/components/schemas/GenerationArtifact"},"maxItems":64,"type":"array"},"background":{"type":"string"},"can_change_project":{"description":"Whether the current role/workspace allows changing this generation's project","independently of company generation authorship.":null,"type":"boolean"},"can_delete":{"description":"Whether this viewer may delete stored result files.","type":"boolean"},"completed_at":{"description":"Result archival time if recorded; null until known.","type":["integer","null"]},"content_access":{"description":"Whether this viewer can inspect retained content.","type":"boolean"},"content_url":{"type":"string"},"cost":{"$ref":"#/components/schemas/TaskCost"},"created_at":{"format":"int64","type":"integer"},"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":["object","null"]},"has_stored_result":{"type":"boolean"},"id":{"type":"string"},"image":{"items":{"type":"string"},"type":"array"},"input":{"type":"string"},"input_reference":{"items":{"type":"string"},"type":"array"},"instructions":{"type":"string"},"journal_revision":{"description":"Opaque synchronization revision included only in cursor list responses. Compare it as a string; it is not an authorization token or a creation-order cursor.","type":"string"},"media_type":{"$ref":"#/components/schemas/MediaType"},"model":{"type":"string"},"object":{"enum":["video","generation"],"type":"string"},"options":{"$ref":"#/components/schemas/MediaOptions"},"output_format":{"type":"string"},"project_id":{"description":"Optional company-shared project metadata. Profile metadata remains private; omitted for ungrouped or content-restricted generations.","format":"uuid","type":"string"},"project_version":{"default":0,"description":"Optimistic version for changing the workspace project assignment.","format":"int64","minimum":0,"type":"integer"},"prompt":{"type":"string"},"provider":{"type":"string"},"provider_model":{"description":"Native provider model ID for provenance","type":"string"},"quality":{"type":"string"},"resources":{"description":"Owner-bound local resource bindings returned only after successful terminal capture.","items":{"properties":{"binding_id":{"format":"uuid","type":"string"},"reference_id":{"type":"string"}},"required":["binding_id","reference_id"],"type":"object"},"type":"array"},"response_format":{"type":"string"},"result_deleted_at":{"format":"date-time","type":"string"},"seconds":{"type":"string"},"size":{"type":"string"},"status":{"enum":["queued","in_progress","completed","failed"],"type":"string"},"status_url":{"type":"string"},"template_snapshot":{"description":"Server-resolved template ID/revision and immutable prompt/reference/model/options snapshot. Subject to existing content permissions and logging minimization.","type":"object"},"timeout_seconds":{"description":"Explicit generation HTTP timeout override, when supplied.","format":"int64","type":"integer"},"updated_at":{"format":"int64","type":"integer"},"usage":{"$ref":"#/components/schemas/ProviderUsage"},"user_id":{"description":"Request recipient account, including in redacted metadata.","type":"string"},"voice":{"type":"string"}},"required":["id","object","status","created_at","updated_at","status_url"],"type":"object"},"GenerationArtifact":{"additionalProperties":false,"properties":{"content_type":{"type":"string"},"content_url":{"description":"Owner-authorized Gateway archive route.","type":"string"},"duration":{"exclusiveMinimum":0,"type":"number"},"format":{"type":"string"},"group_id":{"description":"Opaque output grouping; never used as a path.","type":"string"},"id":{"description":"Local artifact selector; never a provider ID or storage key.","type":"string"},"media_type":{"enum":["image","video","audio","speech","music","text","json","binary"],"type":"string"},"sha256":{"type":"string"},"size_bytes":{"minimum":0,"type":"integer"}},"required":["id","media_type","content_url","content_type","size_bytes","sha256"],"type":"object"},"GenerationImageInput":{"description":"Image URL, an object containing exactly image_url or file_id (from /v1/references), or a nonempty array. File IDs are checked against the authenticated owner. Models advertising supports_asset_references also accept asset://ID strings (or image_url values) for registered provider assets, mixed with URLs in the same ordered array. These IDs are not Gateway file_id values. Multipart file uploads are also supported for edits/videos.","oneOf":[{"type":"string"},{"additionalProperties":false,"properties":{"image_url":{"type":"string"}},"required":["image_url"],"type":"object"},{"additionalProperties":false,"properties":{"file_id":{"type":"string"}},"required":["file_id"],"type":"object"},{"items":{"oneOf":[{"type":"string"},{"additionalProperties":false,"properties":{"file_id":{"type":"string"}},"required":["file_id"],"type":"object"},{"additionalProperties":false,"properties":{"image_url":{"type":"string"}},"required":["image_url"],"type":"object"}]},"minItems":1,"type":"array"}]},"GenerationProject":{"properties":{"created_at":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"name":{"maxLength":80,"minLength":1,"type":"string"},"version":{"format":"int64","minimum":1,"type":"integer"}},"required":["id","name","created_at","version"],"type":"object"},"GenerationRequest":{"additionalProperties":false,"description":"OpenAI-style naming with Gateway extensions. Use only fields appropriate for the media type. Standard fields are accepted only at the top level; only advertised options.parameters keys are accepted. JSON limit 64 KiB. Null prompt, webhook_url and max_expected_cost_usd behave as omission; model-specific prompt requirements still apply.","properties":{"background":{"type":"string"},"image":{"$ref":"#/components/schemas/GenerationImageInput"},"input":{"description":"Text to synthesize.","maxLength":10000,"type":"string"},"input_reference":{"$ref":"#/components/schemas/GenerationImageInput"},"instructions":{"type":"string"},"max_expected_cost_usd":{"description":"Gateway customer-price ceiling, including markup. Admission rejects a higher quote. Negative values return HTTP 400 with error.param set to max_expected_cost_usd.","minimum":0,"type":["number","null"]},"model":{"description":"Exact public ID from GET /v1/models. Defaults to provider/model and can be renamed by the administrator. Separate provider and media_type request fields are not accepted.","type":"string"},"n":{"description":"One image per asynchronous job.","enum":[1],"type":"integer"},"options":{"$ref":"#/components/schemas/MediaOptions"},"output_format":{"description":"Image output encoding supported by the model, e.g. png/jpeg/webp.","type":"string"},"project_id":{"description":"Optional project shared within the current company","format":"uuid","or owned by the authenticated actor in Profile. Omit to leave a generation ungrouped. Part of idempotency matching; does not affect prompt or result retention.":null,"type":"string"},"prompt":{"description":"Text direction, subject to the model's limits. May be omitted or empty when prompt_optional or no_prompt is advertised; no_prompt rejects nonempty text.","maxLength":10000,"type":["string","null"]},"quality":{"type":"string"},"response_format":{"description":"Speech audio encoding supported by the model; for images only url is supported. All endpoints return an asynchronous job, never immediate bytes/base64.","type":"string"},"seconds":{"description":"Video duration. A positive integer string; an optional leading plus sign and leading zeroes are accepted and normalized (\"+05\" becomes \"5\"). Model-specific limits apply; no restriction to OpenAI durations.","pattern":"^[+]?[0]*[1-9][0-9]*$","type":"string"},"size":{"description":"Image WIDTHxHEIGHT (mapped to the provider catalog), or video WIDTHxHEIGHT mapped exactly to supported resolution and ratio. Catalog resolution strings are also accepted.","type":"string"},"stream":{"description":"All generations are asynchronous. Streaming is not supported.","enum":[false],"type":"boolean"},"timeout_seconds":{"description":"Gateway HTTP response deadline for generation submission, including body reading. Overrides connection.timeout_seconds; otherwise inherits the provider default (30 seconds). Does not change the asynchronous rendering lifetime. Persisted across worker restarts and part of idempotency matching. No automatic submission retries.","format":"int64","maximum":9223372036,"minimum":1,"type":"integer"},"voice":{"description":"Speech voice ID supported by the model.","type":"string"},"webhook_url":{"format":"uri","type":["string","null"]}},"required":["model"],"type":"object"},"Health":{"properties":{"status":{"enum":["ok","unhealthy"],"type":"string"}},"required":["status"],"type":"object"},"LegalDocument":{"additionalProperties":false,"properties":{"text":{"description":"Plain UTF-8 text, at most 64 KiB in bytes. Empty text restores the bundled template. HTML is displayed literally.","maxLength":65536,"type":"string"},"version":{"description":"Optimistic concurrency token; not a legal agreement version or acceptance record.","minimum":1,"type":"integer"}},"required":["text","version"],"type":"object"},"LoginProvider":{"properties":{"client_id":{"type":"string"},"configured":{"type":"boolean"},"connected":{"type":"boolean"},"enabled":{"type":"boolean"},"name":{"type":"string"},"provider":{"enum":["google","email"],"type":"string"},"redirect_url":{"description":"Read-only callback derived from the trusted public origin","format":"uri","type":"string"},"secret_configured":{"type":"boolean"},"version":{"minimum":1,"type":"integer"}},"required":["provider","name","enabled","connected","configured","secret_configured","version"],"type":"object"},"MarkupConfig":{"additionalProperties":false,"properties":{"default_percent":{"description":"Null inherits system rules for a company. System default is required.","maximum":1000,"minimum":0,"multipleOf":0.01,"type":["number","null"]},"exceptions":{"items":{"$ref":"#/components/schemas/MarkupRule"},"maxItems":500,"type":"array"},"version":{"format":"int64","minimum":1,"type":"integer"}},"required":["default_percent","exceptions","version"],"type":"object"},"MarkupPercent":{"description":"Percentage added to shared-provider cost. 25 means a 25% markup.","maximum":1000,"minimum":0,"multipleOf":0.01,"type":"number"},"MarkupPolicy":{"properties":{"company":{"description":"Organization configuration; version is zero when no organization is selected.","properties":{"default_percent":{"type":["number","null"]},"exceptions":{"items":{"$ref":"#/components/schemas/MarkupRule"},"type":"array"},"version":{"format":"int64","minimum":0,"type":"integer"}},"type":"object"},"system":{"$ref":"#/components/schemas/MarkupConfig"}},"type":"object"},"MarkupRule":{"additionalProperties":false,"properties":{"markup_percent":{"$ref":"#/components/schemas/MarkupPercent"},"model":{"description":"Omit or use an empty string for all models of the provider.","maxLength":256,"type":"string"},"provider":{"maxLength":100,"minLength":1,"type":"string"}},"required":["provider","markup_percent"],"type":"object"},"MediaAccess":{"properties":{"artifacts":{"items":{"properties":{"download_url":{"type":"string"},"format":{"type":"string"},"id":{"type":"string"},"media_type":{"type":"string"},"preview_url":{"type":"string"}},"required":["id","media_type","format","preview_url","download_url"],"type":"object"},"maxItems":64,"type":"array"},"download_url":{"type":"string"},"expires_at":{"format":"date-time","type":"string"},"last_frame_url":{"description":"Signed browser URL for an archived video last frame, when available.","type":"string"},"preview_url":{"type":"string"}},"required":["preview_url","download_url","expires_at"],"type":"object"},"MediaFacePreparation":{"additionalProperties":false,"properties":{"max_expected_usd":{"minimum":0,"type":"number"},"provider":{"type":"string"},"reference_id":{"description":"Owned local video reference; server inspection is mandatory.","format":"uuid","type":"string"},"workflow_model":{"description":"Authorized media consumer requiring a face_session input.","type":"string"}},"required":["provider","workflow_model","reference_id"],"type":"object"},"MediaFileLimits":{"properties":{"allowed_audio_codecs":{"description":"Optional canonical embedded-audio codec allowlist. Every declared audio stream needs inspected codec proof; unknown count or codec fails only when this constraint is declared. A proven zero audio-stream count passes. AAC/MP3 proof is distinct from an mp4a container tag.","items":{"type":"string"},"type":"array"},"codecs":{"items":{"type":"string"},"type":"array"},"content_types":{"items":{"type":"string"},"type":"array"},"max_bytes":{"description":"Upper file size bound; exclusive unless max_bytes_inclusive is true","type":"integer"},"max_bytes_inclusive":{"description":"True only for a reviewed model-specific inclusive byte boundary.","type":"boolean"},"max_dimension":{"type":"integer"},"max_duration":{"type":"number"},"max_fps":{"type":"number"},"max_pixels":{"type":"integer"},"max_ratio":{"type":"number"},"max_total_bytes":{"description":"Exclusive combined size bound for this media type","type":"integer"},"max_total_duration":{"type":"number"},"min_dimension":{"type":"integer"},"min_duration":{"type":"number"},"min_fps":{"type":"number"},"min_pixels":{"type":"integer"},"min_ratio":{"type":"number"},"min_total_duration":{"type":"number"},"no_alpha":{"description":"Reject an image carrying an alpha channel","type":"boolean"}},"type":"object"},"MediaModel":{"description":"Discover capabilities at runtime. Lists, requirements, pricing and supported options vary by provider, account and model.","properties":{"audio_always_on":{"description":"The model does not offer a silent-generation switch. Omit generate_audio or set it to true.","type":"boolean"},"backgrounds":{"items":{"type":"string"},"type":"array"},"default_duration":{"type":"integer"},"display_name":{"type":"string"},"draft_resolutions":{"items":{"type":"string"},"type":"array"},"duration_from_input":{"description":"Output duration follows the input media; omit seconds and options.duration.","type":"boolean"},"duration_step":{"description":"Allowed duration increments, starting at min_duration. Omitted means one second.","type":"integer"},"formats":{"items":{"type":"string"},"type":"array"},"id":{"type":"string"},"languages":{"description":"Optional exact values for the existing language control. When omitted, retain the provider's existing language behavior.","items":{"type":"string"},"type":"array"},"max_duration":{"type":"integer"},"max_image_inputs":{"type":"integer"},"max_prompt_characters":{"description":"Effective known gateway/adapter prompt input ceiling in Unicode code points, not bytes, UTF-16 units, grapheme clusters or a documented vendor maximum. Runtime model catalogues combine the gateway 10000-code-point cap with a lower existing native adapter rule when applicable. Unknown upstream bounds do not imply unlimited input; the known gateway ceiling still applies. Manual models bypass native adapter rules and use the gateway ceiling. Omitted for no_prompt models; absence on older servers is unknown metadata. Admission trims surrounding whitespace before counting; template publication also validates stored raw prompt length. See prompt-limits.md.","maximum":10000,"minimum":1,"readOnly":true,"type":"integer"},"max_seed":{"description":"Model-specific upper bound for options.seed.","type":"integer"},"media_type":{"$ref":"#/components/schemas/MediaType"},"metadata":{"$ref":"#/components/schemas/ModelMetadata"},"min_duration":{"type":"integer"},"min_image_inputs":{"type":"integer"},"no_instructions":{"type":"boolean"},"no_language":{"type":"boolean"},"no_prompt":{"description":"The model operates on media inputs without a text prompt. Omit prompt or use an empty string.","type":"boolean"},"no_seed":{"description":"When true, omit options.seed.","type":"boolean"},"no_watermark":{"description":"When true, omit options.watermark.","type":"boolean"},"parameters":{"items":{"$ref":"#/components/schemas/ParameterField"},"type":"array"},"pricing":{"$ref":"#/components/schemas/ModelPricing"},"prompt_optional":{"description":"The model accepts an empty prompt, for example when direction comes from reference media.","type":"boolean"},"public_id":{"description":"Public model identifier used for generation requests","type":"string"},"qualities":{"items":{"type":"string"},"type":"array"},"ratios":{"items":{"type":"string"},"type":"array"},"reference_media_limits":{"$ref":"#/components/schemas/ReferenceMediaLimits"},"reference_modes":{"description":"Allowed reference combinations; shared by server validation and the console.","items":{"properties":{"default_image_role":{"description":"Role of remaining images; defaults to reference","type":"string"},"id":{"type":"string"},"image_roles":{"description":"Roles assigned to images by position.","items":{"type":"string"},"type":"array"},"label":{"type":"string"},"last_image_role":{"description":"Role of the final image after any explicitly positioned roles","type":"string"},"max_audios":{"type":"integer"},"max_images":{"type":"integer"},"max_videos":{"type":"integer"},"max_visuals":{"description":"Combined image/video limit, if set.","type":"integer"},"min_audios":{"type":"integer"},"min_images":{"type":"integer"},"min_videos":{"type":"integer"},"ratios":{"description":"Optional workflow-specific aspect ratio choices","items":{"type":"string"},"type":"array"},"requires_visual":{"description":"Audio requires at least one image or video.","type":"boolean"},"supports_reference_voice":{"type":"boolean"}},"type":"object"},"type":"array"},"reference_prompt_recommendation":{"description":"Optional reviewed provider API advice. Informational only; it never selects UI grammar, enforces spelling, rewrites prompts or grants capabilities. Absent when no explicit recommendation/example is verified.","properties":{"kind":{"enum":["example","instruction"],"type":"string"},"modes":{"items":{"type":"string"},"type":"array"},"source_url":{"format":"uri","type":"string"},"text":{"type":"string"}},"readOnly":true,"required":["text","kind","source_url"],"type":"object"},"reference_prompt_syntax":{"description":"Legacy recipe grammar retained for existing saved templates. The current UI uses the common UI reference syntax independently of this value and informational provider recommendations. Ordinary API prompts remain opaque and unchanged. Wan first_frame_references numbers reference images after the first frame.","enum":["numbered","picture","bracket","kling-id"],"type":"string"},"reference_prompt_types":{"description":"Legacy recipe media namespaces. Current UI reference validation follows the selected reference mode and input capabilities. Existing saved recipes, connection identities and credentials are unchanged.","items":{"enum":["image","video","audio"],"type":"string"},"type":"array"},"requires_audio_input":{"type":"boolean"},"requires_image_input":{"type":"boolean"},"requires_video_input":{"type":"boolean"},"requires_voice":{"type":"boolean"},"resolutions":{"items":{"type":"string"},"type":"array"},"resource_input_schemas":{"items":{"$ref":"#/components/schemas/ResourceInputSchema"},"type":"array"},"session_operation":{"properties":{"action":{"enum":["add","delete","clear","preview"],"type":"string"},"frame_index_base":{"const":0,"type":"integer"},"kind":{"type":"string"},"max_frames":{"minimum":1,"type":"integer"},"max_points":{"minimum":1,"type":"integer"},"mutates":{"type":"boolean"}},"required":["kind","action","mutates","frame_index_base"],"type":"object"},"supports_asset_references":{"description":"Accepts registered provider asset://ID references for image, video and audio inputs allowed by reference_modes. Assets must be ready and accessible to the configured provider account and project.","type":"boolean"},"supports_audio":{"type":"boolean"},"supports_audio_input":{"type":"boolean"},"supports_camera_fixed":{"type":"boolean"},"supports_draft":{"type":"boolean"},"supports_gender":{"type":"boolean"},"supports_image_input":{"type":"boolean"},"supports_last_frame":{"type":"boolean"},"supports_lyrics":{"type":"boolean"},"supports_negative_prompt":{"type":"boolean"},"supports_video_input":{"type":"boolean"},"supports_voice":{"type":"boolean"},"voice_choices":{"description":"Optional exact voice/language pairs for the existing controls. Select the is_default voice initially; preserve a still-compatible language on voice changes, otherwise use that voice's default_language. Absent metadata retains existing behavior.","items":{"$ref":"#/components/schemas/VoiceChoice"},"type":"array"},"voices":{"items":{"type":"string"},"type":"array"}},"required":["id","display_name","media_type","resolutions","ratios","min_duration","max_duration","default_duration","supports_audio","supports_draft","supports_camera_fixed","supports_last_frame","pricing"],"type":"object"},"MediaOptions":{"additionalProperties":false,"description":"Optional built-in controls accept null as omission. Values inside parameters follow the advertised provider parameter schema.","properties":{"audio_urls":{"description":"Audio references or driving audio according to the selected mode. Models advertising supports_asset_references also accept asset://ID entries, mixed with URLs.","items":{"format":"uri","type":"string"},"type":["array","null"]},"camera_fixed":{"description":"Fixed camera; omit if supports_camera_fixed is false.","type":["boolean","null"]},"draft":{"description":"Preview generation when supports_draft is true; use draft_resolutions when listed.","type":["boolean","null"]},"duration":{"description":"Music or audio output duration in seconds, when advertised by the model. Template definitions also store video duration here; ordinary video requests use the top-level seconds field. Fractional effects may declare a number parameter instead.","minimum":0,"type":["integer","null"]},"format":{"description":"Output format from the model’s formats list.","type":["string","null"]},"gender":{"description":"Vocal gender when supports_gender is true.","enum":["female","male",null],"type":["string","null"]},"generate_audio":{"description":"Request synchronized audio when supports_audio is true.","type":["boolean","null"]},"language":{"description":"Speech language, subject to the model; for example English or Auto.","type":["string","null"]},"lyrics":{"description":"Music lyrics when supports_lyrics is true.","type":["string","null"]},"negative_prompt":{"description":"Exclusions for models with supports_negative_prompt.","type":["string","null"]},"override_sound_id":{"description":"Optional accessible audio reference ID for video output. Replaces all generated audio after generation. Longer audio is trimmed and shorter audio is padded with silence; video packets and timing are preserved. Not a provider input or audio-generation toggle. Internal storage source fields are rejected.","type":"string"},"parameters":{"additionalProperties":true,"description":"Additional controls declared by MediaModel.parameters. Unknown keys and invalid types are rejected.","type":["object","null"]},"ratio":{"description":"Image or video aspect ratio from the model catalog, for example 16:9.","type":["string","null"]},"reference_mode":{"description":"Select an ID from the model's reference_modes. This determines image order and native roles. If omitted, the model selects its default reference mode. first_frame_references uses its first image as the first frame; remaining images are ordinary references.","type":["string","null"]},"reference_voices":{"additionalProperties":{"format":"uri","type":"string"},"description":"Wan 2.7 reference-to-video only. Maps an ordinary image/video URL to its voice audio URL. First frames cannot have a voice. WAV or MP3, 1–10 seconds, at most 15 MB. Defaults to the reference video's original voice when omitted.","type":["object","null"]},"return_last_frame":{"description":"Return the final video frame when supports_last_frame is true.","type":["boolean","null"]},"seed":{"description":"Video random seed from 0 to 4294967295; omit for provider randomness.","format":"int64","maximum":4294967295,"minimum":0,"type":["integer","null"]},"video_urls":{"description":"Video references in order. Models advertising supports_asset_references also accept asset://ID entries, mixed with URLs. Respect the selected reference mode's count limits.","items":{"format":"uri","type":"string"},"type":["array","null"]},"watermark":{"description":"Provider watermark preference, subject to provider support.","type":["boolean","null"]}},"type":"object"},"MediaType":{"enum":["image","video","speech","music","audio"],"type":"string"},"ModelMetadata":{"description":"Reviewed metadata plus account API metadata. Provider financial facts and source links are included only for administrators. Dates may have day or month precision; API object creation is not a release date. Provider capabilities can exceed those exposed by this gateway.","properties":{"api_created":{"description":"Unix timestamp returned by the provider model API.","format":"int64","type":"integer"},"checked_at":{"format":"date","type":"string"},"description":{"type":"string"},"facts":{"items":{"properties":{"label":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"operational":{"additionalProperties":{"properties":{"checked_at":{"format":"date-time","type":"string"},"snapshot":{"type":"string"},"source":{"properties":{"title":{"type":"string"},"url":{"type":"string"}},"type":"object"},"value":{}},"required":["value","source","snapshot","checked_at"],"type":"object"},"description":"Last-confirmed typed public facts and snapshot provenance. Current verification/freshness is in catalogue run coverage; these values never override native options or tariffs.","type":"object"},"owned_by":{"type":"string"},"release_date":{"example":"2026-09-08","type":"string"},"shutdown_date":{"type":"string"},"snapshot":{"type":"string"},"sources":{"items":{"properties":{"title":{"type":"string"},"url":{"format":"uri","type":"string"}},"type":"object"},"type":"array"},"version_date":{"example":"2026-09-08","type":"string"}},"type":"object"},"ModelPricing":{"description":"Reference price is the gateway price including current organization markup. Provider unit-rate fields are administrator-only.","properties":{"draft_audio_factor":{"type":"number"},"draft_silent_factor":{"type":"number"},"known":{"type":"boolean"},"reference_description":{"type":"string"},"reference_price_usd":{"type":"number"},"reference_quote":{"$ref":"#/components/schemas/TaskCost"},"usd_per_million_audio_tokens":{"type":"number"},"usd_per_million_by_resolution":{"additionalProperties":{"type":"number"},"type":"object"},"usd_per_million_tokens":{"type":"number"}},"type":"object"},"ModelSetting":{"properties":{"capabilities":{"$ref":"#/components/schemas/MediaModel"},"enabled_by_default":{"type":"boolean"},"granted":{"description":"Explicit grant for the organization being read","type":"boolean"},"id":{"format":"uuid","type":"string"},"model":{"description":"Native provider model ID","type":"string"},"name":{"type":"string"},"provider":{"type":"string"},"provider_icon_monochrome":{"description":"Legacy compatibility field; all provider logos follow the same theme rule","type":"boolean"},"provider_icon_url":{"description":"Authenticated uploaded PNG logo URL for administrative model pickers","type":"string"},"provider_name":{"description":"Provider display name in administrative catalog responses","type":"string"},"public_id":{"description":"Exact model value used in generation requests","type":"string"},"version":{"type":"integer"}},"type":"object"},"OfficialResourcePreset":{"properties":{"import_ticket":{"maxLength":16384,"type":"string"},"importable":{"type":"boolean"},"kind":{"enum":["element","voice"],"type":"string"},"name":{"type":"string"},"subtype":{"type":"string"},"ticket_expires_at":{"format":"date-time","type":"string"},"unavailable_reason":{"type":"string"}},"required":["name","kind","subtype","importable"],"type":"object"},"OpenAIModel":{"properties":{"capabilities":{"$ref":"#/components/schemas/MediaModel"},"created":{"description":"Provider API creation timestamp when available; null otherwise. This is not a release date.","type":["integer","null"]},"id":{"type":"string"},"object":{"const":"model","type":"string"},"owned_by":{"type":"string"},"provider":{"type":"string"}},"required":["id","object","created","owned_by","provider","capabilities"],"type":"object"},"Organization":{"properties":{"available_usd":{"multipleOf":0.000001,"type":"number"},"balance_usd":{"multipleOf":0.000001,"type":"number"},"created_at":{"format":"date-time","type":"string"},"credit_limit_usd":{"multipleOf":0.000001,"type":"number"},"default_weekly_limit_usd":{"maximum":1000000,"minimum":0,"type":["number","null"]},"domain":{"description":"Normalized main website hostname; empty for historical companies without a website.","type":"string"},"effective_markup_percent":{"allOf":[{"$ref":"#/components/schemas/MarkupPercent"}],"description":"Base fallback rate before provider/model exceptions; returned only to administrators. Use markup rules to determine a specific model rate.","readOnly":true},"id":{"type":"string"},"markup_percent":{"description":"Administrators only. Null or omitted in a response means inherit system rules; zero overrides system rates. Company provider/model exceptions still take priority.","maximum":1000,"minimum":0,"multipleOf":0.01,"type":["number","null"]},"minimize_request_logging":{"description":"New generations discard request content after completion when true. The default is false.","type":"boolean"},"name":{"type":"string"},"role":{"enum":["supermanager","admin","content_officer","developer","member","system_admin","client_manager"]},"storage_bytes":{"type":"integer"},"usage":{"description":"Customer-only summary for view=summary and roles with statistics access. Uses the report charge calculation; balance remains current.","properties":{"last_activity_at":{"description":"Latest accepted generation across all dates and providers including free and pending requests. Null means never used.","format":"date-time","type":["string","null"]},"spend_usd":{"description":"Known customer charges in the selected period.","multipleOf":0.000001,"type":"number"},"unknown_costs":{"description":"Completed requests with an unknown charge in the period.","type":"integer"}},"type":"object"},"weekly_committed_usd":{"multipleOf":0.000001,"type":"number"},"weekly_limit_usd":{"maximum":1000000,"minimum":0,"type":["number","null"]}},"type":"object"},"OrganizationCredit":{"properties":{"actor_id":{"type":"string"},"amount_usd":{"multipleOf":0.000001,"type":"number"},"created_at":{"format":"date-time","type":"string"},"external_id":{"type":"string"},"id":{"type":"string"},"kind":{"type":"string"},"reason":{"type":"string"}},"type":"object"},"OrganizationInvitation":{"properties":{"accepted_by":{"type":["string","null"]},"accepted_by_email":{"description":"Email of the user who accepted this invitation. Included in the organization invitation list when accepted.","format":"email","type":"string"},"already_member":{"description":"True when the caller is already an active member. Open the organization without accepting the invitation again.","type":"boolean"},"expires_at":{"format":"date-time","type":"string"},"first_owner":{"description":"Recipient-bound onboarding invitation for the first Supermanager, rather than an ordinary selected-role invitation.","type":"boolean"},"id":{"type":"string"},"organization_id":{"type":"string"},"organization_name":{"type":"string"},"revoked_at":{"type":["string","null"]},"role":{"description":"Organization role granted on acceptance; Member for legacy ordinary invitations.","enum":["supermanager","admin","content_officer","developer","member"],"type":"string"},"token":{"description":"Shown once on creation. Stored as a hash.","type":"string"}},"type":"object"},"OrganizationMember":{"properties":{"contacts":{"$ref":"#/components/schemas/ContactLinks"},"email":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"picture":{"format":"uri","type":"string"},"role":{"enum":["supermanager","admin","content_officer","developer","member"]},"total_consumed_usd":{"description":"Known generation costs for this member in this organization, across all time.","multipleOf":0.000001,"type":"number"},"weekly_committed_usd":{"multipleOf":0.000001,"type":"number"},"weekly_limit_usd":{"maximum":1000000,"minimum":0,"type":["number","null"]}},"type":"object"},"OrganizationModelAccess":{"additionalProperties":false,"properties":{"model_ids":{"items":{"format":"uuid","type":"string"},"maxItems":10000,"type":"array","uniqueItems":true},"version":{"minimum":1,"type":"integer"}},"required":["model_ids","version"],"type":"object"},"ParameterField":{"properties":{"choices":{"items":{"type":"string"},"type":"array"},"default":{},"key":{"pattern":"^[a-z][a-z0-9_]*$","type":"string"},"label":{"type":"string"},"max":{"type":"number"},"max_length":{"type":"integer"},"min":{"type":"number"},"required":{"type":"boolean"},"type":{"enum":["text","select","boolean","number","integer"],"type":"string"}},"required":["key","label","type"],"type":"object"},"Payment":{"additionalProperties":false,"properties":{"amount_cents":{"description":"Top-up principal before tax and processing fees, in USD cents.","type":"integer"},"billing":{"$ref":"#/components/schemas/PaymentBilling"},"checkout_url":{"format":"uri","type":"string"},"created_at":{"format":"date-time","type":"string"},"credited_cents":{"type":"integer"},"currency":{"enum":["usd"],"type":"string"},"expires_at":{"description":"Payment request deadline at creation plus 30 days. Unpaid requests become expired and cannot be reused.","format":"date-time","type":"string"},"fee_cents":{"description":"Processor fee in cents. Stablecoin payment fees are stored separately in stablecoin.fee_micros, without cent rounding.","type":"integer"},"fee_micros":{"description":"Exact payment fee in USD millionths across payment methods","minimum":0,"type":"integer"},"fee_mode":{"enum":["service","organization"],"type":"string"},"held_cents":{"type":"integer"},"id":{"format":"uuid","type":"string"},"invoice":{"$ref":"#/components/schemas/PaymentInvoice"},"invoice_mode":{"enum":["","stripe","local"],"type":"string"},"live":{"type":"boolean"},"organization_id":{"format":"uuid","type":"string"},"provider_id":{"format":"uuid","type":"string"},"receipt_url":{"format":"uri","type":"string"},"refunded_cents":{"type":"integer"},"revision":{"type":"integer"},"settled":{"type":"boolean"},"settlement":{"$ref":"#/components/schemas/PaymentSettlement"},"stablecoin":{"$ref":"#/components/schemas/StablecoinPayment"},"status":{"enum":["pending","confirming","cancelled","paid","partially_refunded","refunded","disputed","expired","failed"],"type":"string"},"tax_mode":{"description":"Empty for legacy or external payments; exclusive for new card and stablecoin top-ups.","enum":["","exclusive"],"type":"string"},"updated_at":{"format":"date-time","type":"string"},"vat":{"$ref":"#/components/schemas/PaymentVATSnapshot"}},"required":["id","organization_id","provider_id","amount_cents","currency","live","status","fee_mode","fee_cents","credited_cents","settled","revision"],"type":"object"},"PaymentBilling":{"description":"Verified purchase basis and customer billing details. Tax is paid by the customer and never credited to their balance. Refund and hold amounts here include tax; payment-level refunded_cents and held_cents are principal reductions.","properties":{"address":{"properties":{"city":{"type":"string"},"country":{"type":"string"},"line1":{"type":"string"},"line2":{"type":"string"},"postal_code":{"type":"string"},"state":{"type":"string"}},"type":"object"},"business_name":{"type":"string"},"email":{"type":"string"},"held_cents":{"minimum":0,"type":"integer"},"refunded_cents":{"minimum":0,"type":"integer"},"subtotal_cents":{"minimum":100,"type":"integer"},"tax_cents":{"minimum":0,"type":"integer"},"tax_ids":{"items":{"properties":{"type":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"total_cents":{"minimum":100,"type":"integer"}},"type":"object"},"PaymentCheckout":{"additionalProperties":false,"properties":{"amount_usd":{"maximum":10000,"minimum":1,"multipleOf":0.01,"type":"number"},"billing":{"$ref":"#/components/schemas/StablecoinBillingProfile"},"fee_mode":{"enum":["service","organization"],"type":"string"},"network":{"enum":["ethereum","bsc","polygon"],"type":"string"},"provider_id":{"format":"uuid","type":"string"},"token":{"enum":["USDT","USDC"],"type":"string"}},"required":["provider_id","amount_usd","fee_mode"],"type":"object"},"PaymentInvoice":{"description":"Native Stripe invoice or a locally issued immutable PDF. Native documents may remain pending after settlement; local documents are generated on request.","properties":{"id":{"type":"string"},"number":{"type":"string"},"pdf_url":{"format":"uri","type":"string"},"status":{"enum":["pending","paid","issued"],"type":"string"},"url":{"format":"uri","type":"string"}},"type":"object"},"PaymentNotificationSettings":{"additionalProperties":false,"properties":{"critical_emails":{"items":{"format":"email","type":"string"},"type":"array"},"delivery":{"additionalProperties":false,"properties":{"last_sent_at":{"description":"Last acceptance by the email provider; not proof of inbox delivery","format":"date-time","type":"string"},"pending":{"minimum":0,"type":"integer"},"retrying":{"minimum":0,"type":"integer"}},"required":["pending","retrying"],"type":"object"},"email_enabled":{"type":"boolean"},"success_emails":{"items":{"format":"email","type":"string"},"type":"array"},"version":{"minimum":1,"type":"integer"}},"required":["critical_emails","success_emails","version","email_enabled","delivery"],"type":"object"},"PaymentNotificationUpdate":{"additionalProperties":false,"properties":{"critical_emails":{"items":{"format":"email","maxLength":254,"type":"string"},"maxItems":20,"type":"array"},"success_emails":{"items":{"format":"email","maxLength":254,"type":"string"},"maxItems":20,"type":"array"},"version":{"minimum":1,"type":"integer"}},"required":["critical_emails","success_emails","version"],"type":"object"},"PaymentProvider":{"additionalProperties":false,"properties":{"account_id":{"type":"string"},"credentials_configured":{"type":"boolean"},"enabled":{"type":"boolean"},"fee_mode":{"enum":["service","organization"],"type":"string"},"id":{"format":"uuid","type":"string"},"kind":{"enum":["stripe","stablecoin","external"],"type":"string"},"last_webhook_at":{"format":"date-time","type":"string"},"live":{"type":"boolean"},"name":{"type":"string"},"stablecoin":{"$ref":"#/components/schemas/StablecoinConfig"},"stripe_invoices":{"default":true,"description":"Stripe only. Enable native Stripe invoice creation; disable for local VAT and Gateway PDF invoices. Omitted on update preserves the saved value. Changes apply to new payments.","type":"boolean"},"version":{"type":"integer"},"webhook_configured":{"type":"boolean"},"webhook_url":{"type":"string"}},"required":["id","kind","name","enabled","live","version","fee_mode"],"type":"object"},"PaymentProviderUpdate":{"additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"fee_mode":{"enum":["service","organization"],"type":"string"},"kind":{"enum":["stripe","stablecoin"],"type":"string"},"name":{"maxLength":100,"type":"string"},"secret_key":{"maxLength":512,"type":"string","writeOnly":true},"stablecoin":{"$ref":"#/components/schemas/StablecoinConfig"},"stripe_invoices":{"default":true,"description":"Stripe only. Enable native Stripe invoice creation; disable for local VAT and Gateway PDF invoices. Omitted on update preserves the saved value. Changes apply to new payments.","type":"boolean"},"version":{"minimum":0,"type":"integer"},"webhook_secret":{"maxLength":512,"type":"string","writeOnly":true}},"required":["kind","name","enabled","fee_mode","version"],"type":"object"},"PaymentSellerCompany":{"additionalProperties":false,"properties":{"address":{"$ref":"#/components/schemas/PaymentBilling/properties/address"},"email":{"maxLength":254,"type":"string"},"invoice_logo":{"additionalProperties":false,"description":"Separate invoice logo. PNG or JPEG up to 512 KiB and 4 megapixels, max 4096 pixels per side. Re-encoded as PNG on save. Null removes it.","nullable":true,"properties":{"data":{"format":"byte","type":"string"},"mime":{"enum":["image/png","image/jpeg"],"type":"string"}},"required":["mime","data"],"type":"object"},"legal_name":{"maxLength":200,"minLength":1,"type":"string"},"oss_registered":{"type":"boolean"},"registration_number":{"maxLength":300,"type":"string"},"vat_number":{"description":"Seller VAT number. When VAT registered, 3–40 letters/digits including at least one digit; spaces are removed and letters uppercased on save. Invalid format returns invalid_seller_vat_number. The console derives VAT registration from a nonempty number; this does not verify registration with a tax authority.","maxLength":300,"type":"string"},"vat_registered":{"type":"boolean"}},"type":"object"},"PaymentSettlement":{"additionalProperties":false,"description":"Actual provider settlement amounts, not the cardholder bank debit. Divide minor-unit amounts by 10 to the power of decimal_places. Omitted until authoritative settlement data is available.","properties":{"amount_minor":{"minimum":1,"type":"integer"},"currency":{"pattern":"^[a-z]{3}$","type":"string"},"decimal_places":{"maximum":3,"minimum":0,"type":"integer"},"fee_minor":{"minimum":0,"type":"integer"}},"required":["currency","amount_minor","fee_minor","decimal_places"],"type":"object"},"PaymentVATRule":{"additionalProperties":false,"properties":{"country":{"description":"ISO country code or domestic/EU/non_eu/*","type":"string"},"rate_percent":{"maximum":100,"minimum":0,"multipleOf":0.01,"type":"number"},"status":{"enum":["any","registered","unregistered"],"type":"string"},"treatment":{"enum":["standard","reverse_charge","exempt","outside_scope"],"type":"string"}},"required":["country","status","treatment","rate_percent"],"type":"object"},"PaymentVATSettings":{"additionalProperties":false,"properties":{"rules":{"items":{"$ref":"#/components/schemas/PaymentVATRule"},"maxItems":500,"type":"array"},"seller":{"$ref":"#/components/schemas/PaymentSellerCompany"},"version":{"minimum":1,"type":"integer"}},"required":["version","seller","rules"],"type":"object"},"PaymentVATSnapshot":{"properties":{"buyer_country":{"type":"string"},"buyer_status":{"enum":["registered","unregistered","unverified"],"type":"string"},"rule":{"$ref":"#/components/schemas/PaymentVATRule"},"seller":{"$ref":"#/components/schemas/PaymentSellerCompany"},"settings_version":{"type":"integer"},"verification":{"$ref":"#/components/schemas/PaymentVATVerification"}},"type":"object"},"PaymentVATVerification":{"additionalProperties":false,"properties":{"business_name":{"type":"string"},"country":{"type":"string"},"expires_at":{"format":"date-time","type":"string"},"number":{"type":"string"},"reference":{"maxLength":1000,"type":"string"},"source":{"enum":["","manual","vies"],"readOnly":true,"type":"string"},"verified":{"type":"boolean"},"verified_at":{"format":"date-time","readOnly":true,"type":"string"},"version":{"minimum":0,"type":"integer"}},"type":"object"},"ProviderAsset":{"properties":{"asset_id":{"type":"string"},"error":{"description":"Sanitized registration/preparation failure.","type":"string"},"group_id":{"type":"string"},"name":{"type":"string"},"preview_url":{"description":"Temporary provider URL; never use as a durable identifier.","type":"string"},"status":{"description":"Provider state or Gateway preparation state; only Active is selectable.","type":"string"},"type":{"enum":["Image","Video","Audio"],"type":"string"},"uri":{"description":"asset:// ID for generation input once Active.","type":"string"}},"type":"object"},"ProviderAssetBinding":{"allOf":[{"$ref":"#/components/schemas/ProviderAsset"},{"properties":{"id":{"description":"Gateway workspace binding ID","format":"uuid","type":"string"},"provider":{"type":"string"},"registration_name":{"description":"Unique remote name used to reconcile uncertain creates","type":"string"},"source_id":{"format":"uuid","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"type":"object"}]},"ProviderAssetBindings":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ProviderAssetBinding"},"type":"array"},"has_more":{"type":"boolean"},"next_offset":{"type":"integer"}},"type":"object"},"ProviderAssetGroup":{"properties":{"id":{"type":"string"},"name":{"type":"string"}},"type":"object"},"ProviderAssetGroups":{"properties":{"can_import":{"type":"boolean"},"data":{"items":{"$ref":"#/components/schemas/ProviderAssetGroup"},"type":"array"}},"type":"object"},"ProviderAssetInventory":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ProviderAsset"},"type":"array"},"next":{"type":"string"}},"type":"object"},"ProviderConnection":{"description":"Administrator-managed API settings. Omitted connection preserves the existing object; when supplied it replaces it. Header values omitted on existing operation/name pairs preserve saved secrets. Manual models survive discovery refreshes. Unknown prices block budgeted generation until a per-request tariff is explicitly configured.","properties":{"endpoints":{"additionalProperties":false,"properties":{"generate":{"type":"string"},"models":{"type":"string"},"poll":{"description":"Task status URL or absolute path with a {task_id} placeholder.","type":"string"}},"type":"object"},"extra_body":{"additionalProperties":true,"description":"Optional body overrides; model and input content are protected.","type":"object"},"headers":{"items":{"properties":{"hint":{"readOnly":true,"type":"string"},"name":{"type":"string"},"operation":{"enum":["","models","generate","poll"],"type":"string"},"value":{"type":"string","writeOnly":true}},"required":["name"],"type":"object"},"maxItems":64,"type":"array"},"manual_catalog":{"description":"Skip remote discovery and use manual models only.","type":"boolean"},"models":{"items":{"properties":{"extra_body":{"additionalProperties":true,"type":"object"},"model":{"additionalProperties":true,"description":"Media model capabilities including exact upstream id, display_name and media_type.","type":"object"},"price_usd":{"description":"Explicit price per request. Omit for unknown pricing.","maximum":1000000,"minimum":0,"type":"number"},"profile":{"description":"ID of a supported API request profile from the types endpoint.","type":"string"}},"required":["model","profile"],"type":"object"},"maxItems":250,"type":"array"},"timeout_seconds":{"description":"API response deadline in seconds. Omit or null to inherit PROVIDER_HTTP_TIMEOUT (default 30 seconds). Generation timeout_seconds overrides it for submission only.","format":"int64","maximum":9223372036,"minimum":1,"type":["integer","null"]}},"type":"object"},"ProviderDescriptor":{"properties":{"credentials_configured":{"type":"boolean"},"default_model":{"type":"string"},"icon_monochrome":{"description":"Legacy compatibility field; all provider logos follow the same theme rule","type":"boolean"},"icon_url":{"description":"Authenticated content-versioned uploaded PNG logo URL; absent until uploaded","type":"string"},"id":{"type":"string"},"live":{"type":"boolean"},"models":{"items":{"$ref":"#/components/schemas/MediaModel"},"type":"array"},"name":{"type":"string"}},"required":["id","name","live","credentials_configured","default_model","models"],"type":"object"},"ProviderField":{"properties":{"default":{"type":"string"},"group":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"required":{"type":"boolean"},"secret":{"type":"boolean"}},"required":["key","label"],"type":"object"},"ProviderResource":{"description":"Contains no provider resource IDs, task/file handles, credentials, source URLs, storage keys or input hashes. Native face IDs stay private; callers use local indices.","properties":{"bound_voice_binding_id":{"format":"uuid","type":"string"},"created_at":{"format":"date-time","type":"string"},"deleted_at":{"format":"date-time","type":"string"},"description":{"type":"string"},"generation_id":{"description":"Owned origin generation for archived face-preview artifact IDs.","format":"uuid","type":"string"},"id":{"format":"uuid","type":"string"},"is_preset":{"type":"boolean"},"kind":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string"},"session":{"properties":{"expires_at":{"format":"date-time","type":"string"},"faces":{"items":{"properties":{"end_ms":{"type":"integer"},"index":{"minimum":1,"type":"integer"},"preview_artifact_id":{"type":"string"},"start_ms":{"type":"integer"}},"type":"object"},"type":"array"},"fps":{"type":"number"},"frame_count":{"type":"integer"},"has_selection":{"type":"boolean"},"selection_revision":{"type":"integer"},"selections":{"items":{"properties":{"frame_index":{"type":"integer"},"points":{"items":{"properties":{"x":{"maximum":1,"minimum":0,"type":"number"},"y":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"},"maxItems":10,"type":"array"}},"type":"object"},"maxItems":10,"type":"array"},"source_video_duration":{"type":"number"}},"type":"object"},"status":{"enum":["queued","running","succeeded","failed","deleting","deleted"],"type":"string"},"subtype":{"type":"string"},"unavailable_reason":{"type":"string"},"updated_at":{"format":"date-time","type":"string"},"usable":{"actual connection revision and session expiry.":null,"description":"Checks owner","type":"boolean"}},"required":["id","provider","kind","status","usable"],"type":"object"},"ProviderResourceAction":{"additionalProperties":false,"properties":{"expected_revision":{"format":"int64","minimum":0,"type":"integer"},"frame":{"$ref":"#/components/schemas/FrameSelection"},"max_expected_usd":{"minimum":0,"type":"number"},"model":{"description":"Optional authorized session-operation model.","type":"string"},"recover":{"default":false,"description":"Explicit recovery clear only; never automatically resubmit an uncertain mutation.","type":"boolean"},"workflow_model":{"description":"Required for state mutations; currently authorized media consumer whose inputs require this session. A real video preview remains a media operation.","type":"string"}},"required":["expected_revision"],"type":"object"},"ProviderResourceCreate":{"additionalProperties":false,"properties":{"bound_voice_binding_id":{"format":"uuid","type":"string"},"description":{"type":"string"},"generated_artifact_id":{"description":"Local archived audio artifact selector. Required when multiple eligible audio outputs exist; never an upstream audio ID or URL.","maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$","type":"string"},"generated_task_id":{"description":"An eligible completed owned generation; never a native provider ID.","format":"uuid","type":"string"},"kind":{"type":"string"},"max_expected_usd":{"description":"Unknown totals cannot satisfy an explicit cap.","minimum":0,"type":"number"},"model":{"description":"Optional native input-preparation operation returned for the authorized media consumer.","type":"string"},"name":{"type":"string"},"provider":{"description":"Authorized concrete provider connection ID.","type":"string"},"reference_ids":{"items":{"format":"uuid","type":"string"},"maxItems":64,"type":"array"},"subtype":{"type":"string"},"tags":{"items":{"type":"string"},"maxItems":32,"type":"array"},"workflow_model":{"description":"Required currently authorized media consumer on this connection; preparation is not a standalone model.","type":"string"}},"required":["provider","workflow_model","kind","name"],"type":"object"},"ProviderResourceJob":{"properties":{"binding_id":{"format":"uuid","type":"string"},"completed_at":{"format":"date-time","type":"string"},"created_at":{"format":"date-time","type":"string"},"error":{"type":"string"},"id":{"format":"uuid","type":"string"},"kind":{"type":"string"},"operation":{"enum":["create","delete"],"type":"string"},"provider":{"type":"string"},"started_at":{"format":"date-time","type":"string"},"status":{"enum":["queued","running","succeeded","failed","deleting","deleted"],"type":"string"},"updated_at":{"format":"date-time","type":"string"},"warning":{"type":"string"}},"required":["id","binding_id","provider","operation","status"],"type":"object"},"ProviderUpdate":{"additionalProperties":{"type":"string","writeOnly":true},"description":"Fields are declared in AdminProvider.fields; unsupported keys are rejected. PUT acts as a partial update: omitted fields keep existing values; empty strings clear them. Clearing a required credential disables the provider. Billing credentials are optional and used only for charge reconciliation; clear both together. Raw credentials are never returned.","properties":{"api_key":{"description":"Write-only provider secret; omitted keeps the saved value; an empty string clears it.","type":"string","writeOnly":true},"archived":{"description":"Stops new work while retaining accepted tasks and history.","type":"boolean"},"asset_access_key_id":{"description":"Optional separate BytePlus library management AccessKey ID.","type":"string","writeOnly":true},"asset_access_key_secret":{"description":"Optional separate BytePlus library secret. Omit to preserve; empty clears.","type":"string","writeOnly":true},"asset_project":{"default":"default","description":"Library project; must match the inference endpoint project.","type":"string"},"asset_region":{"default":"ap-southeast-1","description":"Johor asset management region.","type":"string"},"base_url":{"description":"Provider endpoint override; omitted keeps the saved value; an empty string restores the default.","format":"uri","type":"string"},"billing_access_key_id":{"description":"Write-only provider secret; omitted keeps the saved value; an empty string clears it.","type":"string","writeOnly":true},"billing_access_key_secret":{"description":"Write-only provider secret; omitted keeps the saved value; an empty string clears it.","type":"string","writeOnly":true},"connection":{"$ref":"#/components/schemas/ProviderConnection"},"enabled":{"description":"Enable or disable this provider for the account.","type":"boolean"},"music_api_key":{"description":"Write-only provider secret; omitted keeps the saved value; an empty string clears it.","type":"string","writeOnly":true},"music_base_url":{"description":"Provider endpoint override; omitted keeps the saved value; an empty string restores the default.","format":"uri","type":"string"},"name":{"maxLength":120,"type":"string"},"version":{"description":"Current version required when changing connection configuration, name or archive state.","format":"int64","type":"integer"}},"type":"object"},"ProviderUsage":{"properties":{"cost_source":{"type":"string"},"cost_status":{"type":"string"},"currency":{"type":"string"},"estimated_cost":{"type":"number"},"metrics":{"items":{"properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"}},"required":["name","unit","quantity"],"type":"object"},"type":"array"},"raw":{"description":"Provider usage payload preserved as arbitrary JSON"}},"type":"object"},"ReferenceImage":{"properties":{"content_type":{"enum":["image/png","image/jpeg","image/webp","image/gif","video/mp4","video/quicktime","video/webm","audio/mpeg","audio/wave","audio/wav","audio/x-wav","audio/ogg","audio/flac"],"type":"string"},"created_at":{"format":"date-time","type":"string"},"duplicate":{"description":"True when upload reused an existing file.","type":"boolean"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"sha256":{"description":"SHA-256 of file bytes; optional for older images until indexed.","pattern":"^[0-9a-f]{64}$","type":"string"},"size_bytes":{"maximum":209715200,"minimum":1,"type":"integer"},"url":{"description":"Relative capability URL for preview and provider access. Treat it as a secret; anyone holding it can read the file until deletion or signing-key rotation.","type":"string"}},"required":["id","name","content_type","size_bytes","created_at","url"],"type":"object"},"ReferenceMediaLimits":{"description":"Optional provider-specific media constraints applied in addition to shared upload and inspection checks. Missing metadata is not an unsupported capability declaration.","properties":{"audio":{"$ref":"#/components/schemas/MediaFileLimits"},"image":{"$ref":"#/components/schemas/MediaFileLimits"},"max_files":{"type":"integer"},"max_video_and_output_duration":{"description":"Maximum inspected input-video seconds plus output seconds when video input is present. Zero or absent means unspecified. Applies to server-inspected template media; arbitrary URL inputs have no inspected duration.","type":"number"},"reference_voice":{"$ref":"#/components/schemas/MediaFileLimits"},"video":{"$ref":"#/components/schemas/MediaFileLimits"}},"type":"object"},"ReferenceValidationTarget":{"additionalProperties":false,"description":"Model identity and selected generation settings, not client-provided limits. The server resolves current authorized capabilities. Input URLs are ignored. reference_ids are existing owned inputs for aggregate checks during another upload. No context means common library checks only. Average FPS follows inspected container timing; nominal FPS and upstream provider acceptance are not inferred.","properties":{"model":{"type":"string"},"options":{"$ref":"#/components/schemas/MediaOptions"},"provider":{"type":"string"},"reference_ids":{"items":{"format":"uuid","type":"string"},"maxItems":64,"type":"array"},"role":{"description":"Per-visual voice intent is checked against the native workflow and its separate voice file contract; it never consumes a free audio slot.","enum":["","reference_voice"],"type":"string"}},"required":["provider","model"],"type":"object"},"ReportColumns":{"description":"Visible report columns. Omitted until the user saves a selection; the UI then uses its basic default set.","items":{"enum":["date","generation_id","organization","user","api_key","model","provider","status","tokens","estimated_cost","cost","confirmed_cost","settlement","customer_charge"],"type":"string"},"maxItems":14,"minItems":1,"type":"array","uniqueItems":true},"ReportDetail":{"properties":{"content_access":{"type":"boolean"},"generation":{"additionalProperties":true,"description":"Existing public generation representation restricted by viewer role","type":"object"},"links":{"description":"Report-scoped authenticated links for existing result files; content roles only","properties":{"content_url":{"type":"string"},"download_url":{"type":"string"},"last_frame_url":{"type":"string"}},"type":"object"},"processing":{"additionalProperties":true,"description":"Retained worker start","polling errors and original image-input flag; content roles only":null,"type":"object"},"report":{"additionalProperties":true,"and profit_recognized_at.":null,"awaiting_billing":null,"awaiting_cost":null,"description":"Authorized cost report row with user and key labels. Administrator and scoped sales viewers additionally receive profit_usd","not_applicable)":null,"not_tracked":null,"profit_status (generating":null,"recognized":null,"type":"object"},"request":{"description":"Content roles only. Minimal logging exposes only retained technical options.","properties":{"options":{"additionalProperties":true,"type":"object"},"prompt":{"type":"string"},"webhook_url":{"type":["string","null"]}},"type":"object"},"request_logging":{"enum":["full","minimized"],"type":"string"}},"required":["report","generation","content_access","request_logging"],"type":"object"},"ReportGroup":{"allOf":[{"$ref":"#/components/schemas/ReportMetrics"},{"properties":{"name":{"type":"string"},"provider":{"type":"string"}},"type":"object"}]},"ReportMetrics":{"properties":{"failed":{"type":"integer"},"pending_profit_requests":{"description":"Requests awaiting billing verification or known costs.","type":"integer"},"priced_requests":{"description":"Requests with known charge values.","type":"integer"},"profit_usd":{"description":"Administrator or scoped sales viewer only. Recognized customer spending minus provider cost; excludes deposits","historical requests and personal/BYOK requests.":null,"type":"number"},"recognized_profit_requests":{"type":"integer"},"requests":{"type":"integer"},"spend_usd":{"description":"Sum of known customer charges including markup; same amounts as report rows.","type":"number"},"successful":{"type":"integer"},"token_requests":{"description":"Requests that reported token counters; missing counters are not treated as zero.","type":"integer"},"tokens":{"description":"Reported total tokens; input/output counters are not added again when a total exists.","type":"number"}},"required":["requests","successful","failed","spend_usd","priced_requests","tokens","token_requests"],"type":"object"},"ReportSummary":{"allOf":[{"$ref":"#/components/schemas/ReportMetrics"},{"properties":{"average_cost_usd":{"description":"Average over requests with known costs.","type":["number","null"]},"interval":{"enum":["day","week","month"],"type":"string"},"periods":{"items":{"allOf":[{"$ref":"#/components/schemas/ReportMetrics"},{"properties":{"from":{"format":"date","type":"string"},"to":{"format":"date","type":"string"}},"type":"object"}]},"type":"array"},"provider_models":{"items":{"$ref":"#/components/schemas/ReportGroup"},"type":"array"},"providers":{"items":{"$ref":"#/components/schemas/ReportGroup"},"type":"array"},"public_models":{"description":"Historical public model names sorted by spend descending.","items":{"$ref":"#/components/schemas/ReportGroup"},"type":"array"}},"type":"object"}]},"RequestLimitConfig":{"additionalProperties":false,"properties":{"values":{"additionalProperties":false,"properties":{"key_generations_minute":{"example":100,"maximum":2147483647,"minimum":1,"nullable":true,"type":"integer"},"key_generations_second":{"example":20,"maximum":2147483647,"minimum":1,"nullable":true,"type":"integer"},"key_reads_minute":{"example":1200,"maximum":2147483647,"minimum":1,"nullable":true,"type":"integer"},"user_active_keys":{"example":20,"maximum":2147483647,"minimum":1,"nullable":true,"type":"integer"},"user_generations_minute":{"example":300,"maximum":2147483647,"minimum":1,"nullable":true,"type":"integer"},"user_generations_second":{"example":50,"maximum":2147483647,"minimum":1,"nullable":true,"type":"integer"},"user_key_creations_minute":{"example":5,"maximum":2147483647,"minimum":1,"nullable":true,"type":"integer"},"user_reads_minute":{"example":3600,"maximum":2147483647,"minimum":1,"nullable":true,"type":"integer"}},"required":["key_generations_minute","user_generations_minute","key_generations_second","user_generations_second","key_reads_minute","user_reads_minute","user_key_creations_minute","user_active_keys"],"type":"object"},"version":{"format":"int64","type":"integer"}},"required":["values","version"],"type":"object"},"RequestLimitPolicy":{"properties":{"effective":{"additionalProperties":{"minimum":1,"type":"integer"},"type":"object"},"organization":{"$ref":"#/components/schemas/RequestLimitConfig"},"system":{"$ref":"#/components/schemas/RequestLimitConfig"}},"required":["system","organization","effective"],"type":"object"},"ResourceInputSchema":{"properties":{"kind":{"type":"string"},"max_count":{"minimum":0,"type":"integer"},"subtypes":{"items":{"type":"string"},"type":"array"},"supports_presets":{"description":"Accepts imported official presets of this reviewed resource kind.","type":"boolean"}},"required":["kind","max_count"],"type":"object"},"RevokedKey":{"description":"Snapshot contains immutable alias, prefix, organization, owner/creator/revoker IDs and email labels, dates, scopes, expiry/resource settings, revocation reason, correlation ID, known spend in integer USD micros and pending/unknown counts at revocation. Budget is null because keys have no individual budgets. history_complete=false marks migrated records whose revoking actor and original spend were not recorded. Current lifetime values are separate and can change after reconciliation.","properties":{"current_spent_micros":{"type":"integer"},"id":{"format":"uuid","type":"string"},"organization_id":{"type":"string"},"pending_requests":{"type":"integer"},"revoked_at":{"format":"date-time","type":"string"},"snapshot":{"additionalProperties":true,"type":"object"},"unknown_cost_requests":{"type":"integer"}},"type":"object"},"RevokedKeyPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/RevokedKey"},"type":"array"},"has_more":{"type":"boolean"},"next_offset":{"type":"integer"}},"type":"object"},"SalesGrant":{"properties":{"created_at":{"format":"date-time","type":"string"},"employee_id":{"format":"uuid","type":"string"},"id":{"format":"uuid","type":"string"},"issuer_id":{"format":"uuid","type":"string"},"issuer_name":{"type":"string"},"issuer_picture":{"format":"uri","type":"string"},"permission":{"enum":["pricing","models","topup","bonuses"],"type":"string"}},"type":"object"},"SalesMember":{"properties":{"email":{"type":"string"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"own_clients":{"minimum":0,"type":"integer"},"picture":{"description":"Existing account profile picture; omitted when unavailable.","format":"uri","type":"string"},"role":{"$ref":"#/components/schemas/SalesRole"},"supervisor_id":{"description":"Empty means direct reporting to Administrator.","type":"string"}},"required":["id","name","email","role","supervisor_id","own_clients"],"type":"object"},"SalesRole":{"enum":["client_manager","lead_client_manager","regional_client_manager"],"type":"string"},"SalesStructure":{"properties":{"members":{"items":{"$ref":"#/components/schemas/SalesMember"},"type":"array"},"version":{"minimum":1,"type":"integer"}},"required":["version","members"],"type":"object"},"ServiceInfo":{"properties":{"auth_mode":{"description":"Console sign-in mode; personal keys remain valid in both modes.","enum":["google","api_key"],"type":"string"},"console":{"$ref":"#/components/schemas/SystemSettings"},"live":{"type":"boolean"},"model":{"type":"string"},"provider":{"type":"string"}},"required":["provider","model","live"],"type":"object"},"SiteBranding":{"additionalProperties":false,"properties":{"assets":{"additionalProperties":false,"description":"Dark slots use logo, symbol and favicon; corresponding light slots have _light suffix. Slots inherit from the other theme when empty. touch_icon and email_logo are shared.","properties":{"email_logo":{"$ref":"#/components/schemas/BrandAsset"},"favicon":{"$ref":"#/components/schemas/BrandAsset"},"favicon_light":{"$ref":"#/components/schemas/BrandAsset"},"logo":{"$ref":"#/components/schemas/BrandAsset"},"logo_light":{"$ref":"#/components/schemas/BrandAsset"},"symbol":{"$ref":"#/components/schemas/BrandAsset"},"symbol_light":{"$ref":"#/components/schemas/BrandAsset"},"touch_icon":{"$ref":"#/components/schemas/BrandAsset"}},"type":"object"},"contact_email":{"anyOf":[{"format":"email","maxLength":254,"type":"string"},{"maxLength":0,"type":"string"}],"description":"Empty when unconfigured; otherwise a valid contact email address."},"content_max_width":{"description":"Desktop content maximum in CSS pixels. Null uses all available content space.","maximum":7680,"minimum":640,"nullable":true,"type":"integer"},"dark":{"$ref":"#/components/schemas/BrandPalette"},"default_preset":{"description":"Existing color theme used on public surfaces and by users who follow the site default. The dark/light fields mirror this preset.","maxLength":64,"type":"string"},"description":{"description":"Maximum 240 UTF-8 bytes without control characters","maxLength":240,"type":"string"},"light":{"$ref":"#/components/schemas/BrandPalette"},"name":{"description":"Empty when unconfigured; otherwise maximum 80 UTF-8 bytes without control characters","maxLength":80,"type":"string"},"presets":{"description":"Administrator-managed named pairs of dark and light palettes. Legacy writes without this field preserve the catalog and edit its default pair.","items":{"$ref":"#/components/schemas/ColorPreset"},"maxItems":32,"minItems":1,"type":"array"},"sidebar_subsections":{"default":true,"description":"Expand navigation subsections in the left menu on desktop. Mobile retains horizontal tabs.","type":"boolean"},"site_max_width":{"default":1280,"description":"Desktop site maximum in CSS pixels. Null removes the width limit while retaining safe outer gutters. Missing legacy values retain 1280.","maximum":7680,"minimum":960,"nullable":true,"type":"integer"},"version":{"minimum":1,"type":"integer"}},"required":["name","description","contact_email","dark","light","assets","version"],"type":"object"},"StablecoinBillingProfile":{"additionalProperties":false,"properties":{"address":{"$ref":"#/components/schemas/PaymentBilling/properties/address"},"business_name":{"maxLength":200,"minLength":1,"type":"string"},"email":{"maxLength":300,"type":"string"},"tax_ids":{"$ref":"#/components/schemas/PaymentBilling/properties/tax_ids"}},"required":["business_name","address"],"type":"object"},"StablecoinConfig":{"additionalProperties":false,"properties":{"wallets":{"items":{"additionalProperties":false,"properties":{"address":{"pattern":"^0x[0-9a-fA-F]{40}$","type":"string"},"network":{"enum":["ethereum","bsc","polygon"],"type":"string"},"tokens":{"items":{"enum":["USDT","USDC"],"type":"string"},"maxItems":2,"minItems":1,"type":"array","uniqueItems":true}},"required":["network","address","tokens"],"type":"object"},"maxItems":3,"minItems":1,"type":"array"}},"required":["wallets"],"type":"object"},"StablecoinPayment":{"description":"Immutable transfer instructions and exact USD payment fee. One token unit is priced at one USD. Amount reservations survive payment and cancellation.","properties":{"address":{"type":"string"},"amount":{"pattern":"^[0-9]+\\.[0-9]{6}$","type":"string"},"block_number":{"type":"integer"},"contract":{"type":"string"},"explorer_url":{"format":"uri","type":"string"},"fee_micros":{"maximum":9999,"minimum":1,"type":"integer"},"log_index":{"type":"integer"},"network":{"enum":["ethereum","bsc","polygon"],"type":"string"},"start_block":{"minimum":0,"type":"integer"},"token":{"enum":["USDT","USDC"],"type":"string"},"transaction_hash":{"type":"string"},"vat":{"$ref":"#/components/schemas/PaymentVATSnapshot"}},"type":"object"},"StorageSettings":{"properties":{"access_key_id":{"description":"Saved key identifier, not the secret. Empty when no key is configured.","readOnly":true,"type":"string"},"browser_uploads_pending":{"description":"Present and true on Save when CORS was confirmed but browser access may still be propagating. Retry the read-only connection check; the policy does not need another write.","readOnly":true,"type":"boolean"},"bucket":{"type":"string"},"credentials_configured":{"type":"boolean"},"driver":{"enum":["local","s3","gateway"],"type":"string"},"endpoint":{"description":"HTTP(S) origin. Empty selects standard AWS endpoints.","type":"string"},"path_style":{"type":"boolean"},"prefix":{"type":"string"},"region":{"description":"Bucket region; auto for Cloudflare R2.","type":"string"}},"required":["driver","endpoint","region","bucket","prefix","path_style","access_key_id","credentials_configured"],"type":"object"},"StorageUpdate":{"additionalProperties":false,"properties":{"access_key_id":{"description":"Required for initial S3 setup and endpoint changes. Blank preserves saved value.","type":"string","writeOnly":true},"bucket":{"description":"Existing bucket, required for S3.","type":"string"},"driver":{"enum":["local","s3","gateway"],"type":"string"},"endpoint":{"description":"HTTP(S) origin without path, query or embedded credentials. A missing scheme defaults to HTTPS. Empty for AWS S3.","type":"string"},"path_style":{"default":false,"type":"boolean"},"prefix":{"maxLength":512,"type":"string"},"region":{"description":"Required for S3. Use auto for Cloudflare R2.","type":"string"},"secret_access_key":{"description":"Required for initial S3 setup and endpoint changes. Blank preserves saved value.","type":"string","writeOnly":true}},"required":["driver"],"type":"object"},"SystemSettings":{"additionalProperties":false,"properties":{"allow_inline_references":{"default":true,"description":"Allow reference contents in provider requests. When false, HTTP(S) URLs and model-supported asset:// references are accepted and library images are not inlined. Applies at admission and dispatch to shared and personal connections. Omission on update preserves the current value.","type":"boolean"},"central_origin":{"description":"Public release central destination; currently https://console.sociaro.ai.","format":"uri","readOnly":true,"type":"string"},"generation_ui":{"description":"Show the Generation screen; does not disable API generation.","type":"boolean"},"installation_role":{"description":"Trusted configured own public-origin role; cannot be supplied by a settings/profile request.","enum":["central","ordinary"],"readOnly":true,"type":"string"},"markup_percent":{"allOf":[{"$ref":"#/components/schemas/MarkupPercent"}],"description":"Administrator setting; omitted from public console policy. Defaults to zero. Omission on update preserves the current rate. Applies only to new shared-provider tasks."},"mode_selection_required":{"description":"An ordinary legacy hybrid or disabled row needs explicit mode selection; enables Apply for the effective choice without a startup write.","readOnly":true,"type":"boolean"},"personal_providers":{"description":"Personal mode for every role, including Administrators. Cannot be combined with shared_resources. The console changes this only through the setup scenario. Stale personal keys cannot start new work or read a personal catalogue while this is disabled; saved connections and history are preserved.","type":"boolean"},"setup_pending":{"description":"Administrator-only first-owner guide state; upgrades default false and Skip never writes settings.","readOnly":true,"type":"boolean"},"shared_resources":{"default":false,"description":"Company mode. Writes require exactly one of shared_resources/personal_providers. Legacy hybrid reads are effective company-only. Disabling blocks new shared work; accepted work and existing files remain available.","type":"boolean"},"shared_storage_limit_bytes":{"description":"Set through /v1/system/storage/quota; preserved by ordinary settings updates.","type":["integer","null"]},"version":{"description":"Send the current version when updating settings.","minimum":1,"type":"integer"}},"required":["generation_ui","version"],"type":"object"},"SystemUser":{"properties":{"created_at":{"format":"date-time","type":"string"},"email":{"type":"string"},"id":{"format":"uuid","type":"string"},"is_client_manager":{"type":"boolean"},"is_system_admin":{"type":"boolean"},"name":{"type":"string"},"picture":{"format":"uri","type":"string"},"sales_role":{"$ref":"#/components/schemas/SalesRole"}},"type":"object"},"SystemUserPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SystemUser"},"type":"array"},"has_more":{"type":"boolean"},"next_offset":{"type":"integer"}},"type":"object"},"TaskCost":{"description":"Customer responses expose gateway expected/metered/tariff amounts only (including accepted markup), plus quoted_at. Provider pricing, settlement and markup fields are returned only to administrators.","properties":{"actual_source":{"type":"string"},"actual_usd":{"description":"Confirmed paid USD charge, or confirmed free mock/failed generation. Omitted while unknown, never substituted with an estimate.","type":"number"},"billed_units":{"type":"number"},"billing_instance_id":{"type":"string"},"billing_match":{"description":"model_usage_window is an unambiguous model, time window, and usage quantity correlation, not a provider request ID match.","type":"string"},"billing_required":{"description":"Administrator-only accepted-quote snapshot; profit waits for provider bill verification when true.","type":"boolean"},"customer_expected_usd":{"description":"Expected customer price including the accepted markup; use for max_expected_cost_usd.","type":"number"},"customer_metered_usd":{"description":"Metered provider cost plus accepted markup, rounded up to a millionth of a dollar.","type":"number"},"customer_tariff_usd":{"description":"Reconciled gross provider cost plus accepted markup. Reports consumed_usd is the authoritative completed charge.","type":"number"},"estimated_units":{"type":"number"},"expected_usd":{"description":"Accepted gateway estimate for customers; original provider estimate for administrators.","type":"number"},"invoice_ids":{"items":{"type":"string"},"type":"array"},"markup_percent":{"allOf":[{"$ref":"#/components/schemas/MarkupPercent"}],"description":"Immutable accepted rate; absent on historical tasks means zero. Provider cost fields are not marked up."},"metered_usd":{"description":"Usage-based gateway cost for customers; original metered provider cost for administrators.","type":"number"},"package_units":{"description":"Units covered by a provider package; does not imply a daily quota or a free package.","type":"number"},"pricing":{"properties":{"bill_input_video":{"description":"Explicit duration-metering contract. True requires reported input and output video duration; false bills output only. Omitted on legacy snapshots, whose existing metering remains unchanged.","type":"boolean"},"checked_at":{"format":"date-time","type":"string"},"components":{"description":"Per-metric tariffs saved with the accepted task. Every component requires a reported metric before metering.","items":{"properties":{"estimated_units":{"description":"Planning quantity retained for synchronized tariff repricing.","type":"number"},"metric":{"type":"string"},"per":{"minimum":1,"type":"integer"},"price":{"type":"number"}},"required":["metric","price","per"],"type":"object"},"type":"array"},"currency":{"enum":["USD"],"type":"string"},"estimate_description":{"description":"Explanation of planning quantities and assumptions; not actual metered usage.","type":"string"},"fixed_usd":{"description":"Additional input-image charge for the accepted request.","type":"number"},"per":{"type":"integer"},"price":{"type":"number"},"region":{"type":"string"},"source":{"type":"string"},"unit":{"enum":["token","second","image","character","request","multi_metric"],"type":"string"},"version":{"type":"string"}},"required":["currency","unit","price","per","source","version","checked_at"],"type":"object"},"quantity_unknown":{"customer_expected_usd and estimated_units are omitted; unknown is not free. An explicit max_expected_usd request cannot be admitted without a provable total.":null,"description":"A verified tariff exists but quantity and total are unavailable. expected_usd","type":"boolean"},"quoted_at":{"format":"date-time","type":"string"},"reconciled_at":{"format":"date-time","type":"string"},"status":{"enum":["estimated","quantity_unknown","pending_billing","confirmed"],"type":"string"},"submitted_at":{"format":"date-time","type":"string"},"tariff_usd":{"description":"Confirmed gateway cost for customers; original reconciled provider tariff for administrators.","type":"number"},"usage_recorded_at":{"format":"date-time","type":"string"}},"required":["quoted_at"],"type":"object"},"TemplateDefinition":{"additionalProperties":false,"description":"Unpublished current content may be incomplete but creation and saves require an available image/video model with the explicit references workflow. Known fixed-media incompatibilities are rejected on save and binding. Publish and every published Save require an explicit accessible shared image/video cover and at least one reviewed reference slot, and validate every binding and the native request contract before freezing admission defaults. Availability uses the same native validation without quoting or admitting a task. No generation reference URLs are allowed in options. Audio is an optional saved preference and does not filter template models; selected targets without a configurable audio switch omit generate_audio and retain native audio behavior, which does not promise silence. Direct API validation remains strict. Output resolution is a saved preference; template-derived requests select the nearest comparable advertised target choice, or the Gateway default for unknown/incomparable labels, without relaxing input-media or direct API validation.","properties":{"cover_id":{"description":"Explicit accessible shared Template library image/video ID. Required to publish or save published content; no implicit reference fallback. May be empty while unpublished.","type":"string"},"description":{"maxLength":500,"type":"string"},"media_type":{"enum":["image","video"],"type":"string"},"model":{"type":"string"},"options":{"$ref":"#/components/schemas/MediaOptions"},"override_sound_id":{"description":"Optional shared audio asset ID. Video templates only; replaces all generated sound without video transcoding.","type":"string"},"prompt":{"maxLength":10000,"type":"string"},"provider":{"type":"string"},"reference_counts":{"additionalProperties":false,"description":"Publisher-declared ordered input counts for native workflows without prompt markers. Omitted counts use workflow minima.","properties":{"audio":{"maximum":64,"minimum":0,"type":"integer"},"image":{"maximum":64,"minimum":0,"type":"integer"},"video":{"maximum":64,"minimum":0,"type":"integer"}},"type":"object"},"slots":{"items":{"additionalProperties":false,"properties":{"asset_id":{"description":"Shared fixed asset; omitted for a user-supplied slot","type":"string"},"id":{"description":"Stable typed identity such as image:1 or video:1","type":"string"},"index":{"maximum":64,"minimum":1,"type":"integer"},"label":{"maxLength":120,"type":"string"},"role":{"type":"string"},"type":{"enum":["image","video","audio"],"type":"string"}},"required":["id","type","index","role","label"],"type":"object"},"type":"array"},"syntax":{"enum":["","numbered","picture","bracket","kling-id","ui-reference-v1"],"type":"string"},"title":{"maxLength":120,"type":"string"}},"type":"object"},"TemplateGenerationRequest":{"additionalProperties":false,"properties":{"expected_resolution":{"description":"Optional reviewed effective output resolution. Empty string binds omission; mismatch returns 409 before estimate/admission. Omitted or null retains legacy behavior.","nullable":true,"type":"string"},"inputs":{"additionalProperties":{"format":"uuid","type":"string"},"description":"Exactly the missing stable slot IDs mapped to the calling owner's completed library file IDs. Fixed slots and extra references are forbidden. External URLs and provider asset IDs are excluded.","type":"object"},"max_expected_cost_usd":{"minimum":0,"type":"number"},"model":{"type":"string"},"project_id":{"format":"uuid","type":"string"},"provider":{"type":"string"},"revision":{"description":"Current opaque generation token; a changed template requires reloading and reviewing input choices.","minimum":1,"type":"integer"}},"required":["revision","provider","model","inputs"],"type":"object"},"TemplateRecord":{"description":"One current definition and visibility. Tokens provide concurrency and stale-input protection, not a user-facing version history.","properties":{"content":{"$ref":"#/components/schemas/TemplateDefinition"},"draft":{"$ref":"#/components/schemas/TemplateDefinition","description":"Legacy alias of content; never a second editable source."},"id":{"format":"uuid","type":"string"},"is_published":{"description":"Read-only visibility state; use action to change it.","type":"boolean"},"published":{"$ref":"#/components/schemas/TemplateDefinition","description":"Legacy alias of content when visible; omitted when unpublished."},"revision":{"description":"Opaque generation token; a published Save or publish replaces it. Stale generation","estimate":null,"input validation and Advanced editing requests fail with 409.":null,"minimum":0,"type":"integer"},"updated_at":{"format":"date-time","type":"string"},"version":{"description":"Opaque edit token; send it with every update or visibility toggle.","minimum":1,"type":"integer"}},"required":["id","version","revision","content","is_published","draft","updated_at"],"type":"object"},"User":{"properties":{"color_preset":{"description":"Personal color theme ID. Empty follows the site default; unavailable IDs render the site default.","maxLength":64,"type":"string"},"contacts":{"$ref":"#/components/schemas/ContactLinks"},"email":{"type":"string"},"id":{"format":"uuid","type":"string"},"is_client_manager":{"description":"Sales-account restriction shared by all three sales ranks.","type":"boolean"},"is_system_admin":{"description":"Current administrator access for this authentication method.","type":"boolean"},"name":{"type":"string"},"picture":{"type":"string"},"report_columns":{"$ref":"#/components/schemas/ReportColumns"},"sales_role":{"$ref":"#/components/schemas/SalesRole"},"session_id":{"description":"Opaque non-credential login identifier, present for browser sessions. Used to bind temporary console key storage to this login.","type":"string"},"theme":{"default":"system","enum":["dark","light","system"],"type":"string"}},"required":["id","email","name"],"type":"object"},"VoiceChoice":{"properties":{"default_language":{"description":"A declared member of this voice's languages; Gateway control default.","type":"string"},"id":{"type":"string"},"is_default":{"default":false,"description":"Initial Gateway voice selection.","type":"boolean"},"languages":{"items":{"type":"string"},"minItems":1,"type":"array"}},"required":["id","languages","default_language"],"type":"object"},"WebhookEvent":{"properties":{"created_at":{"format":"int64","type":"integer"},"data":{"$ref":"#/components/schemas/Generation"},"id":{"type":"string"},"object":{"const":"event","type":"string"},"type":{"enum":["generation.queued","generation.in_progress","generation.completed","generation.failed"],"type":"string"}},"required":["id","object","type","created_at","data"],"type":"object"},"WeeklyLimitUSD":{"description":"Member weekly USD limit. Null means unlimited; zero blocks paid shared generation. Resets Monday at 00:00 UTC.","maximum":1000000,"minimum":0,"multipleOf":0.000001,"type":["number","null"]},"WorkspaceDeviceProof":{"additionalProperties":false,"properties":{"device_code":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true}},"required":["device_code"],"type":"object"}},"securitySchemes":{"bearerAuth":{"description":"Personal Gateway key (gw_…), or the separate deployment service key. An explicit key takes precedence over a browser session. Only Authorization Bearer is accepted. An exact stored revoked token returns HTTP 401 with code api_key_revoked. Unknown tokens, expired-only keys and membership-only denial do not establish revocation.","scheme":"bearer","type":"http"},"paymentIntegrationAuth":{"description":"Dedicated pay_ token scoped to one trusted payment integration.","scheme":"bearer","type":"http"},"sessionAuth":{"description":"HttpOnly browser session for account, provider, storage and API-key administration only. Generation, catalog, task and reference endpoints require an API key, including in the console.","in":"cookie","name":"media_gateway_session","type":"apiKey"}}},"info":{"description":"One asynchronous API for image, video, speech and music generation. Connect providers once, then access your organization through the console or your applications. Generation endpoints use OpenAI vocabulary with asynchronous Gateway extensions. All creation returns a queued job, not immediate media. All generation routes share one contract; this is not drop-in synchronous SDK compatibility. Agnes AI image and video models use the same endpoints and catalog contract; select agnes/model-name from the model catalog. Provider key checks cannot verify Agnes access because its upstream model catalog is public.","license":{"identifier":"Apache-2.0","name":"Apache-2.0"},"title":"Media Gateway API","version":"1.0.2"},"openapi":"3.1.0","paths":{"/auth/company-api/{path}":{"delete":{"description":"Requires the owning local browser session, exact saved company key and connection context; writes require the local Origin. Preserves the method, signed query and body. Central existing API roles, scopes and company membership remain authoritative. No caller-selected upstream, cookie forwarding, redirect following, automatic mutation retry or local fallback.","parameters":[{"in":"header","name":"X-Company-Context","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Central response","including its content type and disposition":null},"206":{"description":"Central ranged media response"},"401":{"description":"Login or key rejected"},"403":{"description":"Origin","owner":null,"scope or central permission denied":null},"409":{"description":"Connection context changed"},"410":{"description":"Confirmed central key revocation durably disconnected this exact saved company connection (company_connection_revoked); do not replay the request locally"},"502":{"description":"Central request unavailable"}},"summary":"Forward an existing central company DELETE request","tags":["Authentication"]},"get":{"description":"Requires the owning local browser session, exact saved company key and connection context; writes require the local Origin. Preserves the method, signed query and body. Central existing API roles, scopes and company membership remain authoritative. No caller-selected upstream, cookie forwarding, redirect following, automatic mutation retry or local fallback.","parameters":[{"in":"header","name":"X-Company-Context","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Central response","including its content type and disposition":null},"206":{"description":"Central ranged media response"},"401":{"description":"Login or key rejected"},"403":{"description":"Origin","owner":null,"scope or central permission denied":null},"409":{"description":"Connection context changed"},"410":{"description":"Confirmed central key revocation durably disconnected this exact saved company connection (company_connection_revoked); do not replay the request locally"},"502":{"description":"Central request unavailable"}},"summary":"Forward an existing central company GET request","tags":["Authentication"]},"head":{"description":"Requires the owning local browser session, exact saved company key and connection context; writes require the local Origin. Preserves the method, signed query and body. Central existing API roles, scopes and company membership remain authoritative. No caller-selected upstream, cookie forwarding, redirect following, automatic mutation retry or local fallback.","parameters":[{"in":"header","name":"X-Company-Context","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Central response","including its content type and disposition":null},"206":{"description":"Central ranged media response"},"401":{"description":"Login or key rejected"},"403":{"description":"Origin","owner":null,"scope or central permission denied":null},"409":{"description":"Connection context changed"},"410":{"description":"Confirmed central key revocation durably disconnected this exact saved company connection (company_connection_revoked); do not replay the request locally"},"502":{"description":"Central request unavailable"}},"summary":"Forward an existing central company HEAD request","tags":["Authentication"]},"parameters":[{"description":"Existing central API or media path beneath the fixed saved central origin","in":"path","name":"path","required":true,"schema":{"type":"string"}}],"patch":{"description":"Requires the owning local browser session, exact saved company key and connection context; writes require the local Origin. Preserves the method, signed query and body. Central existing API roles, scopes and company membership remain authoritative. No caller-selected upstream, cookie forwarding, redirect following, automatic mutation retry or local fallback.","parameters":[{"in":"header","name":"X-Company-Context","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Central response","including its content type and disposition":null},"206":{"description":"Central ranged media response"},"401":{"description":"Login or key rejected"},"403":{"description":"Origin","owner":null,"scope or central permission denied":null},"409":{"description":"Connection context changed"},"410":{"description":"Confirmed central key revocation durably disconnected this exact saved company connection (company_connection_revoked); do not replay the request locally"},"502":{"description":"Central request unavailable"}},"summary":"Forward an existing central company PATCH request","tags":["Authentication"]},"post":{"description":"Requires the owning local browser session, exact saved company key and connection context; writes require the local Origin. Preserves the method, signed query and body. Central existing API roles, scopes and company membership remain authoritative. No caller-selected upstream, cookie forwarding, redirect following, automatic mutation retry or local fallback.","parameters":[{"in":"header","name":"X-Company-Context","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Central response","including its content type and disposition":null},"206":{"description":"Central ranged media response"},"401":{"description":"Login or key rejected"},"403":{"description":"Origin","owner":null,"scope or central permission denied":null},"409":{"description":"Connection context changed"},"410":{"description":"Confirmed central key revocation durably disconnected this exact saved company connection (company_connection_revoked); do not replay the request locally"},"502":{"description":"Central request unavailable"}},"summary":"Forward an existing central company POST request","tags":["Authentication"]},"put":{"description":"Requires the owning local browser session, exact saved company key and connection context; writes require the local Origin. Preserves the method, signed query and body. Central existing API roles, scopes and company membership remain authoritative. No caller-selected upstream, cookie forwarding, redirect following, automatic mutation retry or local fallback.","parameters":[{"in":"header","name":"X-Company-Context","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Central response","including its content type and disposition":null},"206":{"description":"Central ranged media response"},"401":{"description":"Login or key rejected"},"403":{"description":"Origin","owner":null,"scope or central permission denied":null},"409":{"description":"Connection context changed"},"410":{"description":"Confirmed central key revocation durably disconnected this exact saved company connection (company_connection_revoked); do not replay the request locally"},"502":{"description":"Central request unavailable"}},"summary":"Forward an existing central company PUT request","tags":["Authentication"]}},"/auth/company-connection":{"get":{"description":"Local browser session only. Returns the saved ordinary central company key only to its owning local administrator, with no-store caching. Other local users cannot access this credential. Central installations do not expose this local endpoint.","responses":{"200":{"description":"Saved company connection or disconnected state"},"401":{"description":"Local browser login required"},"403":{"description":"Owner or same-origin check failed"},"404":{"description":"Local connection unavailable"},"503":{"description":"Connection lookup unavailable; do not fall back to local processing"}},"security":[],"summary":"Load the signed-in installation owner's central company connection","tags":["Authentication"]}},"/auth/company-interface/local/begin":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Start or recover this exact browser attempt; setup/upgrade/rebind additionally require a verified local administrator. Additional-user login uses the durable installation grant. Local browser cookie is an opaque HttpOnly context, not a central credential. Exact configured frontend Origin and CSRF checks required. Central destination, proof, current grant and revision come only from trusted server storage. No browser may post a reconciliation result or central actor. Begin and Poll require complete local and central capabilities before connection writes; Cancel retains exact uncertain proof and may reconcile without full capabilities.","operationId":"localCompanyInterfaceBegin","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"consent":{"const":true,"type":"boolean"},"mode":{"enum":["connect","login","legacy-upgrade","rebind"],"type":"string"}},"required":["mode","consent"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Nonsecret attempt_id/user_code/state/expires_at/central_origin"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Start or recover this exact browser attempt; setup/upgrade/rebind additionally require a verified local administrator. Additional-user login uses the durable installation grant."}},"/auth/company-interface/local/cancel":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Quarantine local pending proof first. Obtain typed central confirmation; preserve permanent grant custody before settling an approved cancelled family. Unknown/conflicting outcomes retain proof. Local browser cookie is an opaque HttpOnly context, not a central credential. Exact configured frontend Origin and CSRF checks required. Central destination, proof, current grant and revision come only from trusted server storage. No browser may post a reconciliation result or central actor. Begin and Poll require complete local and central capabilities before connection writes; Cancel retains exact uncertain proof and may reconcile without full capabilities.","operationId":"localCompanyInterfaceCancel","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"attempt_id":{"format":"uuid","type":"string"}},"required":["attempt_id"],"type":"object"}}},"required":true},"responses":{"200":{"description":"cancelled state after confirmed exact cleanup"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Quarantine local pending proof first. Obtain typed central confirmation; preserve permanent grant custody before settling an approved cancelled family. Unknown/conflicting outcomes retain proof."}},"/auth/company-interface/local/customer/{path}":{"delete":{"description":"Complete local and central surface capabilities are required before refresh or dispatch. Browser Cookie/Origin/Referer/Sec-Fetch presence selects the verified per-user session requirement; malformed browser signals cannot fall back to SDK. SDK keys are validated centrally and never against local key records. Exact method/path/query/body contracts, fixed HTTPS central destination, no redirects or uncertain mutation retries, no local-data fallback. Local/global actor/family/version/revision fences apply before request intake and after response body. Current bounded management/project adapter is not ordinary external /v1 activation or complete streaming/media parity; 8192-byte management requests, 16384-byte template input requests, 65536-byte generation/reference-validation JSON, and 8388608-byte buffered responses. Multipart and signed media transport remain pending. Template validate-media and reference validation preserve their central 150-second inspection budget across both hops; ordinary requests retain 15 seconds. These bounded contracts do not advertise the full surface.","operationId":"localCompanyCustomerDelete","responses":{"200":{"description":"Existing central response after local body fence"},"201":{"description":"Existing central creation result"},"204":{"description":"Existing central mutation completed"},"403":{"description":"Browser","key or exact route contract rejected":null,"tenant":null},"409":{"description":"Complete capability unavailable or context changed"},"503":{"description":"Uncertain remote result retained; no mutation redispatch"}},"security":[],"summary":"Reserved fixed-central company facade"},"get":{"description":"Complete local and central surface capabilities are required before refresh or dispatch. Browser Cookie/Origin/Referer/Sec-Fetch presence selects the verified per-user session requirement; malformed browser signals cannot fall back to SDK. SDK keys are validated centrally and never against local key records. Exact method/path/query/body contracts, fixed HTTPS central destination, no redirects or uncertain mutation retries, no local-data fallback. Local/global actor/family/version/revision fences apply before request intake and after response body. Current bounded management/project adapter is not ordinary external /v1 activation or complete streaming/media parity; 8192-byte management requests, 16384-byte template input requests, 65536-byte generation/reference-validation JSON, and 8388608-byte buffered responses. Multipart and signed media transport remain pending. Template validate-media and reference validation preserve their central 150-second inspection budget across both hops; ordinary requests retain 15 seconds. Media preparations/resources and official presets retain generation-key recipient authority and original central role/object checks; preset import accepts 32768 bytes and ordinary provider asset operations retain a 45-second bound. Provider-wide asset inventory/import remains denied, including groups?inventory=1; ordinary asset detach=1 is supported. Resource admission status_url is mapped to the reserved local route; Location is validated only when central supplies it, without inventing a header. These bounded contracts do not advertise the full surface.","operationId":"localCompanyCustomerGet","responses":{"200":{"description":"Existing central response after local body fence"},"201":{"description":"Existing central creation result"},"204":{"description":"Existing central mutation completed"},"403":{"description":"Browser","key or exact route contract rejected":null,"tenant":null},"409":{"description":"Complete capability unavailable or context changed"},"503":{"description":"Uncertain remote result retained; no mutation redispatch"}},"security":[],"summary":"Reserved fixed-central company facade"},"head":{"description":"Complete local and central surface capabilities are required before refresh or dispatch. Browser Cookie/Origin/Referer/Sec-Fetch presence selects the verified per-user session requirement; malformed browser signals cannot fall back to SDK. SDK keys are validated centrally and never against local key records. Exact method/path/query/body contracts, fixed HTTPS central destination, no redirects or uncertain mutation retries, no local-data fallback. Local/global actor/family/version/revision fences apply before request intake and after response body. Current bounded management/project adapter is not ordinary external /v1 activation or complete streaming/media parity; 8192-byte management requests, 16384-byte template input requests, 65536-byte generation/reference-validation JSON, and 8388608-byte buffered responses. Multipart and signed media transport remain pending. Template validate-media and reference validation preserve their central 150-second inspection budget across both hops; ordinary requests retain 15 seconds. These bounded contracts do not advertise the full surface.","operationId":"localCompanyCustomerHead","responses":{"200":{"description":"Existing central response after local body fence"},"201":{"description":"Existing central creation result"},"204":{"description":"Existing central mutation completed"},"403":{"description":"Browser","key or exact route contract rejected":null,"tenant":null},"409":{"description":"Complete capability unavailable or context changed"},"503":{"description":"Uncertain remote result retained; no mutation redispatch"}},"security":[],"summary":"Reserved fixed-central company facade"},"parameters":[{"description":"Exact existing customer route; no arbitrary destination or broad prefix authority.","in":"path","name":"path","required":true,"schema":{"type":"string"}}],"patch":{"description":"Complete local and central surface capabilities are required before refresh or dispatch. Browser Cookie/Origin/Referer/Sec-Fetch presence selects the verified per-user session requirement; malformed browser signals cannot fall back to SDK. SDK keys are validated centrally and never against local key records. Exact method/path/query/body contracts, fixed HTTPS central destination, no redirects or uncertain mutation retries, no local-data fallback. Local/global actor/family/version/revision fences apply before request intake and after response body. Current bounded management/project adapter is not ordinary external /v1 activation or complete streaming/media parity; 8192-byte management requests, 16384-byte template input requests, 65536-byte generation/reference-validation JSON, and 8388608-byte buffered responses. Multipart and signed media transport remain pending. Template validate-media and reference validation preserve their central 150-second inspection budget across both hops; ordinary requests retain 15 seconds. These bounded contracts do not advertise the full surface.","operationId":"localCompanyCustomerPatch","responses":{"200":{"description":"Existing central response after local body fence"},"201":{"description":"Existing central creation result"},"204":{"description":"Existing central mutation completed"},"403":{"description":"Browser","key or exact route contract rejected":null,"tenant":null},"409":{"description":"Complete capability unavailable or context changed"},"503":{"description":"Uncertain remote result retained; no mutation redispatch"}},"security":[],"summary":"Reserved fixed-central company facade"},"post":{"description":"Complete local and central surface capabilities are required before refresh or dispatch. Browser Cookie/Origin/Referer/Sec-Fetch presence selects the verified per-user session requirement; malformed browser signals cannot fall back to SDK. SDK keys are validated centrally and never against local key records. Exact method/path/query/body contracts, fixed HTTPS central destination, no redirects or uncertain mutation retries, no local-data fallback. Local/global actor/family/version/revision fences apply before request intake and after response body. Current bounded management/project adapter is not ordinary external /v1 activation or complete streaming/media parity; 8192-byte management requests, 16384-byte template input requests, 65536-byte generation/reference-validation JSON, and 8388608-byte buffered responses. Multipart and signed media transport remain pending. Template validate-media and reference validation preserve their central 150-second inspection budget across both hops; ordinary requests retain 15 seconds. These bounded contracts do not advertise the full surface.","operationId":"localCompanyCustomerPost","responses":{"200":{"description":"Existing central response after local body fence"},"201":{"description":"Existing central creation result"},"204":{"description":"Existing central mutation completed"},"403":{"description":"Browser","key or exact route contract rejected":null,"tenant":null},"409":{"description":"Complete capability unavailable or context changed"},"503":{"description":"Uncertain remote result retained; no mutation redispatch"}},"security":[],"summary":"Reserved fixed-central company facade"},"put":{"description":"Complete local and central surface capabilities are required before refresh or dispatch. Browser Cookie/Origin/Referer/Sec-Fetch presence selects the verified per-user session requirement; malformed browser signals cannot fall back to SDK. SDK keys are validated centrally and never against local key records. Exact method/path/query/body contracts, fixed HTTPS central destination, no redirects or uncertain mutation retries, no local-data fallback. Local/global actor/family/version/revision fences apply before request intake and after response body. Current bounded management/project adapter is not ordinary external /v1 activation or complete streaming/media parity; 8192-byte management requests, 16384-byte template input requests, 65536-byte generation/reference-validation JSON, and 8388608-byte buffered responses. Multipart and signed media transport remain pending. Template validate-media and reference validation preserve their central 150-second inspection budget across both hops; ordinary requests retain 15 seconds. These bounded contracts do not advertise the full surface.","operationId":"localCompanyCustomerPut","responses":{"200":{"description":"Existing central response after local body fence"},"201":{"description":"Existing central creation result"},"204":{"description":"Existing central mutation completed"},"403":{"description":"Browser","key or exact route contract rejected":null,"tenant":null},"409":{"description":"Complete capability unavailable or context changed"},"503":{"description":"Uncertain remote result retained; no mutation redispatch"}},"security":[],"summary":"Reserved fixed-central company facade"}},"/auth/company-interface/local/logout":{"post":{"description":"Exact configured Origin and opaque HttpOnly local browser context required; central credentials never reach the browser. Strict JSON; 15-second total request budget. Persist immutable operation before remote I/O. Lost replies/restart retain the same operation and proof. Logout invalidates its context first and cannot clear or activate a successor context. No full-company mode activation.","operationId":"localCompanyInterfaceLogout","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"context_epoch":{"minimum":1,"type":"integer"}},"required":["context_epoch"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Secret-free context state"},"403":{"description":"Browser context or origin rejected"},"409":{"description":"Exact context/version conflict"},"503":{"description":"Unknown remote outcome; retain operation"}},"security":[],"summary":"Invalidate local context and reconcile exact original family cleanup"}},"/auth/company-interface/local/poll":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Redeem only the stored matching attempt, then activate its user context with exact local epoch/revision CAS. Local browser cookie is an opaque HttpOnly context, not a central credential. Exact configured frontend Origin and CSRF checks required. Central destination, proof, current grant and revision come only from trusted server storage. No browser may post a reconciliation result or central actor. Begin and Poll require complete local and central capabilities before connection writes; Cancel retains exact uncertain proof and may reconcile without full capabilities.","operationId":"localCompanyInterfacePoll","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"attempt_id":{"format":"uuid","type":"string"}},"required":["attempt_id"],"type":"object"}}},"required":true},"responses":{"200":{"description":"authorized state; does not enable full portal mode"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Redeem only the stored matching attempt, then activate its user context with exact local epoch/revision CAS."}},"/auth/company-interface/local/refresh":{"post":{"description":"Exact configured Origin and opaque HttpOnly local browser context required; central credentials never reach the browser. Strict JSON; 15-second total request budget. Persist immutable operation before remote I/O. Lost replies/restart retain the same operation and proof. Logout invalidates its context first and cannot clear or activate a successor context. No full-company mode activation.","operationId":"localCompanyInterfaceRefresh","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"context_epoch":{"minimum":1,"type":"integer"},"token_version":{"minimum":1,"type":"integer"}},"required":["context_epoch","token_version"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Secret-free context state"},"403":{"description":"Browser context or origin rejected"},"409":{"description":"Exact context/version conflict"},"503":{"description":"Unknown remote outcome; retain operation"}},"security":[],"summary":"Rotate with persistent exact operation and local CAS"}},"/auth/company-interface/local/session":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Create or reuse the separate opaque browser context before Begin. Local browser cookie is an opaque HttpOnly context, not a central credential. Exact configured frontend Origin and CSRF checks required. Central destination, proof, current grant and revision come only from trusted server storage. No browser may post a reconciliation result or central actor. Begin and Poll require complete local and central capabilities before connection writes; Cancel retains exact uncertain proof and may reconcile without full capabilities.","operationId":"localCompanyInterfaceSession","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{},"type":"object"}}},"required":true},"responses":{"200":{"description":"ready boolean; opaque HttpOnly/Secure-on-HTTPS SameSite=Lax cookie"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Create or reuse the separate opaque browser context before Begin."}},"/auth/company-interface/v1/cancel":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Cancel only this pending attempt; an approved outcome requires reconciliation. Backend-to-backend only at the trusted configured central destination; browser Origin/Cookie/Referer/Sec-Fetch headers and bearer/API-key headers are rejected. Proofs/credentials travel only in the HTTPS request body, never in URLs or logs. Installation authentication never supplies user identity. No automatic mutation retry; reuse the exact persisted operation after an uncertain reply.","operationId":"companyInterfaceCancel","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyInterfaceRedemption"}}},"required":true},"responses":{"200":{"description":"cancelled boolean"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Cancel only this pending attempt; an approved outcome requires reconciliation."}},"/auth/company-interface/v1/capabilities":{"get":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Returns only implemented capabilities; HEAD has the same read semantics and no response body.","operationId":"companyInterfaceCapabilities","responses":{"200":{"description":"Protocol purpose, version and implemented capabilities; no full surface advertised yet"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Returns only implemented capabilities; HEAD has the same read semantics and no response body."}},"/auth/company-interface/v1/customer-browser/{path}":{"delete":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customerbrowserDelete","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"},"get":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customerbrowserGet","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"},"head":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customerbrowserHead","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"},"parameters":[{"description":"Exact inner route; only the implemented typed company contract is admitted.","in":"path","name":"path","required":true,"schema":{"type":"string"}}],"patch":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customerbrowserPatch","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"},"post":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customerbrowserPost","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"},"put":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customerbrowserPut","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"}},"/auth/company-interface/v1/customer-sdk/{path}":{"delete":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customersdkDelete","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"},"get":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customersdkGet","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"},"head":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customersdkHead","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"},"parameters":[{"description":"Exact inner route; only the implemented typed company contract is admitted.","in":"path","name":"path","required":true,"schema":{"type":"string"}}],"patch":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customersdkPatch","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"},"post":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customersdkPost","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"},"put":{"description":"Reserved server-to-server customer adapter. Installation grant and stored approved frontend origin are required. Browser entry requires separately verified central session and local-context binding; management uses that session actor, generation uses the independently verified original key recipient. SDK entry requires the original central key. Invalid explicit keys never fall back. Original central middleware and object/role checks remain authoritative under one-company ceiling. Browser cookies, Origin, Referer and Sec-Fetch are rejected. Exact method/path/query/body allowlist; 8192-byte management request and 16384-byte template input limits, with 8388608-byte buffered responses; template validate-media preserves its 150-second inspection deadline, while ordinary requests retain 15 seconds including body read. Authority rechecked after body before release. No credentials in URLs and no capability or full-mode activation. Local portal/SDK forwarding and streaming media remain unavailable.","operationId":"customersdkPut","responses":{"200":{"description":"Existing central handler response under the company ceiling"},"403":{"description":"Exact contract or separately verified authority rejected"},"409":{"description":"Authority changed before body release"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unavailable or response budget exceeded"}},"security":[],"summary":"Reserved bounded central company adapter"}},"/auth/company-interface/v1/logout":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Revoke only the verified delegated family; preserve permanent grant, independent SDK keys and unrelated central browser sessions. Backend-to-backend only at the trusted configured central destination; browser Origin/Cookie/Referer/Sec-Fetch headers and bearer/API-key headers are rejected. Proofs/credentials travel only in the HTTPS request body, never in URLs or logs. Installation authentication never supplies user identity. No automatic mutation retry; reuse the exact persisted operation after an uncertain reply.","operationId":"companyInterfaceLogout","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyInterfaceLogout"}}},"required":true},"responses":{"200":{"description":"logged_out boolean"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Revoke only the verified delegated family; preserve permanent grant, independent SDK keys and unrelated central browser sessions."}},"/auth/company-interface/v1/reconcile":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Read exact proof-bound operation state and distinguish family revocation from permanent-grant revocation. Backend-to-backend only at the trusted configured central destination; browser Origin/Cookie/Referer/Sec-Fetch headers and bearer/API-key headers are rejected. Proofs/credentials travel only in the HTTPS request body, never in URLs or logs. Installation authentication never supplies user identity. No automatic mutation retry; reuse the exact persisted operation after an uncertain reply.","operationId":"companyInterfaceReconcile","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyInterfaceRedemption"}}},"required":true},"responses":{"200":{"description":"Server-private binding/fingerprint and state; no user/session/key secrets"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Read exact proof-bound operation state and distinguish family revocation from permanent-grant revocation."}},"/auth/company-interface/v1/recover-installation":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Recover only the permanent installation credential under the original proof; never activate a user. Backend-to-backend only at the trusted configured central destination; browser Origin/Cookie/Referer/Sec-Fetch headers and bearer/API-key headers are rejected. Proofs/credentials travel only in the HTTPS request body, never in URLs or logs. Installation authentication never supplies user identity. No automatic mutation retry; reuse the exact persisted operation after an uncertain reply.","operationId":"companyInterfaceRecoverInstallation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyInterfaceRedemption"}}},"required":true},"responses":{"200":{"description":"Server-private installation credential and immutable binding"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Recover only the permanent installation credential under the original proof; never activate a user."}},"/auth/company-interface/v1/redeem":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Recover the exact committed redemption operation, including after a lost reply. Backend-to-backend only at the trusted configured central destination; browser Origin/Cookie/Referer/Sec-Fetch headers and bearer/API-key headers are rejected. Proofs/credentials travel only in the HTTPS request body, never in URLs or logs. Installation authentication never supplies user identity. No automatic mutation retry; reuse the exact persisted operation after an uncertain reply.","operationId":"companyInterfaceRedeem","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyInterfaceRedemption"}}},"required":true},"responses":{"200":{"description":"Server-private encrypted-local-storage tokens; never a browser response"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Recover the exact committed redemption operation, including after a lost reply."}},"/auth/company-interface/v1/refresh":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Rotate one verified family version; same operation recovers the exact committed result, different stale operations conflict without revoking a healthy family. Backend-to-backend only at the trusted configured central destination; browser Origin/Cookie/Referer/Sec-Fetch headers and bearer/API-key headers are rejected. Proofs/credentials travel only in the HTTPS request body, never in URLs or logs. Installation authentication never supplies user identity. No automatic mutation retry; reuse the exact persisted operation after an uncertain reply.","operationId":"companyInterfaceRefresh","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyInterfaceRefresh"}}},"required":true},"responses":{"200":{"description":"Server-private replacement access/refresh tokens"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Rotate one verified family version; same operation recovers the exact committed result, different stale operations conflict without revoking a healthy family."}},"/auth/company-interface/v1/revoke-family":{"post":{"description":"Server-to-server only. Requires original installation credential and high-entropy refresh proof. Old-version proof matches the exact committed operation, family, origin and local context within its fixed recovery deadline. Hash alone is never authority. No credential issuance; permanent grant and other families/keys remain unchanged. Strict 32768-byte JSON and 15-second budget.","operationId":"companyInterfaceRevokeFamilyProof","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyInterfaceRefresh"}}},"required":true},"responses":{"200":{"description":"Exact typed terminal acknowledgement","no user credentials":null},"403":{"description":"Proof or binding rejected"},"409":{"description":"Conflicting operation"},"503":{"description":"Unknown result; retain original proof"}},"security":[],"summary":"Terminal cleanup using current or exact committed rotation proof"}},"/auth/company-interface/v1/revoke-issued-family":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Terminally revoke only the exact original approved attempt’s issued family within its finite seven-day recovery window. Requires matching installation/device/local-browser proofs, stored origin and revision; does not require live user access or membership. Does not revoke the permanent grant, a successor family or independent keys, and returns no renewed user authority. Backend-to-backend only at the trusted configured central destination; browser Origin/Cookie/Referer/Sec-Fetch headers and bearer/API-key headers are rejected. Proofs/credentials travel only in the HTTPS request body, never in URLs or logs. Installation authentication never supplies user identity. No automatic mutation retry; reuse the exact persisted operation after an uncertain reply.","operationId":"companyInterfaceRevokeIssuedFamily","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyInterfaceRedemption"}}},"required":true},"responses":{"200":{"description":"revoked boolean; exact replay does not advance the terminal epoch"},"403":{"description":"Proof, exact binding or finite recovery window rejected"},"409":{"description":"Exact operation conflict; retain proof"},"429":{"description":"Rate limit; Retry-After 60"},"503":{"description":"Unknown cleanup outcome; retain proof and retry the exact operation"}},"security":[],"summary":"Revoke only an uncertain attempt’s issued family"}},"/auth/company-interface/v1/start":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Start or recover the exact pending approval attempt. Backend-to-backend only at the trusted configured central destination; browser Origin/Cookie/Referer/Sec-Fetch headers and bearer/API-key headers are rejected. Proofs/credentials travel only in the HTTPS request body, never in URLs or logs. Installation authentication never supplies user identity. No automatic mutation retry; reuse the exact persisted operation after an uncertain reply.","operationId":"companyInterfaceStart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyInterfaceStart"}}},"required":true},"responses":{"200":{"description":"ID, Code, State and ExpiresAt; no credential"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Start or recover the exact pending approval attempt."}},"/auth/email/{action}":{"post":{"description":"JSON-only browser endpoint protected against cross-origin mutations. Register and forgot take email and optionally invitation_token. Both return a generic 202 and require configured email delivery. Verify exchanges its one-time token for a restricted HttpOnly registration cookie. Registration checks that cookie; complete sets a 15–128 character password and creates the account and normal session. Reset takes its one-time token and a new password. Verification expires in 1 hour; registration grants and reset in 30 minutes. Login takes email and password and sets an HttpOnly session cookie. Reset invalidates browser sessions and reset links, but not API keys. Email verification/reset tokens are delivered in URL fragments, submitted in JSON and never returned by this API. The optional invitation_token is encrypted in the challenge and restored only after proof of mailbox ownership through verify, registration, complete or reset responses. Registration grants cannot be substituted by JSON tokens. Invitation acceptance remains a separate authenticated action. Email-only registrations do not gain organization membership.","operationId":"post_auth_email","parameters":[{"in":"path","name":"action","required":true,"schema":{"enum":["register","login","forgot","verify","registration","complete","reset"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"email":{"format":"email","maxLength":254,"type":"string"},"invitation_token":{"description":"Optional organization invitation capability, accepted only by register/forgot. Restored after email ownership is verified; never accepted automatically.","maxLength":43,"minLength":43,"type":"string"},"password":{"format":"password","maxLength":128,"type":"string"},"token":{"maxLength":43,"minLength":43,"type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"description":"Verified, reset or signed in. Verification/reset also returns the email."},"202":{"description":"Generic registration or recovery response; does not reveal account existence."},"400":{"description":"Invalid input, expired or already used link."},"401":{"description":"Incorrect email or password, or unverified address."},"403":{"description":"Cross-origin request rejected."},"415":{"description":"JSON content type required."},"429":{"description":"Too many attempts; Retry-After header supplied."},"503":{"description":"Delivery not configured, delivery failed, or authentication temporarily unavailable."}},"security":[],"summary":"Register, verify, sign in or recover an email account","tags":["Account"]}},"/auth/google":{"get":{"description":"Browser redirect to Google. Used to establish a console session and bootstrap the first key; no key required. Only registered when Google OAuth is configured.","operationId":"get_auth_google","responses":{"302":{"description":"Browser redirect"},"503":{"description":"Authentication unavailable"}},"security":[],"summary":"Start Google sign-in","tags":["Account"]}},"/auth/google/callback":{"get":{"description":"Browser callback with a one-time code and state. Validates identity, establishes an HttpOnly session and redirects to UI_PUBLIC_URL/. Only registered when Google OAuth is configured.","operationId":"get_auth_google_callback","parameters":[{"description":"Supplied by Google; do not construct manually.","in":"query","name":"code","schema":{"type":"string"}},{"description":"Supplied by Google; do not construct manually.","in":"query","name":"state","schema":{"type":"string"}},{"description":"Supplied by Google; do not construct manually.","in":"query","name":"error","schema":{"type":"string"}}],"responses":{"302":{"description":"Browser redirect"},"503":{"description":"Authentication unavailable"}},"security":[],"summary":"Complete Google sign-in","tags":["Account"]}},"/auth/logout":{"post":{"description":"Clears and invalidates the current session. Does not revoke personal API keys. Registered when browser authentication is configured.","operationId":"post_auth_logout","responses":{"204":{"description":"Signed out; empty response body"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[],"summary":"Sign out of the browser","tags":["Account"]}},"/auth/methods":{"get":{"operationId":"get_auth_methods","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"email":{"description":"Browser email sign-in is enabled","supported and has ready local delivery configuration. A false value does not revoke sessions or disable the configured password API endpoint.":null,"type":"boolean"},"email_confirmation":{"description":"Email authentication is enabled and supported; existing verification grants do not require current delivery availability.","type":"boolean"},"email_delivery":{"description":"Local delivery configuration is usable; no provider health probe is performed.","type":"boolean"},"google":{"type":"boolean"},"setup_required":{"description":"Fresh installation requires its one-time owner setup before ordinary sign-in. No setup code is exposed.","type":"boolean"}},"type":"object"}}},"description":"Availability only; never exposes email credentials."}},"security":[],"summary":"Available browser sign-in methods","tags":["Account"]}},"/auth/monitoring":{"get":{"description":"Cookie-only preflight for Grafana. Requires an active browser session and a current system Administrator role. API keys and caller-supplied identity headers cannot grant access. Browser authentication disabled is denied. The UI proxy uses the returned internal user ID only after a successful check; this header is not a reusable credential.","operationId":"get_monitoring_session","responses":{"204":{"description":"Current Administrator browser session","headers":{"X-WEBAUTH-USER":{"description":"Verified internal user ID for the private Grafana auth proxy","schema":{"type":"string"}}}},"401":{"description":"Browser sign-in required"},"403":{"description":"Administrator access required"},"503":{"description":"Administrator role could not be verified"}},"security":[{"sessionAuth":[]}],"summary":"Authorize the monitoring UI proxy","tags":["Account"]}},"/auth/session":{"get":{"description":"Cookie-only preflight for the UI file server. API keys do not establish browser sessions. Returns 204 when browser authentication is disabled.","operationId":"get_browser_session","responses":{"204":{"description":"Valid session or browser authentication disabled"},"401":{"description":"Browser sign-in required"}},"security":[],"summary":"Check browser session for frontend delivery","tags":["Account"]}},"/auth/setup":{"post":{"description":"JSON-only, cross-origin-protected initial setup. Requires the installation code obtained through trusted gateway admin setup-code. Only a fresh installation without users can be claimed. User, Administrator role, password, session and consumed setup code commit atomically. Email delivery is not required. Upgrades with existing users keep setup closed.","operationId":"post_auth_setup","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"code":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"email":{"format":"email","maxLength":254,"type":"string"},"name":{"maxLength":100,"minLength":1,"type":"string"},"password":{"maxLength":128,"minLength":15,"type":"string","writeOnly":true}},"required":["code","name","email","password"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"}},"type":"object"}}},"description":"Owner created and signed in through a Secure HttpOnly SameSite=Lax session cookie on HTTPS."},"400":{"description":"Invalid setup fields"},"403":{"description":"Invalid code or cross-origin request"},"409":{"description":"Initial setup unavailable or already completed"},"415":{"description":"JSON content type required"},"429":{"description":"Too many setup attempts"},"503":{"description":"Setup temporarily unavailable"}},"security":[],"summary":"Create the first installation owner and browser session","tags":["Account"]}},"/auth/workspace/cancel":{"post":{"description":"Requires the high-entropy device secret. Cancellation and issuance serialize; an issued key is revoked and transient ciphertext cleared even after the short authorization request expired. Expiry still forbids consent and token redemption. Repeating confirmed cancellation is safe. Does not remove a company, credit, jobs or files. Cancellation remains available when host onboarding is disabled.","operationId":"cancelInstallationAuthorization","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDeviceProof"}}},"required":true},"responses":{"200":{"description":"Cancelled"},"410":{"description":"Authorization expired or missing"}},"security":[],"summary":"Cancel a device request and revoke any key it issued"}},"/auth/workspace/poll":{"post":{"description":"Only the holder of the random device secret can redeem. Rechecks host policy, company Supermanager membership and account role. Issues one company-bound shared key using existing API-key limits. Legacy generation-v1 intent retains generation-only scope and 30-day expiry. Explicit company-api-v1 intent issues generation, organizations:manage and keys:manage with null expiry. Repeated replies return the same encrypted credential until authorization expiry. No system, provider-management or global-storage authority is granted. Slow polling returns Retry-After.","operationId":"pollInstallationAuthorization","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDeviceProof"}}},"required":true},"responses":{"200":{"description":"Backend-only token, organization_id, key_id, provisioning (dedicated or legacy) and installation_id (proof digest); the ordinary company key is available only to the connecting local account through its authenticated bootstrap."},"403":{"description":"Host policy or membership no longer permits issuance"},"410":{"cancelled or revoked authorization":null,"denied":null,"description":"Expired"},"428":{"description":"Browser authorization pending"},"429":{"description":"Slow down or rate limit"}},"security":[],"summary":"Redeem browser consent using the installation device secret"}},"/auth/workspace/start":{"post":{"description":"Requires the trusted configured canonical central installation role; legacy onboarding/resource flags cannot confer hosting on ordinary installations or disable central hosting. The installation backend persists a separate random 32-byte installation_proof across requests/renewal/reconnect and generates a temporary random device_code; neither enters a browser or URL. Proof digests bind one authenticated customer and one dedicated new company. Starts are idempotent for the same device code, proof and metadata. Rate limited. No identity, company, key or credit is created here. This bounded protocol is not an OAuth compatibility claim.","operationId":"startInstallationAuthorization","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"access":{"default":"generation-v1","description":"Immutable consent intent. Company API access requires explicit matching browser approval.","enum":["generation-v1","company-api-v1"],"type":"string"},"client_name":{"maxLength":80,"minLength":1,"type":"string"},"client_origin":{"description":"Display-only installation origin, including private HTTP origins; never a callback destination.","format":"uri","maxLength":300,"type":"string"},"device_code":{"maxLength":43,"minLength":43,"type":"string","writeOnly":true},"installation_proof":{"description":"Durable backend-only random installation identity proof.","maxLength":43,"minLength":43,"type":"string","writeOnly":true},"replace_key_id":{"description":"Optional prior installation key; replacement still requires explicit consent by its owner.","format":"uuid","type":"string"}},"required":["device_code","installation_proof","client_name","client_origin"],"type":"object"}}},"required":true},"responses":{"200":{"description":"user_code, expires_at (10 minutes) and polling interval (5 seconds). No customer credential."},"403":{"description":"Host onboarding or shared resources disabled"},"429":{"description":"Start rate limit"}},"security":[],"summary":"Start an explicit device-style installation request"}},"/healthz":{"get":{"description":"Public readiness check for PostgreSQL and Redis. Does not verify provider credentials or model availability.","operationId":"get_healthz","responses":{"200":{"content":{"application/json":{"example":{"status":"ok"},"schema":{"$ref":"#/components/schemas/Health"}}},"description":"Dependencies are healthy"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}},"description":"A dependency is unhealthy"}},"security":[],"summary":"Check PostgreSQL and Redis health","tags":["System"]}},"/legal/{kind}":{"get":{"operationId":"get_legal_kind","parameters":[{"in":"path","name":"kind","required":true,"schema":{"enum":["privacy","terms"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"text":{"type":"string"}},"required":["text"],"type":"object"}}},"description":"Empty text selects the bundled frontend template. Never render text as HTML."},"404":{"description":"Unknown document"},"503":{"description":"Document storage unavailable"}},"security":[],"summary":"Read a public plain-text legal document override"}},"/media/{id}":{"get":{"description":"Use the exact signed URL returned by media-access, without a Gateway key. Signature and expiry are required. Do not construct signatures in clients. Supports HEAD, Range and download=1.","operationId":"get_media_id","responses":{"200":{"content":{"audio/*":{"schema":{"format":"binary","type":"string"}},"image/*":{"schema":{"format":"binary","type":"string"}},"video/*":{"schema":{"format":"binary","type":"string"}}},"description":"Complete media object"},"206":{"description":"HTTP Range response"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid or expired URL"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[],"summary":"Access media through a temporary signed URL","tags":["Media"]},"head":{"description":"Use the exact signed URL returned by media-access, without a Gateway key. Signature and expiry are required. Do not construct signatures in clients. Supports HEAD, Range and download=1.","operationId":"head_media_id","responses":{"200":{"description":"Media headers"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"403":{"description":"Invalid or expired URL"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[],"summary":"Read signed media headers","tags":["Media"]},"parameters":[{"$ref":"#/components/parameters/TaskID"},{"description":"Expiry as a Unix timestamp","in":"query","name":"expires","required":true,"schema":{"format":"int64","type":"integer"}},{"in":"query","name":"signature","required":true,"schema":{"type":"string"}},{"in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}]},"/provider-assets/{owner}/{providerId}/icon.png":{"get":{"description":"Authenticated PNG read under the provider's existing visibility and resource scope. Private no-store, nosniff and sandbox headers. Legacy embedded PNG/SVG routes return 404. In dark theme render unchanged; in light theme set RGB to black while preserving alpha.","parameters":[{"in":"path","name":"owner","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"providerId","required":true,"schema":{"type":"string"}},{"description":"Content digest for cache refresh","in":"query","name":"v","schema":{"type":"string"}},{"description":"Current commercial model/pricing grant is independently checked for scoped administrative pickers","in":"query","name":"organization","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"image/png":{"schema":{"format":"binary","type":"string"}}},"description":"Original validated PNG bytes"},"401":{"description":"Authentication required"},"403":{"description":"Required API-key scope is absent"},"404":{"description":"Logo missing or not visible to this reader"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read an uploaded provider logo","tags":["Providers admin"]}},"/references/{owner}/{id}":{"get":{"description":"Use the URL returned by the library API; do not construct signatures. Possession grants read access until file deletion or MEDIA_URL_SIGNING_SECRET rotation. No session or bucket credentials are required. Supports HTTP ranges. Convert the relative URL to an absolute URL against this Gateway's public origin before passing it in image or input_reference.","operationId":"get_references_owner_id","responses":{"200":{"content":{"image/gif":{"schema":{"format":"binary","type":"string"}},"image/jpeg":{"schema":{"format":"binary","type":"string"}},"image/png":{"schema":{"format":"binary","type":"string"}},"image/webp":{"schema":{"format":"binary","type":"string"}}},"description":"Image bytes"},"206":{"description":"Requested byte range"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[],"summary":"Fetch a reference file using its capability URL","tags":["References"]},"head":{"operationId":"head_references_owner_id","responses":{"200":{"description":"Image headers without a response body"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[],"summary":"Inspect reference file headers","tags":["References"]},"parameters":[{"in":"path","name":"owner","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"signature","required":true,"schema":{"type":"string"}}]},"/site.json":{"get":{"description":"Public metadata used by independently served frontends. installation_role is central or ordinary, derived only from the configured UI public origin (AUTH_PUBLIC_URL fallback). central_origin is the public release destination https://console.sociaro.ai. Request Host/forwarded headers do not assign role. Assets include MIME metadata; download image bytes from /branding/assets/{asset}.","operationId":"get_site_configuration","responses":{"200":{"description":"API, UI and documentation origins, installation_role, central_origin and branding settings. Empty display origins use the current origin; missing trusted own identity never grants central role."}},"security":[],"summary":"Read public site origins and appearance","tags":["Account"]}},"/template-media/{asset}":{"get":{"operationId":"readPublishedTemplateMedia","parameters":[{"in":"query","name":"signature","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Sandboxed media; capability remains valid for queued/history inputs after unpublish"},"307":{"description":"Short-lived direct storage delivery"},"404":{"description":"Missing","invalid or never-published capability":null}},"security":[],"summary":"Read a deliberately published template media capability","tags":["Templates"]},"parameters":[{"in":"path","name":"asset","required":true,"schema":{"format":"uuid","type":"string"}}]},"/v1/admin/providers":{"get":{"description":" Requires providers:manage on personal keys, or a console session. Available when provider administration is configured.","operationId":"get_v1_admin_providers","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AdminProvider"},"type":"array"}},"required":["data"],"type":"object"}}},"description":"Administrative provider catalog"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List every supported provider and its administrative state","tags":["Providers admin"],"x-required-scope":"providers:manage"},"post":{"description":"Requires a system administrator. Creates a disabled connection without testing credentials or making a paid request.","operationId":"post_v1_admin_providers","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"api_type":{"type":"string"},"name":{"maxLength":120,"type":"string"}},"required":["api_type","name"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminProvider"}}},"description":"Created provider connection"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Create an independent provider connection","tags":["Providers admin"],"x-required-scope":"providers:manage"}},"/v1/admin/providers/types":{"get":{"description":"Requires a system administrator. Templates describe supported serialization formats; they do not imply access or pricing for manually added models.","operationId":"get_v1_admin_providers_types","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/ProviderField"},"type":"array"},"icon_monochrome":{"type":"boolean"},"icon_url":{"description":"Authenticated content-versioned uploaded PNG logo URL; absent until uploaded","type":"string"},"id":{"type":"string"},"name":{"type":"string"},"profiles":{"items":{"additionalProperties":true,"type":"object"},"type":"array"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"API types with connection fields and model capability templates"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List supported API adapters and request profile templates","tags":["Providers admin"],"x-required-scope":"providers:manage"}},"/v1/admin/providers/{providerId}":{"get":{"description":" Requires providers:manage on personal keys, or a console session. Available when provider administration is configured.","operationId":"get_v1_admin_providers_providerId","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminProvider"}}},"description":"Provider state"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Get provider configuration and live status","tags":["Providers admin"],"x-required-scope":"providers:manage"},"parameters":[{"$ref":"#/components/parameters/ProviderID"}],"put":{"description":"Omitted credential fields preserve the stored value; empty strings clear it. Clearing a required credential disables the provider. Requires providers:manage on personal keys, or a console session. Available when provider administration is configured.","operationId":"put_v1_admin_providers_providerId","requestBody":{"content":{"application/json":{"example":{"api_key":"YOUR_PROVIDER_API_KEY","enabled":true},"schema":{"$ref":"#/components/schemas/ProviderUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminProvider"}}},"description":"Updated and validated provider state"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Update credentials, endpoints, or enabled state","tags":["Providers admin"],"x-required-scope":"providers:manage"}},"/v1/admin/providers/{providerId}/check":{"parameters":[{"$ref":"#/components/parameters/ProviderID"}],"post":{"description":" Requires providers:manage on personal keys, or a console session. Available when provider administration is configured.","operationId":"post_v1_admin_providers_providerId_check","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminProvider"}}},"description":"Refreshed provider state"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Refresh provider model and connection status information","tags":["Providers admin"],"x-required-scope":"providers:manage"}},"/v1/admin/providers/{providerId}/logo":{"delete":{"description":"Administrator only. Idempotently remove only this resource owner's provider logo. Credentials, settings, other provider logos and media remain unchanged. Read URLs return 404 afterward; shared renderers show the intentional no-logo fallback.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"icon_url":{"enum":[""],"type":"string"}},"type":"object"}}},"description":"Logo removed or already absent"},"401":{"description":"Authentication required"},"403":{"description":"Administrator permission and applicable API-key scopes required"},"404":{"description":"Provider not found"},"503":{"description":"Logo storage unavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Personal — Remove a provider logo","tags":["Providers admin"]},"parameters":[{"$ref":"#/components/parameters/ProviderID"}],"put":{"description":"Administrator only. Atomically replace this connection's logo without changing settings or credentials. PNG signature and full decoding are checked. Opaque and transparent PNG are accepted, including palette tRNS and 16-bit samples. SVG and other formats are rejected. Failures preserve the previous upload. No remote URL import is supported.","requestBody":{"content":{"image/png":{"schema":{"description":"Decoded PNG","format":"binary","maxLength":1048576,"opaque or transparent; maximum 2048 pixels per side":null,"type":"string"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"icon_url":{"type":"string"}},"type":"object"}}},"description":"Logo saved; refresh images using the new content-versioned URL"},"400":{"description":"Unsupported content type","exceeded byte/dimension limit or incomplete upload; previous logo retained":null,"malformed PNG":null},"401":{"description":"Authentication required"},"403":{"description":"Administrator permission and applicable API-key scopes required"},"404":{"description":"Provider not found"},"503":{"description":"Logo storage unavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Personal — Upload or replace a provider logo","tags":["Providers admin"]}},"/v1/admin/reports":{"get":{"description":"Personal generation history, including revoked personal keys. Organization-key credentials must use their organization report endpoint. Provider charge and package units remain separate. No charge is inferred when billing data is absent.","operationId":"get_v1_admin_reports","parameters":[{"description":"Aggregate all matching requests; ignores pagination. Cannot combine with CSV.","in":"query","name":"view","schema":{"enum":["summary"],"type":"string"}},{"description":"Summary calendar buckets in the selected timezone. Weeks start Monday. A range of one month or less has one monthly bucket. Maximum 10000 buckets.","in":"query","name":"interval","schema":{"default":"day","enum":["day","week","month"],"type":"string"}},{"description":"Exact user ID or email (case-insensitive); financial viewers only.","in":"query","name":"user","schema":{"type":"string"}},{"description":"IANA time zone for inclusive from/to calendar dates; CSV timestamps remain UTC.","in":"query","name":"timezone","schema":{"default":"UTC","type":"string"}},{"description":"Export every matching row as CSV; limit and offset are ignored.","in":"query","name":"format","schema":{"enum":["csv"],"type":"string"}},{"description":"First included date in the requested timezone; defaults to the start of this month.","in":"query","name":"from","schema":{"format":"date","type":"string"}},{"description":"Last included date in the requested timezone; defaults to today.","in":"query","name":"to","schema":{"format":"date","type":"string"}},{"in":"query","name":"api_key_id","schema":{"format":"uuid","type":"string"}},{"description":"Exact generation ID. Combined with the other filters.","in":"query","name":"generation_id","schema":{"format":"uuid","type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"offset","schema":{"default":0,"maximum":100000,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ReportSummary"},{"properties":{"data":{"items":{"properties":{"api_key_id":{"type":["string","null"]},"api_key_name":{"type":"string"},"consumed_usd":{"description":"Generation cost before package coverage; null while unknown.","type":["number","null"]},"cost":{"$ref":"#/components/schemas/TaskCost"},"created_at":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"identity_historical":{"description":"True when labels were captured at request acceptance. False for legacy current-directory fallbacks.","type":"boolean"},"identity_snapshot":{"additionalProperties":true,"type":"object"},"model":{"type":"string"},"provider":{"type":"string"},"provider_name":{"type":"string"},"status":{"type":"string"},"usage":{"$ref":"#/components/schemas/ProviderUsage"}},"type":"object"},"type":"array"},"has_more":{"type":"boolean"},"next_offset":{"type":"integer"}},"type":"object"}]}},"text/csv":{"example":"Created at (UTC),Cost (USD)","schema":{"type":"string"}}},"description":"Tasks in descending creation order."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read personal cost history","tags":["Reports"],"x-required-scope":"keys:manage"}},"/v1/admin/reports/{id}":{"get":{"description":"Requires keys:manage for API keys; browser sessions are supported. Restricted to personal data, including revoked-key history. Organization-bound keys must use organization routes. Returns every retained public generation field and exact saved request settings when content access is allowed. Minimal logging omits prompt, instructions, webhook and references, exposing only retained resolution, ratio, duration and generate_audio. Customer views retain the existing financial sanitization. Provider/storage credentials are never returned.","operationId":"get_v1_admin_reports_id","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}},"description":"Generation details authorized for this viewer"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No generation report in the authorized scope"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read full personal generation report","tags":["Reports"]}},"/v1/admin/reports/{id}/content":{"get":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"get_v1_admin_reports_id_content","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file content"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read personal generation result","tags":["Reports"]},"head":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"head_v1_admin_reports_id_content","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file headers"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Inspect personal generation result","tags":["Reports"]}},"/v1/admin/reports/{id}/last-frame":{"get":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"get_v1_admin_reports_id_last_frame","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file content"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read personal generation last frame","tags":["Reports"]},"head":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"head_v1_admin_reports_id_last_frame","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file headers"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Inspect personal generation last frame","tags":["Reports"]}},"/v1/admin/storage":{"get":{"description":"Returns the current local or S3 selection, connection fields and access key ID to authorized storage managers. The secret access key is never returned. Accounts default to local storage.","operationId":"get_v1_admin_storage","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettings"}}},"description":"Storage settings"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read account storage settings","tags":["Storage admin"],"x-required-scope":"storage:manage"},"put":{"description":"Tests S3 object write, read and delete permissions before activating. Checks browser preflights for configured UI_PUBLIC_URL (or API_PUBLIC_URL), falling back to the request Origin. Missing CORS is configured automatically using the saved key, preserving other rules and bucket privacy; CORS read/update rights are required only for missing browser access. After confirming the saved policy, browser_uploads_pending can be true while provider caches apply the change. Changes apply when results are archived, without restarting the worker. Existing files remain at their original location. Blank credentials preserve saved values; changing endpoint requires both credentials again. Selecting local preserves the last S3 connection. Maximum request body is 16 KiB.","operationId":"put_v1_admin_storage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettings"}}},"description":"Saved settings"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Configure account storage","tags":["Storage admin"],"x-required-scope":"storage:manage"}},"/v1/admin/storage/check":{"post":{"description":"Creates, reads and deletes a uniquely named temporary object under the configured prefix. Does not list or create buckets. Uses saved credentials if omitted. A successful check does not activate the settings. Also validates PUT/GET/HEAD browser preflights for configured UI_PUBLIC_URL (or API_PUBLIC_URL), falling back to the request Origin. Without either, retains the server-only probe. Missing browser access returns storage_browser_setup_required. Outbound private-address policy rejection returns storage_endpoint_blocked; DNS resolution failure returns storage_endpoint_dns_failed. Other connection failures retain storage_check_failed. Diagnostic messages omit credentials, signed URLs and raw transport details. No bucket CORS is changed.","operationId":"post_v1_admin_storage_check","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"status":{"const":"ok","type":"string"}},"type":"object"}}},"description":"Connection verified"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Test proposed storage settings without saving","tags":["Storage admin"],"x-required-scope":"storage:manage"}},"/v1/api-keys":{"get":{"description":"Includes active, expired and revoked keys. Never includes secrets or hashes. Requires a browser session or a personal key with keys:manage. The deployment service key cannot manage personal keys.","operationId":"get_v1_api_keys","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyList"}}},"description":"Account keys"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List account API keys","tags":["API keys"],"x-required-scope":"keys:manage"},"post":{"description":"Create the first key using your browser session. Thereafter a key with keys:manage may create keys with a subset of its own permissions. Body limit: 4 KiB. The secret is shown once. This operation is not idempotent; after an ambiguous timeout, inspect the key list and revoke an unused key before issuing a replacement. The deployment service key cannot manage personal keys.","operationId":"post_v1_api_keys","requestBody":{"content":{"application/json":{"example":{"name":"Production bot","scopes":["generation"]},"schema":{"$ref":"#/components/schemas/CreateAPIKeyRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedAPIKey"}}},"description":"Key created; save the secret now"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Request quota exceeded; no task was accepted. Retry after the indicated number of seconds. Limits use rolling windows and aggregate all keys of the user within the workspace.","headers":{"Retry-After":{"description":"Seconds until all exceeded quota windows allow another request","schema":{"minimum":1,"type":"integer"}}}},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Create a personal API key","tags":["API keys"],"x-required-scope":"keys:manage"}},"/v1/api-keys/billing":{"get":{"description":"Owner-scoped billing import status. A successful import does not imply that aggregate bills can be matched to individual generation tasks.","operationId":"get_v1_api_keys_billing","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"checked_at":{"format":"date-time","type":"string"},"message":{"type":"string"},"provider":{"type":"string"},"status":{"enum":["synced","not_configured","error"],"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Last background synchronization per provider"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read provider billing synchronization status","tags":["API keys"],"x-required-scope":"keys:manage"}},"/v1/api-keys/usage":{"get":{"description":"Monthly spending statistics for account keys, including revoked keys. Financial limits belong to the organization and its members. consumed_usd includes only known completed gross generation costs; actual_usd includes only confirmed charges. Unknown legacy costs remain explicit. Tasks belong to their creation month in the requested timezone (UTC by default). Console session tasks have no API key attribution. Amounts use six decimal places.","operationId":"get_v1_api_keys_usage","parameters":[{"description":"Calendar month in the requested timezone, YYYY-MM (year 2000 or later). Defaults to the current month.","example":"2026-09","in":"query","name":"month","schema":{"pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","type":"string"}},{"description":"IANA time zone for the calendar month. The console sends the user's local timezone.","in":"query","name":"timezone","schema":{"default":"UTC","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"currency":{"enum":["USD"],"type":"string"},"data":{"items":{"$ref":"#/components/schemas/APIKeyMonthlyUsage"},"type":"array"},"month":{"example":"2026-09","type":"string"}},"required":["data","month","currency"],"type":"object"}}},"description":"Monthly estimates and coverage by key"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read monthly spending by API key","tags":["API keys"],"x-required-scope":"keys:manage"}},"/v1/api-keys/{id}":{"delete":{"description":"Permanently blocks subsequent authentication. Repeating a revocation returns 204. Revocation does not cancel accepted tasks, revoke previously signed media URLs, or cascade to other keys created using this key. Requires a browser session or keys:manage. The deployment service key cannot manage personal keys.","operationId":"delete_v1_api_keys_id","responses":{"204":{"description":"Revoked; empty response body"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Revoke a personal API key","tags":["API keys"],"x-required-scope":"keys:manage"},"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}]},"/v1/audio/generations":{"post":{"description":"Returns HTTP 202 immediately after queue admission. Poll status_url until completed/failed; download content_url with the same API key. Provider execution never runs synchronously in this request. This endpoint selects media_type=music.","operationId":"post_v1_audio_generations","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Generation accepted"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Budget exceeded"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Idempotency conflict or changed estimate"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Pricing unavailable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Create music (Gateway extension)","tags":["Generations"],"x-required-scope":"generation"}},"/v1/audio/speech":{"post":{"description":"Returns HTTP 202 immediately after queue admission. Poll status_url until completed/failed; download content_url with the same API key. Provider execution never runs synchronously in this request. This endpoint selects media_type=speech.","operationId":"post_v1_audio_speech","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Generation accepted"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Budget exceeded"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Idempotency conflict or changed estimate"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Pricing unavailable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Create speech","tags":["Generations"],"x-required-scope":"generation"}},"/v1/audit/events":{"get":{"description":"Requires a current Administrator and a browser session or personal API key with system:manage. Organization-bound keys cannot read global history. Events contain safe changed fields, immutable identity labels and no credentials or request content. Historical snapshots never authorize access.","operationId":"get__v1_audit_events","parameters":[{"description":"First included calendar date in timezone, YYYY-MM-DD. Defaults to the first day of this month.","in":"query","name":"from","schema":{"type":"string"}},{"description":"Last included calendar date. Defaults to today. The backend uses an exclusive next-day boundary.","in":"query","name":"to","schema":{"type":"string"}},{"description":"IANA timezone; defaults to UTC.","in":"query","name":"timezone","schema":{"type":"string"}},{"description":"Exact organization ID; only filters global history. Scoped routes never widen access.","in":"query","name":"organization_id","schema":{"type":"string"}},{"description":"Actor ID, email or name; case-insensitive substring for names and email.","in":"query","name":"actor_id","schema":{"type":"string"}},{"description":"Exact action identifier.","in":"query","name":"action","schema":{"type":"string"}},{"description":"Exact object type.","in":"query","name":"object_type","schema":{"type":"string"}},{"description":"Exact object or key ID.","in":"query","name":"object_id","schema":{"type":"string"}},{"description":"success, denied or failed.","in":"query","name":"outcome","schema":{"type":"string"}},{"description":"system, organization or personal.","in":"query","name":"scope","schema":{"type":"string"}},{"description":"Exact server-generated correlation ID.","in":"query","name":"correlation_id","schema":{"type":"string"}},{"description":"Exclusive event ID cursor, not an offset; defaults to zero.","in":"query","name":"before_id","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventPage"}}},"description":"Safe history. Lists contain up to 50 rows."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List management audit events","tags":["Audit"],"x-required-scope":"system:manage"}},"/v1/audit/events/{event}":{"get":{"description":"Requires a current Administrator and a browser session or personal API key with system:manage. Organization-bound keys cannot read global history. Events contain safe changed fields, immutable identity labels and no credentials or request content. Historical snapshots never authorize access.","operationId":"get__v1_audit_events_event","parameters":[{"in":"path","name":"event","required":true,"schema":{"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEvent"}}},"description":"Safe history. Lists contain up to 50 rows."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Event not found in the permitted scope"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read one management audit event","tags":["Audit"],"x-required-scope":"system:manage"}},"/v1/audit/revoked-keys":{"get":{"description":"Requires a current Administrator and a browser session or personal API key with system:manage. Organization-bound keys cannot read global history. Events contain safe changed fields, immutable identity labels and no credentials or request content. Historical snapshots never authorize access.","operationId":"get__v1_audit_revoked_keys","parameters":[{"description":"First included calendar date in timezone, YYYY-MM-DD. Defaults to the first day of this month.","in":"query","name":"from","schema":{"type":"string"}},{"description":"Last included calendar date. Defaults to today. The backend uses an exclusive next-day boundary.","in":"query","name":"to","schema":{"type":"string"}},{"description":"IANA timezone; defaults to UTC.","in":"query","name":"timezone","schema":{"type":"string"}},{"description":"Exact organization ID; only filters global history. Scoped routes never widen access.","in":"query","name":"organization_id","schema":{"type":"string"}},{"description":"Actor ID, email or name; case-insensitive substring for names and email.","in":"query","name":"actor_id","schema":{"type":"string"}},{"description":"Exact object or key ID.","in":"query","name":"object_id","schema":{"type":"string"}},{"description":"Revoked-key history only; 0 to 100000.","in":"query","name":"offset","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokedKeyPage"}}},"description":"Safe history. Lists contain up to 50 rows."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List immutable revoked-key history","tags":["Audit"],"x-required-scope":"system:manage"}},"/v1/client-onboardings":{"get":{"description":"Browser only. Lists up to 100 recent cards currently in the manager's provisional or activated portfolio. Does not grant organization membership or statistics access before acceptance.","operationId":"get_client_onboardings","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ClientOnboarding"},"type":"array"}},"type":"object"}}},"description":"Scoped cards with invitation delivery status"},"403":{"description":"Not a client manager or explicit API credential"}},"security":[{"sessionAuth":[]}],"summary":"List companies onboarded by the current client manager","tags":["Organizations"]},"post":{"description":"Browser only. Atomically saves the company, provisional manager, recipient-bound 14-day Supermanager invitation and durable email delivery. Reuse operation_id and identical normalized input after an uncertain response. Creation success does not confirm email delivery. No user, password, credit, key or customer membership is created here.","operationId":"create_client_onboarding","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"comment":{"maxLength":2000,"type":"string"},"contact_name":{"maxLength":160,"minLength":1,"type":"string"},"country":{"maxLength":100,"minLength":1,"type":"string"},"domain":{"description":"Required company website or domain; normalized to hostname without www","maxLength":2048,"minLength":1,"port or path. Internationalized hostnames use ASCII IDNA.":null,"scheme":null,"type":"string"},"email":{"format":"email","maxLength":254,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"},"operation_id":{"format":"uuid","type":"string"}},"required":["operation_id","name","domain","country","contact_name","email"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientOnboarding"}}},"description":"Committed company or idempotent replay, including current delivery status"},"400":{"description":"Invalid fields"},"403":{"description":"Not a client manager or explicit API credential"},"409":{"description":"Reused operation with different input","or duplicate normalized name or website. Duplicate error includes criterion and manager; organization ID appears only within the caller's scope.":null},"429":{"description":"20 distinct companies changed within the rolling last hour"}},"security":[{"sessionAuth":[]}],"summary":"Create a company and email its first owner invitation","tags":["Organizations"]}},"/v1/client-onboardings/{org}/{action}":{"post":{"description":"Browser only, live provisional manager only. Reuse operation_id on uncertain retries. Version conflicts return 409. Resend preserves the company and invitation IDs, renews the 14-day expiry and rotates the link after successful delivery; revoked links stay invalid. Acceptance stops resend/revoke. Background delivery does not count toward the manual quota.","operationId":"change_first_owner_invitation","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"action","required":true,"schema":{"enum":["resend","revoke"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"operation_id":{"format":"uuid","type":"string"},"version":{"minimum":1,"type":"integer"}},"required":["operation_id","version"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientOnboarding"}}},"description":"Current card"},"403":{"description":"Outside current scope"},"409":{"description":"Version conflict","operation mismatch or invitation already accepted":null},"429":{"description":"Manual distinct-company limit reached"}},"security":[{"sessionAuth":[]}],"summary":"Resend or revoke an unaccepted first-owner invitation","tags":["Organizations"]}},"/v1/company-interface/authorizations/approve":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Atomically approve the bound intention; additional-user login requires existing membership and does not auto-issue a generation key. Verified central browser cookie and exact configured frontend Origin required, with the existing CSRF gate. An API key cannot replace the browser session. Inspect pins the actual central actor and private source session; approval requires matching code and explicit consent. Local administrator status grants no central authority.","operationId":"approveCompanyInterfaceApproval","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"consent":{"const":true,"type":"boolean"},"operation_id":{"format":"uuid","type":"string"},"user_code":{"type":"string"}},"required":["user_code","operation_id","consent"],"type":"object"}}},"required":true},"responses":{"200":{"description":"attempt_id and state; no credential"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Atomically approve the bound intention; additional-user login requires existing membership and does not auto-issue a generation key."}},"/v1/company-interface/authorizations/inspect":{"post":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. Review matching code, stored installation origin and disclosed purpose. Verified central browser cookie and exact configured frontend Origin required, with the existing CSRF gate. An API key cannot replace the browser session. Inspect pins the actual central actor and private source session; approval requires matching code and explicit consent. Local administrator status grants no central authority.","operationId":"inspectCompanyInterfaceApproval","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"user_code":{"type":"string"}},"required":["user_code"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Nonsecret attempt ID/code/state/expiry and disclosed binding"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"Review matching code, stored installation origin and disclosed purpose."}},"/v1/company-interface/grants/{id}":{"delete":{"description":"Reserved company-interface v1 protocol composition. Full company-interface mode remains unavailable while any required capability, including full-company-surface/v1, is missing. No local-data fallback. No query parameters; strict JSON bodies up to 32768 bytes, unknown fields and trailing JSON rejected; 15-second request budget. Error bodies are sanitized and contain no remote response or credential. The current central company Supermanager may revoke this grant. Verified central browser cookie and exact configured frontend Origin required, with the existing CSRF gate. An API key cannot replace the browser session. Inspect pins the actual central actor and private source session; approval requires matching code and explicit consent. Local administrator status grants no central authority.","operationId":"revokeCompanyInterfaceGrant","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{},"type":"object"}}},"required":true},"responses":{"200":{"description":"revoked boolean"},"403":{"description":"Identity, origin, proof or strict request validation rejected"},"409":{"description":"Update required or exact operation/context conflict; retain original proof"},"428":{"description":"Explicit central approval pending"},"429":{"description":"Rate limit; Retry-After: 60"},"503":{"description":"Unavailable or uncertain response; retain original operation and custody"}},"security":[],"summary":"The current central company Supermanager may revoke this grant."}},"/v1/generations":{"get":{"description":"Gateway extension. Role-filtered jobs ordered by creation time and ID descending. Ownership, author and project filtering happen before pagination and counting. Omitting project_id includes older ungrouped generations; project_id=none selects only unassigned generations. Unknown or foreign projects return the same validation error. Existing limit/offset pagination remains supported. Send cursor with an empty value for the first stable cursor page, then use next_cursor for older records. New arrivals do not shift cursor pages. Cursor responses include the exact full filtered total from the same database snapshot as the page; this total is independent of cursor/through bounds. Cursors are bound to the viewer and project filter and retain the full creation timestamp precision. They are positions, so a removed or reassigned boundary record does not invalidate continuation.","operationId":"list_generations","parameters":[{"description":"Optional workspace project UUID or none for unassigned generations only. Omit for all generations. The none sentinel is a read-only filter and cannot be assigned or managed as a project.","in":"query","name":"project_id","schema":{"oneOf":[{"format":"uuid","type":"string"},{"enum":["none"],"type":"string"}]}},{"in":"query","name":"offset","schema":{"default":0,"maximum":1000000,"minimum":0,"type":"integer"}},{"description":"Opt in to cursor pagination, using an empty value for the first page. Use the returned next_cursor for the next older page. Cannot be combined with offset. next_cursor is also returned on a final nonempty page so its position can bound a later refresh.","in":"query","name":"cursor","schema":{"maxLength":1024,"type":"string"}},{"description":"Optional inclusive oldest position for refreshing an already loaded range. Requires cursor pagination. Walk from cursor= through that saved tail, following has_more/next_cursor within the bounded range. The total still counts the full filtered set. Reuse the saved tail to load older history afterward.","in":"query","name":"through","schema":{"maxLength":1024,"type":"string"}},{"description":"Cursor mode only. Return only id and an opaque journal_revision for each matching record. Reconcile the loaded range with these lightweight pages, then request full data only for changed/new IDs. The revision includes the viewer/role/filter context and changes after task or stored-result availability updates, including same-timestamp writes.","in":"query","name":"view","schema":{"enum":["versions"],"type":"string"}},{"description":"Cursor mode only. Comma-separated set of 1 to 50 unique canonical generation UUIDs for changed-card reads. All workspace, author and project restrictions still apply before pagination. The total counts the full viewer/project filter, independently of these IDs.","in":"query","name":"ids","schema":{"type":"string"}},{"description":"Cursor mode only. Set false on continuation inventory pages to omit total and avoid repeating the same count query. Reconciliation can count once per inventory walk.","in":"query","name":"include_total","schema":{"default":true,"type":"boolean"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"oneOf":[{"$ref":"#/components/schemas/Generation"},{"additionalProperties":false,"properties":{"id":{"format":"uuid","type":"string"},"journal_revision":{"type":"string"}},"required":["id","journal_revision"],"type":"object"}]},"type":"array"},"has_more":{"type":"boolean"},"journal_scope":{"description":"Cursor mode only. Opaque viewer/role/filter context for reconciling multiple requests. Discard former views and restart with an empty cursor if this changes or a saved cursor becomes invalid after a permission change.","type":"string"},"next_cursor":{"description":"Cursor mode only. Last returned position, or null for an empty page.","type":["string","null"]},"next_offset":{"minimum":0,"type":"integer"},"object":{"const":"list"},"total":{"description":"Cursor mode only, unless include_total=false. Exact count for the viewer and project filter, including records outside this page or refresh range.","minimum":0,"type":"integer"}},"type":"object"}}},"description":"Recent generations"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"List recent generations","tags":["Generations"]},"post":{"description":"Returns HTTP 202 immediately after queue admission. Poll status_url until completed/failed; download content_url with the same API key. Provider execution never runs synchronously in this request.","operationId":"post_v1_generations","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Generation accepted"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Budget exceeded"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Idempotency conflict or changed estimate"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Pricing unavailable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Create a generation (Gateway extension)","tags":["Generations"],"x-required-scope":"generation"}},"/v1/generations/estimate":{"post":{"description":"Estimate without creating or executing a generation. Same canonical input and model resolution as creation. Customer costs include markup.","operationId":"post_v1_generations_estimate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"can_generate":{"type":"boolean"},"cost":{"$ref":"#/components/schemas/TaskCost"},"remaining_usd":{"type":["number","null"]},"weekly_limit_usd":{"type":["number","null"]}},"type":"object"}}},"description":"Estimate"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Pricing unavailable"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Estimate a generation (Gateway extension)","tags":["Generations"],"x-required-scope":"generation"}},"/v1/generations/{id}":{"get":{"description":"Owner-scoped status. The video route returns 404 for other media types. All routes use the same statuses and Unix timestamps.","operationId":"get_v1_generations_id","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Generation"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Generation not found"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Retrieve asynchronous generation","tags":["Generations"]},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}]},"/v1/generations/{id}/artifacts/{artifact}/content":{"get":{"description":"Requires generation ownership. Only completely archived results are available. Supports Range and conditional requests. Provider URLs and authenticated source handles are never returned.","operationId":"get_v1_generations_id_artifacts_artifact_content","responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"Archived artifact bytes"},"206":{"description":"Requested byte range"},"307":{"description":"Redirect to isolated storage; do not forward Gateway credentials."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Download one archived generation artifact","tags":["Media"],"x-required-scope":"generation"},"head":{"operationId":"head_v1_generations_id_artifacts_artifact_content","responses":{"200":{"description":"Archived artifact metadata without a response body"},"307":{"description":"Redirect to isolated storage; do not forward Gateway credentials."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Read archived artifact headers","tags":["Media"],"x-required-scope":"generation"},"parameters":[{"$ref":"#/components/parameters/TaskID"},{"description":"Opaque local artifact ID from the completed generation.","in":"path","name":"artifact","required":true,"schema":{"type":"string"}}]},"/v1/generations/{id}/content":{"delete":{"description":"Owner-scoped, generation-key authorization. Only terminal tasks may be deleted. Deletes result and last-frame files, including object versions, from the original destination. Metadata, prompt, provider URL and all accounting remain. Idempotent; retry a partial storage failure. Signed Gateway media URLs stop working after deletion. Provider links may already have expired.","operationId":"deleteGenerationResultFiles","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Stored result files deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Task not found."},"409":{"description":"Generation is still running."},"503":{"description":"Deletion incomplete; retry."}},"summary":"Delete stored result files and retain task history","tags":["Generations"]},"get":{"description":"Authenticated result download using existing storage, Range and deletion behavior. Until a result is stored, no media is returned.","operationId":"get_v1_generations_id_content","responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"Stored media"},"206":{"description":"Partial content"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Result not available"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not ready"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Download generation content","tags":["Media"]},"head":{"description":"Authenticated result download using existing storage, Range and deletion behavior. Until a result is stored, no media is returned.","operationId":"head_v1_generations_id_content","responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"Stored media"},"206":{"description":"Partial content"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Result not available"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not ready"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Inspect generation content","tags":["Media"]},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}]},"/v1/generations/{id}/last-frame":{"get":{"description":"Requires task ownership. Returns 404 when no archived last frame exists. Supports Range and conditional requests. Use media-access for a signed browser URL.","operationId":"get_v1_tasks_id_last_frame","responses":{"200":{"description":"Last frame image"},"206":{"description":"Partial content"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Download the archived video last frame","tags":["Media"],"x-required-scope":"generation"},"head":{"description":"Requires task ownership. Returns 404 when no archived last frame exists. Supports Range and conditional requests. Use media-access for a signed browser URL.","operationId":"head_v1_tasks_id_last_frame","responses":{"200":{"description":"Last frame headers"},"206":{"description":"Partial content"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Read archived last frame headers","tags":["Media"],"x-required-scope":"generation"},"parameters":[{"$ref":"#/components/parameters/TaskID"}]},"/v1/generations/{id}/media-access":{"get":{"description":"Returns relative, time-limited URLs for a completed archived result. Anyone holding a signed URL can access it until expires_at, including after the originating API key is revoked. Request a fresh URL after expiry.","operationId":"get_v1_tasks_id_media_access","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAccess"}}},"description":"Signed access URLs"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Create temporary signed preview and download URLs","tags":["Media"],"x-required-scope":"generation"},"parameters":[{"$ref":"#/components/parameters/TaskID"}]},"/v1/generations/{id}/project":{"patch":{"description":"Any generation within the authenticated company may be assigned, independently of author or key recipient. Profile generations remain limited to their owner. Requires a writable content role; does not grant new content, financial or media-deletion permissions. Send the generation's project_version as version. Empty or null project_id removes the tag. Does not change the request, execution status, timestamps, result records, media or retention settings.","operationId":"assign_generation_project","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"project_id":{"description":"Owned project ID or empty/null for no project.","type":["string","null"]},"version":{"format":"int64","minimum":0,"type":"integer"}},"required":["version"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"project_id":{"type":"string"},"version":{"format":"int64","minimum":0,"type":"integer"}},"type":"object"}}},"description":"New project assignment"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Generation unavailable to this actor"},"409":{"description":"Assignment changed; retrieve the generation and review before retrying"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Change a generation's project","tags":["Generations"],"x-required-scope":"generation"}},"/v1/images/edits":{"post":{"description":"Returns HTTP 202 immediately after queue admission. Poll status_url until completed/failed; download content_url with the same API key. Provider execution never runs synchronously in this request. This endpoint selects media_type=image. Multipart uploads are local-storage only, with a 32 MiB total limit. S3 returns 409 direct_upload_required; upload with /v1/references/uploads and send JSON referencing that file. Local uploads are saved to the reference library; uploaded files remain reusable even if later generation admission fails. Use image/image[] for edits, input_reference for video. options is JSON text.","operationId":"post_v1_images_edits","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationRequest"}},"multipart/form-data":{"schema":{"properties":{"background":{"type":"string"},"image":{"format":"binary","type":"string"},"image[]":{"items":{"format":"binary","type":"string"},"type":"array"},"model":{"type":"string"},"options":{"description":"JSON-encoded MediaOptions","type":"string"},"output_format":{"type":"string"},"prompt":{"type":"string"},"quality":{"type":"string"},"size":{"type":"string"},"timeout_seconds":{"format":"int64","maximum":9223372036,"minimum":1,"type":"integer"}},"required":["model","prompt","image"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Generation accepted"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Budget exceeded"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Idempotency conflict or changed estimate"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Pricing unavailable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Create an image edit","tags":["Generations"],"x-required-scope":"generation"}},"/v1/images/generations":{"post":{"description":"Returns HTTP 202 immediately after queue admission. Poll status_url until completed/failed; download content_url with the same API key. Provider execution never runs synchronously in this request. This endpoint selects media_type=image.","operationId":"post_v1_images_generations","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Generation accepted"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Budget exceeded"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Idempotency conflict or changed estimate"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Pricing unavailable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Create an image generation","tags":["Generations"],"x-required-scope":"generation"}},"/v1/info":{"get":{"description":"Authenticated deployment defaults and console authentication mode (public only in local API-key development mode). Defaults may not be configured for your account; GET /v1/providers is the authoritative account catalog. The console object includes read-only installation_role and central_origin; central console policy disables personal providers.","operationId":"get_v1_info","responses":{"200":{"content":{"application/json":{"example":{"auth_mode":"google","live":false,"model":"mock-video-v1","provider":"mock"},"schema":{"$ref":"#/components/schemas/ServiceInfo"}}},"description":"Service information"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Get the current default provider and model","tags":["System"]}},"/v1/invitations/accept":{"post":{"description":"Ordinary invitations grant their saved organization role (Member by default); API acceptance requires organizations:manage. Acceptance cannot override the saved role. First-owner invitations require a browser session matching the invited verified email and join as Supermanager. Owner acceptance activates the company and assigns the still-authorized provisional client manager once. Declining does not consume the link.","operationId":"post_v1_invitations_accept","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"token":{"maxLength":43,"minLength":43,"type":"string"}},"required":["token"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationInvitation"}}},"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Accept invitation; preview does not consume the link","tags":["Organizations"]}},"/v1/invitations/preview":{"post":{"description":"Ordinary invitations grant their saved organization role (Member by default); API acceptance requires organizations:manage. Acceptance cannot override the saved role. First-owner invitations require a browser session matching the invited verified email and join as Supermanager. Owner acceptance activates the company and assigns the still-authorized provisional client manager once. Declining does not consume the link.","operationId":"post_v1_invitations_preview","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"token":{"maxLength":43,"minLength":43,"type":"string"}},"required":["token"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationInvitation"}}},"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Preview invitation; preview does not consume the link","tags":["Organizations"]}},"/v1/key":{"get":{"description":"Requires a Gateway API key, including generation-only keys. Returns only that key and its usage for the current UTC calendar month. Browser sessions cannot authorize this endpoint. Service credentials return null key and usage. No secret is returned.","operationId":"getCurrentAPIKey","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"key":{"oneOf":[{"$ref":"#/components/schemas/APIKey"},{"type":"null"}]},"organization":{"$ref":"#/components/schemas/Organization"},"usage":{"oneOf":[{"$ref":"#/components/schemas/APIKeyMonthlyUsage"},{"type":"null"}]}},"required":["key","usage"],"type":"object"}}},"description":"Current key and monthly usage; null usage means unavailable."},"401":{"$ref":"#/components/responses/Unauthorized"},"503":{"description":"Key or usage could not be read."}},"summary":"Read the calling key, organization and member weekly allowance","tags":["API keys"]}},"/v1/key/support":{"get":{"description":"Requires a current company-bound API key with generation scope and current company membership. The company comes only from the authenticated key; no query or path company selector is accepted. Returns the same assigned-manager display card as browser Support, with deliberately published contacts only. No login email or private profile fields are returned. An unassigned company returns null client_manager. Browser sessions, personal keys and deployment service keys cannot use this endpoint. Responses are not publicly cached.","operationId":"get_key_support","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"client_manager":{"properties":{"contacts":{"$ref":"#/components/schemas/ContactLinks"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"picture":{"format":"uri","type":"string"}},"type":["object","null"]}},"required":["client_manager"],"type":"object"}}},"description":"Assigned client manager, if any"},"400":{"description":"Query selectors are not accepted"},"401":{"description":"Valid API key required"},"403":{"description":"Company key","scope or current membership required":null},"503":{"description":"Support contacts unavailable"}},"security":[{"bearerAuth":[]}],"summary":"Get the authenticated company's support manager","tags":["Organizations"],"x-required-scope":"generation"}},"/v1/me":{"get":{"description":"Returns the account identified by a browser session or personal key. The deployment service key receives 401 because it has no personal profile.","operationId":"get_v1_me","responses":{"200":{"content":{"application/json":{"example":{"email":"developer@example.com","id":"7037b5e5-2e44-4185-a2b5-d7e459c7b16a","name":"Developer"},"schema":{"$ref":"#/components/schemas/User"}}},"description":"Current account"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Get the current account","tags":["Account"],"x-required-scope":"generation"},"patch":{"description":"Requires your browser session. API keys cannot update profiles. Contact links are optional and visible to authorized company-member viewers, including the assigned client manager. An empty contacts array removes all links; omission preserves them. Labels and links are trimmed. Custom names, contacts and report columns survive subsequent sign-ins. Report columns are shared across your report views; unavailable columns are hidden for the current role and scope.","operationId":"update_profile","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"minProperties":1,"properties":{"color_preset":{"description":"Published color theme ID. Empty follows the site default; independent of dark/light/system mode.","maxLength":64,"type":"string"},"contacts":{"$ref":"#/components/schemas/ContactLinks"},"name":{"description":"Trimmed display name without control characters.","maxLength":100,"minLength":1,"type":"string"},"report_columns":{"$ref":"#/components/schemas/ReportColumns"},"theme":{"default":"system","enum":["dark","light","system"],"type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Updated user"},"400":{"description":"Invalid profile"},"401":{"description":"Sign-in required"},"403":{"description":"Browser session required"}},"security":[{"sessionAuth":[]}],"summary":"Update your display name, appearance, contact links or report columns","tags":["Account"]}},"/v1/media-inputs/faces":{"post":{"operationId":"prepareMediaFaceInput","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaFacePreparation"}}},"required":true},"responses":{"202":{"description":"Priced preparation admitted; poll the returned generation."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"description":"Verified price unavailable."}},"summary":"Prepare an inspected face input for a media consumer","tags":["References"],"x-required-scope":"generation"}},"/v1/media-inputs/faces/estimate":{"post":{"operationId":"estimateMediaFaceInput","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaFacePreparation"}}},"required":true},"responses":{"200":{"description":"Normal verified quote and budget status."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"description":"Verified price unavailable."}},"summary":"Estimate inspected face-input preparation without submitting work","tags":["References"],"x-required-scope":"generation"}},"/v1/models":{"get":{"description":"Only enabled models visible to this API key. Raw unique model IDs, or provider/model for ambiguous names. capabilities preserves full metadata, controls and role-filtered gateway prices.","operationId":"list_models","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OpenAIModel"},"type":"array"},"object":{"const":"list"}},"type":"object"}}},"description":"Model catalog"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"List available models","tags":["Catalog"]}},"/v1/models/{model}":{"get":{"description":"Only enabled models visible to this API key. Raw unique model IDs, or provider/model for ambiguous names. capabilities preserves full metadata, controls and role-filtered gateway prices.","operationId":"retrieve_model","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIModel"}}},"description":"Model catalog"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Model not available"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Retrieve a model","tags":["Catalog"]},"parameters":[{"in":"path","name":"model","required":true,"schema":{"type":"string"}}]},"/v1/models/{model}/preparations":{"get":{"operationId":"mediaInputPreparationSchemas","parameters":[{"in":"path","name":"model","required":true,"schema":{"type":"string"}},{"in":"query","name":"provider","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Workflow-scoped preparation schemas","never standalone executable models.":null},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Read input-preparation schemas for one authorized media consumer","tags":["References"],"x-required-scope":"generation"}},"/v1/organizations":{"get":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"get_v1_organizations","parameters":[{"in":"query","name":"all","schema":{"default":false,"type":"boolean"}},{"description":"Include customer spend for the period and all-time latest accepted generation. Current authorization applies; summaries are omitted for Developer and Member roles.","in":"query","name":"view","schema":{"enum":["summary"],"type":"string"}},{"description":"First included date in timezone; defaults to this month's first day. Used with view=summary.","in":"query","name":"from","schema":{"format":"date","type":"string"}},{"description":"Last included date in timezone; defaults to today. Used with view=summary.","in":"query","name":"to","schema":{"format":"date","type":"string"}},{"description":"IANA timezone for period boundaries, used with view=summary.","in":"query","name":"timezone","schema":{"default":"UTC","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"as_of":{"description":"Server reference time for view=summary.","format":"date-time","type":"string"},"data":{"items":{"$ref":"#/components/schemas/Organization"},"type":"array"}},"type":"object"}}},"description":"Success"},"400":{"dates or timezone":null,"description":"Invalid view"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"},"503":{"description":"Usage summary is unavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List memberships; administrators may set all=true","tags":["Organizations"]},"post":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"post_v1_organizations","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"admin_user":{"description":"Optional first manager: existing user email or UUID. If omitted or blank, administrators manage the organization until a manager is assigned.","type":"string"},"domain":{"description":"Required company website or domain. Unique after hostname normalization.","maxLength":2048,"minLength":1,"type":"string"},"name":{"type":"string"}},"required":["name","domain"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}},"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Company name or website already exists"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Create organization and first manager (administrator)","tags":["Organizations"]}},"/v1/organizations/{id}/request-logging":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"put":{"description":"Managers can minimize retained request content. New tasks inherit this setting when accepted. After a minimized task finishes, its prompt, instructions, input references, raw provider usage and webhook destination are removed; status, normalized usage and cost remain. In-flight tasks and existing task records keep the policy they had when accepted.","operationId":"updateOrganizationRequestLogging","requestBody":{"content":{"application/json":{"schema":{"properties":{"minimize_request_logging":{"type":"boolean"}},"required":["minimize_request_logging"],"type":"object"}}},"required":true},"responses":{"204":{"description":"Request logging setting saved"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Set request logging for new organization generations","tags":["Organizations"],"x-required-scope":"organizations:manage"}},"/v1/organizations/{id}/storage":{"get":{"description":"Managers can read settings. Administrators without manager membership can only read the selected driver. Secrets are never returned. The default is Gateway storage. API keys need organizations:manage.","operationId":"getOrganizationStorage","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"can_manage":{"description":"True only for managers. Administrators without this membership receive only the selected storage driver.","type":"boolean"},"gateway_allowance_bytes":{"description":"Per-organization Gateway allowance in bytes; null means unlimited.","nullable":true,"type":"integer"},"settings":{"$ref":"#/components/schemas/StorageSettings"}},"type":"object"}}},"description":"Selected storage and free Gateway allowance"}},"summary":"Read organization storage settings","tags":["Organizations"],"x-required-scope":"organizations:manage"},"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"put":{"description":"Managers only, including administrators who also hold this membership. Use driver gateway or s3. S3 object access and browser preflights are tested before saving. Missing CORS is configured for UI_PUBLIC_URL (or API_PUBLIC_URL, then request Origin), preserving existing rules and bucket privacy. Missing CORS requires read/update rights; browser_uploads_pending indicates a confirmed policy still propagating. Keys using shared providers use this selection for new uploads and generations, using organization storage ownership. Keys using personal providers use the user’s personal storage. Existing files are not moved or deleted and retain their original connection. Blank credentials preserve the saved credentials; changing endpoints requires both credentials again.","operationId":"updateOrganizationStorage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettings"}}},"description":"Saved settings"}},"summary":"Select Gateway storage or organization S3","tags":["Organizations"],"x-required-scope":"organizations:manage"}},"/v1/organizations/{id}/storage/check":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"post":{"description":"Managers only, including administrators who also hold this membership. Verifies write, read and delete access using a temporary object and checks PUT/GET/HEAD browser preflights for the configured frontend origin (falling back to the request Origin). Missing browser access returns storage_browser_setup_required. Outbound private-address policy rejection returns storage_endpoint_blocked; DNS resolution failure returns storage_endpoint_dns_failed. Other connection failures retain storage_check_failed. Diagnostic messages omit credentials, signed URLs and raw transport details. Does not switch storage or change CORS.","operationId":"checkOrganizationStorage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageUpdate"}}},"required":true},"responses":{"200":{"description":"Connection verified"}},"summary":"Test organization S3 without saving","tags":["Organizations"],"x-required-scope":"organizations:manage"}},"/v1/organizations/{organizationId}/model-access":{"get":{"description":"Administrator or sales browser session with effective models permission for this client. Organization Managers cannot enable hidden models themselves. Provider and key restrictions still apply.","operationId":"get_v1_organizations_organizationId_model_access","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ModelSetting"},"type":"array"},"model_ids":{"items":{"format":"uuid","type":"string"},"type":"array"},"version":{"minimum":1,"type":"integer"}},"required":["data","model_ids","version"],"type":"object"}}},"description":"Registered models, additional grants and version"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read the organization's additional model grants","tags":["Organizations"]},"parameters":[{"in":"path","name":"organizationId","required":true,"schema":{"format":"uuid","type":"string"}}],"put":{"description":"Administrator or sales browser session with effective models permission for this client. A model is available when enabled_by_default is true OR its stable model setting ID is granted to this organization. Removing a grant does not deny a globally enabled model.","operationId":"put_v1_organizations_organizationId_model_access","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationModelAccess"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationModelAccess"}}},"description":"Saved grants"},"403":{"description":"Administrator access required"},"404":{"description":"Organization or model setting does not exist"},"409":{"description":"Version changed; reload settings"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Replace the organization's additional model grants","tags":["Organizations"]}},"/v1/organizations/{org}":{"get":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"get_v1_organizations_org","parameters":[{"in":"path","name":"org","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}},"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Organization balance and weekly allowance","tags":["Organizations"]},"put":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"put_v1_organizations_org","parameters":[{"in":"path","name":"org","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"credit_limit_usd":{"maximum":1000000,"minimum":0,"type":"number"},"default_weekly_limit_usd":{"maximum":1000000,"minimum":0,"type":["number","null"]},"markup_percent":{"description":"Administrators only. Omit to preserve, null to inherit, zero to disable markup. Applies to new shared-provider generations.","maximum":1000,"minimum":0,"multipleOf":0.01,"type":["number","null"]},"name":{"type":"string"}},"required":["name","default_weekly_limit_usd"],"type":"object"}}},"required":true},"responses":{"204":{"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Update organization; credit limit requires administrator","tags":["Organizations"]}},"/v1/organizations/{org}/audit/events":{"get":{"description":"Current Manager, Supermanager or Administrator access to this organization is required. API keys also need organizations:manage and must belong to this organization or be personal. Events contain safe changed fields, immutable identity labels and no credentials or request content. Historical snapshots never authorize access.","operationId":"get__v1_organizations_org_audit_events","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"First included calendar date in timezone, YYYY-MM-DD. Defaults to the first day of this month.","in":"query","name":"from","schema":{"type":"string"}},{"description":"Last included calendar date. Defaults to today. The backend uses an exclusive next-day boundary.","in":"query","name":"to","schema":{"type":"string"}},{"description":"IANA timezone; defaults to UTC.","in":"query","name":"timezone","schema":{"type":"string"}},{"description":"Actor ID, email or name; case-insensitive substring for names and email.","in":"query","name":"actor_id","schema":{"type":"string"}},{"description":"Exact action identifier.","in":"query","name":"action","schema":{"type":"string"}},{"description":"Exact object type.","in":"query","name":"object_type","schema":{"type":"string"}},{"description":"Exact object or key ID.","in":"query","name":"object_id","schema":{"type":"string"}},{"description":"success, denied or failed.","in":"query","name":"outcome","schema":{"type":"string"}},{"description":"system, organization or personal.","in":"query","name":"scope","schema":{"type":"string"}},{"description":"Exact server-generated correlation ID.","in":"query","name":"correlation_id","schema":{"type":"string"}},{"description":"Exclusive event ID cursor, not an offset; defaults to zero.","in":"query","name":"before_id","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventPage"}}},"description":"Safe history. Lists contain up to 50 rows."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List management audit events","tags":["Audit"],"x-required-scope":"organizations:manage"}},"/v1/organizations/{org}/audit/events/{event}":{"get":{"description":"Current Manager, Supermanager or Administrator access to this organization is required. API keys also need organizations:manage and must belong to this organization or be personal. Events contain safe changed fields, immutable identity labels and no credentials or request content. Historical snapshots never authorize access.","operationId":"get__v1_organizations_org_audit_events_event","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"event","required":true,"schema":{"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEvent"}}},"description":"Safe history. Lists contain up to 50 rows."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Event not found in the permitted scope"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read one management audit event","tags":["Audit"],"x-required-scope":"organizations:manage"}},"/v1/organizations/{org}/audit/revoked-keys":{"get":{"description":"Current Manager, Supermanager or Administrator access to this organization is required. API keys also need organizations:manage and must belong to this organization or be personal. Events contain safe changed fields, immutable identity labels and no credentials or request content. Historical snapshots never authorize access.","operationId":"get__v1_organizations_org_audit_revoked_keys","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"First included calendar date in timezone, YYYY-MM-DD. Defaults to the first day of this month.","in":"query","name":"from","schema":{"type":"string"}},{"description":"Last included calendar date. Defaults to today. The backend uses an exclusive next-day boundary.","in":"query","name":"to","schema":{"type":"string"}},{"description":"IANA timezone; defaults to UTC.","in":"query","name":"timezone","schema":{"type":"string"}},{"description":"Actor ID, email or name; case-insensitive substring for names and email.","in":"query","name":"actor_id","schema":{"type":"string"}},{"description":"Exact object or key ID.","in":"query","name":"object_id","schema":{"type":"string"}},{"description":"Revoked-key history only; 0 to 100000.","in":"query","name":"offset","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokedKeyPage"}}},"description":"Safe history. Lists contain up to 50 rows."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List immutable revoked-key history","tags":["Audit"],"x-required-scope":"organizations:manage"}},"/v1/organizations/{org}/balance-history":{"get":{"description":"Returns manual credits, payment credits and corrections, plus attempts without a ledger entry. Requires manager, assigned client manager or administrator access; API keys require organizations:manage and matching organization binding. Test payments are visible only to administrators. Newest first, 50 entries per page.","operationId":"get_organization_balance_history","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"offset","schema":{"default":0,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/BalanceEntry"},"type":"array"},"has_more":{"type":"boolean"}},"required":["data","has_more"],"type":"object"}}},"description":"Unified history page"},"403":{"description":"Financial access or organization binding denied"}},"summary":"List unified balance activity","tags":["Payments"]}},"/v1/organizations/{org}/client-manager":{"put":{"description":"Administrators may assign or clear any company's sales employee. Lead and regional client managers using browser sessions may reassign a company only when both its current and proposed employees belong to their own branch (including themselves). Leaders cannot clear assignments or claim unassigned companies. The target must already hold a sales role. One employee can serve multiple organizations. Only installation Administrators receive a distinct wrong-role diagnostic; branch-limited sales leaders retain the same not-found response for absent or ineligible users. No role is assigned by this endpoint.","operationId":"put_v1_organizations_org_client_manager","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"user":{"description":"Existing client manager email or user ID; empty string clears the assignment.","type":"string"}},"required":["user"],"type":"object"}}},"required":true},"responses":{"204":{"description":"Assignment updated"},"400":{"description":"invalid_client_manager_role — The selected user does not have the Client manager role. (Administrator-only diagnostic)"},"403":{"description":"Administrator access or an eligible sales leader's own branch required"},"404":{"description":"Organization or eligible client manager not found"}},"summary":"Assign or clear the organization's client manager","tags":["Organizations"]}},"/v1/organizations/{org}/credits":{"get":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"get_v1_organizations_org_credits","parameters":[{"in":"path","name":"org","required":true,"schema":{"type":"string"}},{"in":"query","name":"offset","schema":{"maximum":100000,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OrganizationCredit"},"type":"array"}},"type":"object"}}},"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List latest 50 credits; supports offset","tags":["Organizations"]},"post":{"description":"Administrators can apply payments, promos and corrections. Sales browser sessions require effective topup permission and current client scope; only positive payment credits without an amount ceiling are allowed, with a nonblank reason. external_id makes retries idempotent. Negative corrections, promo credits and API-key delegation are prohibited. Amounts are USD.","operationId":"post_v1_organizations_org_credits","parameters":[{"in":"path","name":"org","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"amount_usd":{"multipleOf":0.000001,"type":"number"},"external_id":{"maxLength":200,"minLength":1,"type":"string"},"kind":{"enum":["payment","promo","adjustment"]},"reason":{"maxLength":1000,"type":"string"}},"required":["amount_usd","kind","external_id"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationCredit"}}},"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Apply an idempotent credit or delegated sales top-up","tags":["Organizations"]}},"/v1/organizations/{org}/generations":{"get":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"get_v1_organizations_org_tasks","parameters":[{"in":"query","name":"offset","schema":{"default":0,"maximum":1000000,"minimum":0,"type":"integer"}},{"in":"path","name":"org","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Generation"},"type":"array"}},"type":"object"}}},"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List organization tasks; members see only their own","tags":["Organizations"]}},"/v1/organizations/{org}/generations/{id}":{"get":{"description":"Organization-scoped access. Browser sessions are supported. Live membership and role checks apply: Managers see metadata only, Content Officers read all retained content, Developers and Members read their own content. Deletion requires Supermanager or ownership as Developer/Member.","operationId":"get_organization__generations_id","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Generation"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Generation not found"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Retrieve asynchronous generation","tags":["Generations"]}},"/v1/organizations/{org}/generations/{id}/content":{"delete":{"description":"Organization-scoped access. Browser sessions are supported. Live membership and role checks apply: Managers see metadata only, Content Officers read all retained content, Developers and Members read their own content. Deletion requires Supermanager or ownership as Developer/Member.","operationId":"delete_organization__generations_id_content","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Stored result files deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Task not found."},"409":{"description":"Generation is still running."},"503":{"description":"Deletion incomplete; retry."}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Delete stored result files and retain task history","tags":["Generations"]},"get":{"description":"Organization-scoped access. Browser sessions are supported. Live membership and role checks apply: Managers see metadata only, Content Officers read all retained content, Developers and Members read their own content. Deletion requires Supermanager or ownership as Developer/Member.","operationId":"get_organization__generations_id_content","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"Stored media"},"206":{"description":"Partial content"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Result not available"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not ready"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Download generation content","tags":["Media"]},"head":{"description":"Organization-scoped access. Browser sessions are supported. Live membership and role checks apply: Managers see metadata only, Content Officers read all retained content, Developers and Members read their own content. Deletion requires Supermanager or ownership as Developer/Member.","operationId":"head_organization__generations_id_content","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"Stored media"},"206":{"description":"Partial content"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Result not available"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not ready"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Inspect generation content","tags":["Media"]}},"/v1/organizations/{org}/generations/{id}/last-frame":{"get":{"description":"Organization-scoped access. Browser sessions are supported. Live membership and role checks apply: Managers see metadata only, Content Officers read all retained content, Developers and Members read their own content. Deletion requires Supermanager or ownership as Developer/Member.","operationId":"get_organization__generations_id_last-frame","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Last frame image"},"206":{"description":"Partial content"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Download the archived video last frame","tags":["Media"],"x-required-scope":"generation"},"head":{"description":"Organization-scoped access. Browser sessions are supported. Live membership and role checks apply: Managers see metadata only, Content Officers read all retained content, Developers and Members read their own content. Deletion requires Supermanager or ownership as Developer/Member.","operationId":"head_organization__generations_id_last-frame","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Last frame headers"},"206":{"description":"Partial content"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read archived last frame headers","tags":["Media"],"x-required-scope":"generation"}},"/v1/organizations/{org}/generations/{id}/media-access":{"get":{"description":"Organization-scoped access. Browser sessions are supported. Live membership and role checks apply: Managers see metadata only, Content Officers read all retained content, Developers and Members read their own content. Deletion requires Supermanager or ownership as Developer/Member.","operationId":"get_organization__generations_id_media-access","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAccess"}}},"description":"Signed access URLs"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Create temporary signed preview and download URLs","tags":["Media"],"x-required-scope":"generation"}},"/v1/organizations/{org}/invitations":{"get":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"get_v1_organizations_org_invitations","parameters":[{"in":"path","name":"org","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OrganizationInvitation"},"type":"array"}},"type":"object"}}},"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List latest 100 invitations","tags":["Organizations"]},"post":{"description":"The issuer must be allowed to assign the selected role: Administrator/Supermanager may assign any organization role; Manager may assign Developer or Member. Omitted role defaults to Member. Key mutations require organizations:manage; system authority additionally requires system:manage.","operationId":"post_v1_organizations_org_invitations","parameters":[{"in":"path","name":"org","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"role":{"default":"member","enum":["supermanager","admin","content_officer","developer","member"],"type":"string"}},"type":"object"}}},"required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationInvitation"}}},"description":"Success"},"400":{"description":"Invalid role or request fields"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Create seven-day single-use invitation with a selected organization role","tags":["Organizations"]}},"/v1/organizations/{org}/invitations/{invite}":{"delete":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"delete_v1_organizations_org_invitations_invite","parameters":[{"in":"path","name":"org","required":true,"schema":{"type":"string"}},{"in":"path","name":"invite","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Revoke invitation","tags":["Organizations"]}},"/v1/organizations/{org}/limits":{"get":{"description":"Administrators only. Positive integer quotas; null organization values inherit the corresponding system default. User counters combine all keys within the same organization; personal keys use a separate counter. Changes apply to subsequent requests, without resetting usage counters. Version guards concurrent edits. Accepted generations continue even if limits are lowered.","operationId":"get_organization_limits","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestLimitPolicy"}}},"description":"System defaults, organization overrides and effective values"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Organization not found"},"409":{"description":"Settings changed; reload before saving"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read organization request limits","tags":["System"],"x-required-scope":"system:manage"},"parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"put":{"description":"Administrators only. Positive integer quotas; null organization values inherit the corresponding system default. User counters combine all keys within the same organization; personal keys use a separate counter. Changes apply to subsequent requests, without resetting usage counters. Version guards concurrent edits. Accepted generations continue even if limits are lowered.","operationId":"put_organization_limits","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestLimitConfig"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestLimitPolicy"}}},"description":"System defaults, organization overrides and effective values"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Organization not found"},"409":{"description":"Settings changed; reload before saving"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Replace organization request limits","tags":["System"],"x-required-scope":"system:manage"}},"/v1/organizations/{org}/markups":{"get":{"description":"Administrators or sales browser sessions with effective pricing permission for this client. The first configured rule wins in this order — company model, company provider, company default, system model, system provider, system default. Zero is an explicit override. System default must be set; company default may be null to inherit. Replacements are atomic and require the current version. Only new tasks use changed rates. Model IDs are exact and scoped to their provider; retired IDs remain valid rules.","operationId":"get_organization_markups","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkupPolicy"}}},"description":"System and organization pricing rules (authorized commercial users only)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Organization not found"},"409":{"description":"Settings changed; reload before saving"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read organization markup rules","tags":["System"],"x-required-scope":"system:manage"},"parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"put":{"description":"Administrators or sales browser sessions with effective pricing permission for this client. The first configured rule wins in this order — company model, company provider, company default, system model, system provider, system default. Zero is an explicit override. System default must be set; company default may be null to inherit. Replacements are atomic and require the current version. Only new tasks use changed rates. Model IDs are exact and scoped to their provider; retired IDs remain valid rules.","operationId":"put_organization_markups","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkupConfig"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkupPolicy"}}},"description":"System and organization pricing rules (authorized commercial users only)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Organization not found"},"409":{"description":"Settings changed; reload before saving"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Replace organization markup rules","tags":["System"],"x-required-scope":"system:manage"}},"/v1/organizations/{org}/markups/catalog":{"get":{"description":"Administrator or browser-session sales employee with pricing permission and access to this client. Does not expose provider credentials or allow global changes.","operationId":"get_organization_markup_catalog","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Provider and model picker metadata in a data array"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"sessionAuth":[]},{"bearerAuth":[]}],"summary":"Read the provider/model picker catalogue for company markup rules","tags":["Organizations"]}},"/v1/organizations/{org}/members":{"get":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"get_v1_organizations_org_members","parameters":[{"in":"path","name":"org","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OrganizationMember"},"type":"array"}},"type":"object"}}},"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List members and weekly spending","tags":["Organizations"]}},"/v1/organizations/{org}/members/{user}":{"delete":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"delete_v1_organizations_org_members_user","parameters":[{"in":"path","name":"org","required":true,"schema":{"type":"string"}},{"in":"path","name":"user","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Remove member and revoke their organization keys","tags":["Organizations"]},"put":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"put_v1_organizations_org_members_user","parameters":[{"in":"path","name":"org","required":true,"schema":{"type":"string"}},{"in":"path","name":"user","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"role":{"enum":["member","admin"]},"weekly_limit_usd":{"description":"Omit to inherit the organization default for a new or restored member, or keep an active member's current limit. Null means unlimited; zero blocks generation.","maximum":1000000,"minimum":0,"type":["number","null"]}},"required":["role"],"type":"object"}}},"required":true},"responses":{"204":{"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Set member role and weekly limit","tags":["Organizations"]}},"/v1/organizations/{org}/payment-methods":{"get":{"description":"Manager or administrator; API keys require organizations:manage. Test methods are visible only to administrators.","operationId":"get_v1_organizations_org_payment_methods","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"currency":{"type":"string"},"data":{"items":{"additionalProperties":false,"properties":{"fee_mode":{"enum":["service","organization"],"type":"string"},"id":{"type":"string"},"kind":{"type":"string"},"live":{"type":"boolean"},"name":{"type":"string"},"stablecoin":{"$ref":"#/components/schemas/StablecoinConfig"}},"type":"object"},"type":"array"},"max_cents":{"type":"integer"},"min_cents":{"type":"integer"}},"type":"object"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"summary":"List enabled top-up methods","tags":["Payments"]}},"/v1/organizations/{org}/payments":{"get":{"description":"Manager only. Read-only: does not reconcile, settle or expire stored payments. Pending or confirming payments past their deadline are projected as expired. Amounts are integer USD cents. credited_cents is the current net contribution after fees, refunds and disputed funds; test payments always show zero credited.","operationId":"get_v1_organizations_org_payments","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"offset","schema":{"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/Payment"},"type":"array"},"has_more":{"type":"boolean"}},"type":"object"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"summary":"List payment history","tags":["Payments"]},"post":{"description":"Stablecoins additionally require network, token and company billing details. Card payments with stripe_invoices=false require company billing details and use the same local VAT rules; Stripe only charges the quoted gross amount, without automatic_tax or invoice_creation. VAT is calculated locally from the installation seller profile and country/registration-status rules. VAT registration must be verified for status-specific treatment. There is no Stripe dependency for stablecoins. The server reserves an exact six-decimal amount including a payment fee below one cent. Manager only. Idempotency is scoped to organization and actor. Reusing the key with a different amount, provider or fee mode returns 409. The supplied fee_mode must match the displayed current provider mode for a new payment. Redirects do not grant credit. Test payments never produce spendable credits.","operationId":"post_v1_organizations_org_payments","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":128,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCheckout"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"summary":"Create or resume a card or stablecoin payment","tags":["Payments"]}},"/v1/organizations/{org}/payments/{id}":{"delete":{"description":"Requires organization management access. Only pending requests can be cancelled. History and the exact amount reservation are retained permanently. Confirming and paid requests return 409.","operationId":"delete_v1_organizations_org_payments_id","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"description":"Cancelled payment"},"403":{"description":"Organization access denied"},"409":{"description":"Payment cannot be cancelled"}},"summary":"Cancel an unpaid stablecoin payment","tags":["Payments"]},"get":{"description":"Checks current management rights and the organization binding of the supplied API key. Read-only: does not create a checkout, reconcile, settle or expire stored payments. Pending or confirming payments past their deadline are projected as expired; terminal states are preserved.","operationId":"get_v1_organizations_org_payments_id","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"summary":"Read a payment","tags":["Payments"]}},"/v1/organizations/{org}/payments/{id}/checkout":{"post":{"description":"Organization manager only. Reuses an open Checkout, or renews it after Stripe confirms the old session expired. Preserves payment ID, invoice, principal and VAT. Paid payments return their settled state. Concurrent requests and lost creation responses share a durable attempt/idempotency key. The same 30-day request deadline applies to native and locally invoiced Stripe requests. No renewal is allowed after expiry. The deadline is creation plus exactly 720 hours; an expired short Stripe session leaves the request pending before that deadline.","operationId":"post_v1_organizations_org_payments_id_checkout","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"description":"Existing payment with current checkout URL or already-paid status"},"403":{"description":"Not an organization manager or wrong organization"},"409":{"description":"Payment cannot currently be resumed or insufficient Stripe Checkout time remains"},"410":{"description":"Payment request expired; create a new payment"},"503":{"description":"Provider unavailable; no replacement is created without verification"}},"summary":"Resume a locally invoiced Stripe payment","tags":["Payments"]}},"/v1/organizations/{org}/payments/{id}/invoice":{"get":{"description":"Organization manager only. Issues an immutable numbered PDF on the first request; retries return the same stored bytes. Available for stablecoins and card payments created with Stripe Invoices disabled. Uses the seller, logo, buyer and VAT snapshot saved with the payment. Due date is the request creation plus 30 days. Stablecoins show a fixed 1 USD = 1 selected token rate. Cancelled requests cannot issue invoices; expired requests can only redownload an already issued PDF. Stripe processor fees are not invoice items.","operationId":"get_v1_organizations_org_payments_id_invoice","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/pdf":{"schema":{"format":"binary","type":"string"}}},"description":"Private PDF attachment with Cache-Control no-store","headers":{"Content-Disposition":{"schema":{"type":"string"}}}},"403":{"description":"Not an organization manager or payment belongs to another organization"},"409":{"description":"Cancelled payment or no usable unpaid card checkout"},"503":{"description":"Payment uses native Stripe invoicing or cannot supply a document"}},"summary":"Generate or download a local invoice PDF","tags":["Payments"]}},"/v1/organizations/{org}/payments/{id}/qr":{"get":{"description":"Organization management access is required. The QR encodes the address only; the accompanying payment card specifies the token, network and exact amount.","operationId":"get_v1_organizations_org_payments_id_qr","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"image/png":{"schema":{"format":"binary","type":"string"}}},"description":"Private address QR image"},"403":{"description":"Organization access denied"},"404":{"description":"Stablecoin payment not found"}},"summary":"Read the receiving-address QR image","tags":["Payments"]}},"/v1/organizations/{org}/payments/{id}/refresh":{"post":{"description":"Fetches current provider state under a payment lock. May return 503 while actual processing fees are not yet available. Safe to retry. Refunds and disputes can reduce available balance below zero.","operationId":"post_v1_organizations_org_payments_id_refresh","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"summary":"Reconcile a payment with Stripe","tags":["Payments"]}},"/v1/organizations/{org}/references":{"get":{"description":"Organization-scoped access. Browser sessions are supported. Live membership and role checks apply: Managers see metadata only, Content Officers read all retained content, Developers and Members read their own content. Deletion requires Supermanager or ownership as Developer/Member.","operationId":"get_organization__references","parameters":[{"in":"query","name":"offset","schema":{"default":0,"maximum":1000000,"minimum":0,"type":"integer"}},{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ReferenceImage"},"type":"array"},"has_more":{"type":"boolean"},"next_offset":{"type":"integer"}},"required":["data","has_more","next_offset"],"type":"object"}}},"description":"Up to 48 files from the authenticated owner's library"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List your reference files, newest first","tags":["References"]}},"/v1/organizations/{org}/references/{id}":{"delete":{"description":"Organization-scoped access. Browser sessions are supported. Live membership and role checks apply: Managers see metadata only, Content Officers read all retained content, Developers and Members read their own content. Deletion requires Supermanager or ownership as Developer/Member.","operationId":"delete_organization__references_id","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"File deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Permanently delete a reference file","tags":["References"]}},"/v1/organizations/{org}/reports":{"get":{"description":"Organization role checks apply. Key mutations require organizations:manage; system-only operations additionally require system:manage. Amounts are USD.","operationId":"get_v1_organizations_org_reports","parameters":[{"description":"Aggregate all matching requests; ignores pagination. Cannot combine with CSV.","in":"query","name":"view","schema":{"enum":["summary"],"type":"string"}},{"description":"Summary calendar buckets in the selected timezone. Weeks start Monday. A range of one month or less has one monthly bucket. Maximum 10000 buckets.","in":"query","name":"interval","schema":{"default":"day","enum":["day","week","month"],"type":"string"}},{"description":"Exact user ID or email (case-insensitive); financial viewers only.","in":"query","name":"user","schema":{"type":"string"}},{"description":"IANA time zone for inclusive from/to calendar dates; CSV timestamps remain UTC.","in":"query","name":"timezone","schema":{"default":"UTC","type":"string"}},{"description":"Export every matching row as CSV; limit and offset are ignored.","in":"query","name":"format","schema":{"enum":["csv"],"type":"string"}},{"in":"path","name":"org","required":true,"schema":{"type":"string"}},{"in":"query","name":"from","schema":{"type":"string"}},{"in":"query","name":"to","schema":{"type":"string"}},{"in":"query","name":"api_key_id","schema":{"type":"string"}},{"description":"Exact generation ID. Combined with the other filters.","in":"query","name":"generation_id","schema":{"format":"uuid","type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer"}},{"in":"query","name":"offset","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ReportSummary"},{"properties":{"data":{"items":{"type":"object"},"type":"array"},"has_more":{"type":"boolean"}},"type":"object"}]}},"text/csv":{"example":"Created at (UTC),Cost (USD)","schema":{"type":"string"}}},"description":"Success"},"403":{"description":"Insufficient role, membership or scope"},"409":{"description":"Last supermanager, used invitation or conflicting payment ID"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Organization expense report; members see their own records","tags":["Organizations"]}},"/v1/organizations/{org}/reports/{id}":{"get":{"description":"Uses live organization membership and the same financial author scope as the Reports list. Manager and client manager receive only status and accounting; Developer and Member can read only their own reports. Returns every retained public generation field and exact saved request settings when content access is allowed. Minimal logging omits prompt, instructions, webhook and references, exposing only retained resolution, ratio, duration and generate_audio. Customer views retain the existing financial sanitization. Provider/storage credentials are never returned.","operationId":"get_v1_organizations_org_reports_id","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}},"description":"Generation details authorized for this viewer"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No generation report in the authorized scope"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read full organization generation report","tags":["Reports"]}},"/v1/organizations/{org}/reports/{id}/content":{"get":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"get_v1_organizations_org_reports_id_content","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file content"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read organization generation result","tags":["Reports"]},"head":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"head_v1_organizations_org_reports_id_content","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file headers"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Inspect organization generation result","tags":["Reports"]}},"/v1/organizations/{org}/reports/{id}/last-frame":{"get":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"get_v1_organizations_org_reports_id_last_frame","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file content"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read organization generation last frame","tags":["Reports"]},"head":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"head_v1_organizations_org_reports_id_last_frame","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file headers"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Inspect organization generation last frame","tags":["Reports"]}},"/v1/organizations/{org}/sales-permissions":{"get":{"description":"Browser session and current organization access required. Evaluates current grants and client assignment; does not grant membership or other organization rights.","operationId":"get_organization_sales_permissions","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"models":{"type":"boolean"},"pricing":{"type":"boolean"},"topup":{"type":"boolean"}},"type":"object"}}},"description":"Current commercial permissions"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"sessionAuth":[]}],"summary":"Read the caller's commercial permissions for this client","tags":["Organizations"]}},"/v1/organizations/{org}/support":{"get":{"description":"Browser session required. Available to current company members, its assigned sales hierarchy and Administrators. Unassigned companies return a null client_manager. Only opt-in links are exposed; no login email or personal settings are returned. API keys cannot read this endpoint.","operationId":"get_organization_support","parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"client_manager":{"properties":{"contacts":{"$ref":"#/components/schemas/ContactLinks"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"picture":{"format":"uri","type":"string"}},"type":["object","null"]}},"required":["client_manager"],"type":"object"}}},"description":"Assigned client manager, if any"},"400":{"description":"Invalid company ID"},"401":{"description":"Sign-in required"},"403":{"description":"Company access or browser session required"},"503":{"description":"Support contacts unavailable"}},"security":[{"sessionAuth":[]}],"summary":"Get your company's client manager and shared contact links","tags":["Organizations"]}},"/v1/organizations/{org}/vat-verification":{"get":{"description":"Organization management access and credential organization binding are required.","operationId":"get_v1_organizations_org_vat_verification","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentVATVerification"}}},"description":"Verification or an empty version-zero record"},"403":{"description":"Organization management access required"}},"summary":"Read administrator verification of buyer VAT registration","tags":["Payments"]},"parameters":[{"in":"path","name":"org","required":true,"schema":{"format":"uuid","type":"string"}}],"put":{"description":"Administrator only. Proof is bound to exact legal name, country and VAT number. Verified records require evidence and expire after 90 days by default, with an explicit maximum of 366 days. Browser-supplied buyer status cannot grant VAT relief.","operationId":"put_v1_organizations_org_vat_verification","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentVATVerification"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentVATVerification"}}},"description":"Saved verification"},"400":{"description":"Invalid verification evidence"},"403":{"description":"Administrator access required"},"409":{"description":"Verification version changed"}},"summary":"Record or revoke manual VAT verification","tags":["Payments"]}},"/v1/payment-integrations/{id}/settlements":{"post":{"description":"Only the dedicated pay_ token issued for this integration is accepted; sessions, Gateway API keys and Stripe keys cannot grant credits. The external ID is globally unique within the integration, with immutable organization and amount. Send cumulative fee/refund/hold totals and monotonically increasing revisions. An identical revision is a no-op; stale or conflicting revisions return 409. The ledger and payment state commit atomically. Test integrations never add spendable funds.","operationId":"post_v1_payment_integrations_id_settlements","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalPaymentSettlement"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"security":[{"paymentIntegrationAuth":[]}],"summary":"Settle an externally confirmed payment","tags":["Payments"]}},"/v1/payments/webhooks/{id}":{"post":{"description":"Raw request body, maximum 256 KiB. Verify Stripe-Signature HMAC with a five-minute tolerance. Test/live and merchant identity must match. Events trigger authoritative reconciliation rather than incremental credits. Disabled Stripe providers continue settling existing payments.","operationId":"post_v1_payments_webhooks_id","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"Stripe-Signature","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}},"required":true},"responses":{"204":{"description":"Verified and processed or safely ignored"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"security":[],"summary":"Receive signed Stripe events","tags":["Payments"]}},"/v1/playground-key/create":{"post":{"description":"Owner-only browser session operation protected against cross-origin mutations. Creates an ordinary generation-only bearer API key named Playground \u0026 Templates with immutable purpose playground_templates. Only this explicit purpose stores an encrypted secret per account and personal/organization workspace; ordinary keys remain hash-only. Concurrent creates converge on the current active key. Retry the same request_id after an uncertain response. Revoked/expired replays fail; a new explicit request is required for replacement. Never creates on login. Responses contain the secret for the authenticated browser and are no-store; use HTTPS. Bearer credentials cannot retrieve this account vault.","operationId":"createManagedPlaygroundKey","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"organization_id":{"description":"Omit for personal workspace.","format":"uuid","type":"string"},"request_id":{"description":"Stable ID retained across retries of this explicit creation.","format":"uuid","type":"string"}},"required":["request_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"key":{"$ref":"#/components/schemas/APIKey"},"secret":{"description":"Sensitive bearer credential returned only to its authenticated owner.","format":"password","type":"string"}},"required":["key","secret"],"type":"object"}}},"description":"Current owned managed key and secret. Generation still requires this ordinary bearer key.","headers":{"Cache-Control":{"description":"no-store, private","schema":{"type":"string"}}}},"400":{"description":"Invalid workspace or request ID."},"401":{"description":"Sign-in required."},"403":{"description":"Session/ownership/issuance policy or cross-origin denial."},"409":{"description":"Superseded request or active-key limit."},"410":{"description":"This creation request refers to a revoked or expired key."},"429":{"description":"Key creation request limit."},"503":{"authentication or storage unavailable; no automatic replacement.":null,"description":"Encryption"}},"security":[{"sessionAuth":[]}],"summary":"Explicitly create an account-managed Playground and Templates key","tags":["API keys"]}},"/v1/playground-key/restore":{"post":{"description":"Owner-only authenticated browser session operation. Does not mint a key or vault a manually pasted key. Returns the encrypted account association's secret into the browser after verifying the ordinary key's current ownership, purpose, generation-only scope, expiry, revocation and membership. Organization managers cannot restore another member's secret. Logout clears local state without deleting the association. Generation APIs still require normal bearer authentication. No secrets occur in the URL; HTTPS is required outside loopback development.","operationId":"restoreManagedPlaygroundKey","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"organization_id":{"description":"Omit for personal workspace.","format":"uuid","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"key":{"$ref":"#/components/schemas/APIKey"},"secret":{"description":"Sensitive bearer credential returned only to its authenticated owner.","format":"password","type":"string"}},"required":["key","secret"],"type":"object"}}},"description":"Saved owned key and secret; never cached.","headers":{"Cache-Control":{"description":"no-store, private","schema":{"type":"string"}}}},"400":{"description":"Invalid workspace."},"401":{"description":"Sign-in required."},"403":{"description":"Owner/session/current access or cross-origin denial."},"404":{"description":"No account-managed key exists."},"410":{"description":"Saved key expired or was revoked; no automatic replacement."},"503":{"description":"Saved key cannot be decrypted or verified."}},"security":[{"sessionAuth":[]}],"summary":"Restore only this account's saved Playground key for one workspace","tags":["API keys"]}},"/v1/projects":{"get":{"description":"Company generation labels shared within the data owner, independent of creator or key recipient. Profile labels remain personal. Requires a generation API key. Does not change history or storage retention.","operationId":"list_projects","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"can_manage_projects":{"description":"Whether the current role can create/rename/delete projects.","type":"boolean"},"data":{"items":{"$ref":"#/components/schemas/GenerationProject"},"type":"array"},"scope":{"enum":["company","personal"],"type":"string"}},"type":"object"}}},"description":"Projects ordered by name"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"List workspace generation projects","tags":["Generations"],"x-required-scope":"generation"},"post":{"description":"Trims the name; rejects empty names, control characters and names longer than 80 Unicode characters. A case-insensitive same-name retry returns the oldest existing project (created_at, then ID). Company labels are shared; Profile labels remain personal. Existing duplicate names/IDs are preserved. JSON limit 4 KiB.","operationId":"create_project","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"name":{"maxLength":80,"minLength":1,"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationProject"}}},"description":"Created or existing project"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Create a workspace generation project","tags":["Generations"],"x-required-scope":"generation"}},"/v1/projects/{project}":{"delete":{"description":"Requires confirmation and the current version. Clears project tags atomically; never deletes generation rows, request content, result records or media files. Concurrent submissions either retain their generation with no project or fail validation.","operationId":"delete_project","parameters":[{"in":"path","name":"project","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"version":{"format":"int64","minimum":1,"type":"integer"}},"required":["version"],"type":"object"}}},"required":true},"responses":{"204":{"description":"Project deleted; generation and media records preserved"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Version or name conflict; review current project before retrying"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Delete a workspace project","tags":["Generations"],"x-required-scope":"generation"},"patch":{"description":"Requires the current version. Conflicts require reading the current project before another write.","operationId":"patch_project","parameters":[{"in":"path","name":"project","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"name":{"maxLength":80,"minLength":1,"type":"string"},"version":{"format":"int64","minimum":1,"type":"integer"}},"required":["name","version"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationProject"}}},"description":"Updated project"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Version or name conflict; review current project before retrying"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Rename a workspace project","tags":["Generations"],"x-required-scope":"generation"}},"/v1/provider-resource-jobs/{id}":{"get":{"operationId":"getProviderResourceJob","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderResourceJob"}}},"description":"Sanitized lifecycle status; no provider task handle."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Poll an owner-bound management job","tags":["References"],"x-required-scope":"generation"}},"/v1/provider-resource-presets":{"get":{"description":"Lists official presets only, never account-wide custom inventory. Import tickets expire after five minutes and bind the data owner, provider owner and actual connection revision and selected authorized media consumer. Native IDs, previews and upstream URLs are private. A video preset without inspectable source evidence is explicitly unavailable.","operationId":"listOfficialResourcePresets","parameters":[{"in":"query","name":"provider","required":true,"schema":{"type":"string"}},{"description":"Selected authorized media consumer ID or public alias.","in":"query","name":"workflow_model","required":true,"schema":{"type":"string"}},{"in":"query","name":"kind","required":true,"schema":{"enum":["element","voice"],"type":"string"}},{"in":"query","name":"page","schema":{"default":1,"maximum":1000,"minimum":1,"type":"integer"}},{"in":"query","name":"size","schema":{"default":30,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OfficialResourcePreset"},"type":"array"},"has_more":{"type":"boolean"},"kind":{"enum":["element","voice"],"type":"string"},"object":{"const":"list","type":"string"},"page":{"type":"integer"},"provider":{"type":"string"},"size":{"type":"integer"},"workflow_model":{"description":"Canonical selected consumer ID.","type":"string"}},"required":["object","provider","workflow_model","kind","page","size","has_more","data"],"type":"object"}}},"description":"Official preset descriptors with opaque short-lived import tickets."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Discover official presets accepted by an authorized model","tags":["References"],"x-required-scope":"generation"}},"/v1/provider-resource-presets/import":{"post":{"description":"Reauthorizes the ticket against current model access and actual connection revision and selected authorized media consumer. Creates or reuses a local read-only binding without a provider registration request, generation job or provider charge. Raw provider IDs and caller-provided source metadata are rejected.","operationId":"importOfficialResourcePreset","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"provider":{"type":"string"},"ticket":{"maxLength":16384,"type":"string"},"workflow_model":{"description":"Same authorized media consumer used to discover this ticket.","type":"string"}},"required":["provider","workflow_model","ticket"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderResource"}}},"description":"Imported owner-local read-only binding; repeated import reuses its identity."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Existing identity belongs to a custom or unavailable binding."},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Import a read-only official preset as an owner-local binding","tags":["References"],"x-required-scope":"generation"}},"/v1/provider-resources":{"get":{"operationId":"listProviderResources","parameters":[{"in":"query","name":"provider","required":true,"schema":{"type":"string"}},{"in":"query","name":"kind","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"offset","schema":{"default":0,"maximum":1000000,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ProviderResource"},"type":"array"},"limit":{"type":"integer"},"object":{"const":"list","type":"string"},"offset":{"type":"integer"}},"type":"object"}}},"description":"Local bindings only; never account-wide provider inventory."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"List owner-bound provider resources","tags":["References"],"x-required-scope":"generation"},"post":{"description":"Requires workflow_model for a current authorized media consumer whose input schema accepts this preparation. This is not standalone resource management. Uses the normal model authorization, request limits, pricing, idempotency and cost-cap gates. Inputs are inspected owner-authorized local references or an eligible archived generation; remote IDs and client metadata are rejected. Unknown tariffs return 422. A successful generation contains local resources binding IDs.","operationId":"createProviderResource","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderResourceCreate"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Resource creation admitted; poll the returned generation status URL."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Idempotency conflict or estimate increased; no new work admitted."},"422":{"description":"A verified tariff or capped total is unavailable; no provider submission."},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Prepare an input for an authorized media workflow","tags":["References"],"x-required-scope":"generation"}},"/v1/provider-resources/estimate":{"post":{"operationId":"estimateProviderResource","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderResourceCreate"}}},"required":true},"responses":{"200":{"description":"Normal cost estimate; a known tariff with unknown quantity omits the total."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Verified pricing unavailable."}},"summary":"Inspect resource sources and quote without submitting","tags":["References"],"x-required-scope":"generation"}},"/v1/provider-resources/{id}":{"get":{"operationId":"getProviderResource","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderResource"}}},"description":"Resource metadata with local IDs only."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Read local resource state and usability","tags":["References"],"x-required-scope":"generation"},"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}]},"/v1/provider-resources/{id}/actions/{action}":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"action","required":true,"schema":{"enum":["add","delete","clear","preview"],"type":"string"}}],"post":{"description":"Uses only an authorized local session binding and its exact revision. Native IDs, source evidence and upstream URLs are never accepted. Mutations serialize with active work; an uncertain mutation makes the session unusable until an explicitly requested recovery clear. Coordinates retain exact submitted precision. Unknown prices cannot be submitted.","operationId":"actOnProviderResource","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderResourceAction"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Normal asynchronous generation; poll its status URL and read archived artifacts."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"active work or changed estimate.":null,"description":"Idempotency conflict"},"422":{"description":"Verified price unavailable."},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Admit a priced typed session action","tags":["References"],"x-required-scope":"generation"}},"/v1/provider-resources/{id}/actions/{action}/estimate":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"action","required":true,"schema":{"enum":["add","delete","clear","preview"],"type":"string"}}],"post":{"description":"Uses only an authorized local session binding and its exact revision. Native IDs, source evidence and upstream URLs are never accepted. Mutations serialize with active work; an uncertain mutation makes the session unusable until an explicitly requested recovery clear. Coordinates retain exact submitted precision. Unknown prices cannot be submitted.","operationId":"estimateProviderResourceAction","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderResourceAction"}}},"required":true},"responses":{"200":{"description":"Normal cost estimate; no provider call."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"active work or changed estimate.":null,"description":"Idempotency conflict"},"422":{"description":"Verified price unavailable."},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Quote a typed session action without provider submission","tags":["References"],"x-required-scope":"generation"}},"/v1/providers":{"get":{"description":"Enabled, configured providers with their available models and capability flags. Use this catalog before constructing generation requests. The mock provider produces fixed test assets without paid inference.","operationId":"get_v1_providers","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ProviderDescriptor"},"type":"array"}},"required":["data"],"type":"object"}}},"description":"Provider and model catalog"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"List enabled and configured generation providers","tags":["Catalog"],"x-required-scope":"generation"}},"/v1/references":{"get":{"description":"Requires the generation scope when using a personal API key.","operationId":"get_v1_references","parameters":[{"in":"query","name":"offset","schema":{"default":0,"maximum":1000000,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ReferenceImage"},"type":"array"},"has_more":{"type":"boolean"},"next_offset":{"type":"integer"}},"required":["data","has_more","next_offset"],"type":"object"}}},"description":"Up to 48 files from the authenticated owner's library"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"List your reference files, newest first","tags":["References"]},"post":{"description":"Local storage only; S3 returns 409 direct_upload_required before reading the body. Use POST /v1/references/uploads for S3. Saves a PNG, JPEG, WebP or GIF (30 MiB), MP4, MOV or WebM (200 MiB), or MP3, WAV, OGG or FLAC (50 MiB) in the organization's selected local storage, under \u003corganization-id\u003e/references/. Non-administrators must use shared storage or personal S3 storage. Requires generation scope. Uploading does not create a generation task. The server inspects type, metadata and common size limits before persistence. Optional multipart validation contains a JSON ReferenceValidationTarget; its current model constraints apply before retention. No model means common requirements only, with no universal FPS minimum. Identical content (SHA-256) is reused within the same organization, regardless of uploader or filename. Returns 200 and duplicate=true for an existing file; no additional file is saved.","operationId":"post_v1_references","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"},"validation":{"description":"JSON-encoded ReferenceValidationTarget","type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceImage"}}},"description":"Identical file already exists; the existing file is returned with duplicate=true"},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceImage"}}},"description":"File saved in the reusable library"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"S3 requires direct upload; use POST /v1/references/uploads"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Upload one reference file to local storage","tags":["References"]}},"/v1/references/providers/{provider}/assets":{"get":{"description":"Requires generation scope and current content permissions; Developers and Members are restricted to their own bindings.","operationId":"list_workspace_provider_assets","parameters":[{"in":"query","name":"offset","schema":{"default":0,"maximum":1000000,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderAssetBindings"}}},"description":"Workspace assets"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Library not configured","or asset in use/shared.":null,"registration unresolved":null},"502":{"description":"Provider asset operation failed; an uncertain registration must not be repeated blindly."}},"summary":"List and refresh workspace asset bindings","tags":["References"]},"parameters":[{"description":"Selected provider connection ID.","in":"path","name":"provider","required":true,"schema":{"type":"string"}}],"post":{"description":"Requires write content access. The original remains in My storage and cannot be deleted during ingestion. Uses a signed HTTPS URL; never accepts arbitrary external URLs. Duplicate source registrations reuse their durable binding. A 202 response is preparation state, not proof of readiness. Wait for Active before using uri. Uncertain creates are reconciled without automatic resubmission.","operationId":"register_provider_asset","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"group_id":{"type":"string"},"reference_id":{"format":"uuid","type":"string"}},"required":["reference_id","group_id"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderAssetBinding"}}},"description":"Registration state"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Library not configured","or asset in use/shared.":null,"registration unresolved":null},"502":{"description":"Provider asset operation failed; an uncertain registration must not be repeated blindly."}},"summary":"Register a Gateway reference with the selected provider","tags":["References"]}},"/v1/references/providers/{provider}/assets/{id}":{"delete":{"description":"Requires write content access. Without detach, permanently deletes from BytePlus after checking queued/running tasks and other workspace bindings. The My storage original is retained. Pending/unknown registrations cannot be detached. Failures preserve retryable state; deletion markers block new task admission.","operationId":"delete_workspace_provider_asset","parameters":[{"description":"Remove only this workspace binding; retain the remote asset.","in":"query","name":"detach","schema":{"enum":["1"],"type":"string"}}],"responses":{"204":{"description":"Asset deleted or workspace binding removed"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Library not configured","or asset in use/shared.":null,"registration unresolved":null},"502":{"description":"Provider asset operation failed; an uncertain registration must not be repeated blindly."}},"summary":"Delete a remote asset or detach its workspace binding","tags":["References"]},"get":{"operationId":"get_workspace_provider_asset","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderAssetBinding"}}},"description":"Asset binding"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Library not configured","or asset in use/shared.":null,"registration unresolved":null},"502":{"description":"Provider asset operation failed; an uncertain registration must not be repeated blindly."}},"summary":"Refresh one workspace asset binding","tags":["References"]},"parameters":[{"description":"Selected provider connection ID.","in":"path","name":"provider","required":true,"schema":{"type":"string"}},{"description":"Gateway binding UUID, not the remote asset ID.","in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}]},"/v1/references/providers/{provider}/groups":{"get":{"description":"Requires generation scope and content access. Remote inventory needs ownership of the personal provider or system administration; generation-only keys need a matching administrator browser session.","operationId":"list_provider_asset_groups","parameters":[{"description":"List remote account groups instead of workspace bindings.","in":"query","name":"inventory","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderAssetGroups"}}},"description":"Groups and inventory permission"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Library not configured","or asset in use/shared.":null,"registration unresolved":null},"502":{"description":"Provider asset operation failed; an uncertain registration must not be repeated blindly."}},"summary":"List workspace or authorized remote asset groups","tags":["References"]},"parameters":[{"description":"Selected provider connection ID.","in":"path","name":"provider","required":true,"schema":{"type":"string"}}],"post":{"operationId":"create_provider_asset_group","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"name":{"maxLength":64,"minLength":1,"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderAssetGroup"}}},"description":"Group created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Library not configured","or asset in use/shared.":null,"registration unresolved":null},"502":{"description":"Provider asset operation failed; an uncertain registration must not be repeated blindly."}},"summary":"Create and bind a virtual portrait group","tags":["References"]}},"/v1/references/providers/{provider}/import":{"parameters":[{"description":"Selected provider connection ID.","in":"path","name":"provider","required":true,"schema":{"type":"string"}}],"post":{"description":"Same permissions as remote inventory; verifies that the asset belongs to an AIGC group in the configured project. Repeated imports reuse the binding.","operationId":"import_provider_asset","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"asset_id":{"type":"string"}},"required":["asset_id"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderAssetBinding"}}},"description":"Imported binding"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Library not configured","or asset in use/shared.":null,"registration unresolved":null},"502":{"description":"Provider asset operation failed; an uncertain registration must not be repeated blindly."}},"summary":"Bind an existing remote asset to the workspace","tags":["References"]}},"/v1/references/providers/{provider}/inventory":{"get":{"description":"Requires personal provider ownership or system administration. Results are provider assets, not workspace bindings. This does not grant other organizations access.","operationId":"list_remote_provider_assets","parameters":[{"in":"query","name":"group","schema":{"type":"string"}},{"description":"Unmodified continuation token from the preceding page.","in":"query","name":"next","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderAssetInventory"}}},"description":"Remote assets"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Library not configured","or asset in use/shared.":null,"registration unresolved":null},"502":{"description":"Provider asset operation failed; an uncertain registration must not be repeated blindly."}},"summary":"Browse authorized remote account inventory","tags":["References"]},"parameters":[{"description":"Selected provider connection ID.","in":"path","name":"provider","required":true,"schema":{"type":"string"}}]},"/v1/references/uploads":{"post":{"description":"Requires generation scope. Send metadata only. For S3, returns a signed PUT target for a single multipart part. Presigned URL targets expire after 15 minutes; B2 uses timestamped SigV4 upload headers. Upload the exact file bytes with the returned headers directly to that URL, without Gateway credentials, then call the completion endpoint within 30 minutes. The SHA-256 must be the lowercase hexadecimal hash of the entire file. S3 verifies it. Maximum sizes are 30 MiB for images, 200 MiB for video and 50 MiB for audio. A duplicate returns mode=existing and reference. Local storage returns mode=local; only in this mode use POST /v1/references with multipart/form-data. Browser transfers require bucket CORS for the frontend origin and PUT/GET/HEAD; saving the storage connection configures missing access automatically when the key has CORS management rights. B2 targets use payload-signed Authorization and x-amz-date headers; send all target headers. CORS must explicitly allow Authorization for B2.","operationId":"post_v1_references_uploads","requestBody":{"content":{"application/json":{"schema":{"properties":{"content_type":{"example":"image/png","type":"string"},"name":{"type":"string"},"sha256":{"pattern":"^[0-9a-f]{64}$","type":"string"},"size_bytes":{"maximum":209715200,"minimum":1,"type":"integer"},"validation":{"$ref":"#/components/schemas/ReferenceValidationTarget"}},"required":["name","content_type","size_bytes","sha256"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Existing file; mode=existing and reference contains its library entry"},"201":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"mode":{"enum":["s3","local"],"type":"string"},"target":{"properties":{"headers":{"additionalProperties":{"type":"string"},"type":"object"},"url":{"format":"uri","type":"string"}},"type":"object"}},"type":"object"}}},"description":"Upload prepared"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Prepare a direct reference upload","tags":["References"]}},"/v1/references/uploads/{id}/complete":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"post":{"description":"Requires the same owner and generation scope as preparation. Verifies S3 metadata and bounded actual bytes before retaining a selectable reference. Uses the model context pinned at preparation and current authorized model limits. A rejected upload is marked durably before temporary-object cleanup; transient cleanup failures retain the receipt for worker recovery. Verifies the single part size and pinned ETag after storage has validated the signed SHA-256 payload header, consumes the multipart upload ID and adds the file to the library. Retry this endpoint if the response is lost; successful completions return the same file while the upload receipt remains available (at least 90 minutes from preparation). No file body is sent. Failed or abandoned uploads are reclaimed by the worker after expiry.","operationId":"post_v1_references_uploads_id_complete","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceImage"}}},"description":"Saved reference or existing duplicate"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"410":{"description":"Upload expired; prepare a new upload"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Verify and finish a direct reference upload","tags":["References"]}},"/v1/references/validate":{"post":{"description":"Read-only byte inspection using the same owner, organization, author and model-access restrictions as reference use. Never fetches supplied URLs, changes library entries, estimates or creates a task. Missing inputs are permitted; known files must satisfy the current model's constraints.","operationId":"validateReferenceSelection","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"reference_ids":{"items":{"format":"uuid","type":"string"},"maxItems":64,"type":"array"},"validation":{"$ref":"#/components/schemas/ReferenceValidationTarget"}},"type":"object"}}},"required":true},"responses":{"200":{"body contains valid=true":null,"description":"References are valid"},"400":{"actual value":null,"allowed bound and corrective action":null,"description":"Invalid reference with the affected file"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Reference is unavailable to this owner or content author"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Check owned stored references against the selected model","tags":["References"]}},"/v1/references/{id}":{"delete":{"description":"Deletes the physical file from its original storage and removes its library entry. Pending generations using its URL may fail. Provider registrations still ingesting this source block deletion with 409. Requires generation scope and current write content permissions; Developers and Members can delete their own files, Supermanagers can delete workspace files, and other organizations receive 404. Storage failures preserve metadata for a retry.","operationId":"delete_v1_references_id","responses":{"204":{"description":"File deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Permanently delete a reference file","tags":["References"]},"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}]},"/v1/sales/bonuses":{"get":{"description":"Browser sessions only. Administrators see all sales employees and former employees with ledger entries. Sales employees see themselves and current descendants. Balances include immutable accruals, corrections and recorded payouts; negative balances are allowed.","operationId":"get_sales_bonuses","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"actor_id":{"format":"uuid","type":"string"},"administrator":{"type":"boolean"},"people":{"items":{"properties":{"accrued_usd":{"type":"number"},"balance_usd":{"type":"number"},"can_pay":{"type":"boolean"},"email":{"type":"string"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"paid_usd":{"type":"number"},"picture":{"format":"uri","type":"string"},"role":{"type":"string"}},"type":"object"},"type":"array"},"settings":{"$ref":"#/components/schemas/BonusSettings"}},"type":"object"}}},"description":"Scoped balances and global rates"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"sessionAuth":[]}],"summary":"Read USD bonus balances for self and descendants","tags":["Organizations"]}},"/v1/sales/bonuses/{employee}/entries":{"get":{"operationId":"get_sales_bonus_entries","parameters":[{"in":"path","name":"employee","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"offset","schema":{"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/BonusEntry"},"type":"array"},"has_more":{"type":"boolean"}},"type":"object"}}},"description":"Up to 50 latest entries, newest first"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"sessionAuth":[]}],"summary":"Read immutable bonus history","tags":["Organizations"]}},"/v1/sales/bonuses/{employee}/payouts":{"post":{"description":"Browser administrator or ancestor with effective bonuses permission. Self-payments are forbidden. A positive amount is subtracted from the balance, which may become negative. This records a payment without sending money. The external ID makes retries idempotent per actor; changed content conflicts. Every payment is audited.","operationId":"post_sales_bonus_payout","parameters":[{"in":"path","name":"employee","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"amount_usd":{"exclusiveMinimum":0,"type":"number"},"external_id":{"format":"uuid","type":"string"},"method":{"maxLength":200,"minLength":1,"type":"string"},"paid_at":{"format":"date","type":"string"},"reason":{"maxLength":1000,"type":"string"}},"required":["amount_usd","paid_at","method","external_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"int64","type":"integer"}},"type":"object"}}},"description":"Recorded or existing payment ID"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Same operation ID with different payment details"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"sessionAuth":[]}],"summary":"Record an already completed bonus payment","tags":["Organizations"]}},"/v1/sales/permissions":{"get":{"description":"Browser sessions only. Administrators see all sales employees; sales employees see themselves and descendants. Includes the current shared hierarchy/permission version and grant issuer/time. No permissions are granted by default.","operationId":"get_sales_permissions","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"actor_id":{"format":"uuid","type":"string"},"administrator":{"type":"boolean"},"grants":{"items":{"$ref":"#/components/schemas/SalesGrant"},"type":"array"},"members":{"items":{"$ref":"#/components/schemas/SalesMember"},"type":"array"},"version":{"minimum":1,"type":"integer"}},"required":["version","actor_id","administrator","members","grants"],"type":"object"}}},"description":"Effective grants and scoped employee directory"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"sessionAuth":[]}],"summary":"Read effective sales permissions for self and team","tags":["Organizations"]}},"/v1/sales/permissions/{employee}/{permission}":{"put":{"description":"Browser sessions only. An administrator may grant to any sales employee. A supervisor may grant only their own effective permissions to descendants. Any ancestor may revoke. Self-grants are forbidden. Replacing or revoking a grant permanently revokes its dependent delegations. A shared version prevents stale edits. All changes are audited.","operationId":"put_sales_permission","parameters":[{"in":"path","name":"employee","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"permission","required":true,"schema":{"enum":["pricing","models","topup","bonuses"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"version":{"minimum":1,"type":"integer"}},"required":["enabled","version"],"type":"object"}}},"required":true},"responses":{"204":{"description":"Saved"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Permissions or hierarchy changed; reload before saving"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"sessionAuth":[]}],"summary":"Grant, replace or revoke a sales permission","tags":["Organizations"]}},"/v1/sales/team":{"get":{"description":"Lead/regional client manager browser session only. Returns the caller and their direct/indirect sales reports. Ordinary client managers and API keys are rejected.","operationId":"get__v1_sales_team","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SalesMember"},"type":"array"}},"type":"object"}}},"description":"Authorized employees only"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"sessionAuth":[]}],"summary":"Read a sales leader's own reassignment roster","tags":["Organizations"]}},"/v1/storage/usage":{"get":{"description":"Requires a generation key. Counts currently stored shared files across all keys and all time. Applies is false for keys using personal storage. Exceeded means used_bytes is strictly greater than limit_bytes; null limit means unlimited.","operationId":"getStorageUsage","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"applies":{"type":"boolean"},"exceeded":{"type":"boolean"},"limit_bytes":{"format":"int64","type":["integer","null"]},"unknown_objects":{"description":"Legacy files whose sizes are being verified.","type":"integer"},"used_bytes":{"format":"int64","type":"integer"}},"type":"object"}}},"description":"Shared storage usage"},"401":{"$ref":"#/components/responses/Unauthorized"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Read the caller's current shared-storage usage","tags":["Storage"]}},"/v1/system/billing":{"get":{"description":"Administrator only; API keys require system management access. No seller country or VAT rate is preset.","operationId":"get_v1_system_billing","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentVATSettings"}}},"description":"Versioned installation billing policy"},"403":{"description":"Administrator access required"}},"summary":"Read installation seller company and VAT rules","tags":["Payments"]},"put":{"description":"Administrator only. Maximum request body is 1 MiB, including an optional embedded invoice logo. Rules are explicit, versioned and audited. Missing cases do not default to zero VAT. Existing payment snapshots remain immutable.","operationId":"put_v1_system_billing","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentVATSettings"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentVATSettings"}}},"description":"Saved policy"},"400":{"description":"Invalid company or VAT rules"},"403":{"description":"Administrator access required"},"409":{"description":"Policy version changed"}},"summary":"Save installation seller company and VAT rules","tags":["Payments"]}},"/v1/system/branding":{"get":{"description":"Requires an administrator role. Uses an independent appearance version.","operationId":"get_site_branding","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"colors":{"items":{"properties":{"group":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"}},"type":"object"},"type":"array"},"defaults":{"$ref":"#/components/schemas/SiteBranding"},"settings":{"$ref":"#/components/schemas/SiteBranding"}},"type":"object"}}},"description":"Appearance editor data"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read installation appearance, defaults and color catalog","tags":["System"],"x-required-scope":"system:manage"},"put":{"description":"Requires an administrator role. Send complete settings and their current version. Assets are base64 PNG, JPEG or passive SVG up to 512 KiB each; email_logo and touch_icon require PNG or JPEG. Omit an asset to remove that override. Request limit 6 MiB. Changes are atomic and audited.","operationId":"put_site_branding","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteBranding"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteBranding"}}},"description":"Saved appearance with incremented version"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Another administrator saved a newer appearance version"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Replace installation appearance","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/catalog/documents/{hash}":{"get":{"description":"Requires a current system Administrator role. Responses use Cache-Control: no-store. See docs/catalog-sync.md for publication and warning semantics.","operationId":"get_v1_system_catalog_documents_hash","parameters":[{"in":"path","name":"hash","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"hash":{"type":"string"},"text":{"type":"string"}},"type":"object"}}},"description":"Catalogue synchronization result"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Administrator role or scope required"},"503":{"description":"Catalogue synchronization unavailable"}},"security":[{"sessionAuth":[]},{"bearerAuth":[]}],"summary":"Read stored catalogue source evidence","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/catalog/providers/{id}":{"get":{"description":"Requires a current system Administrator role. Responses use Cache-Control: no-store. See docs/catalog-sync.md for publication and warning semantics.","operationId":"get_v1_system_catalog_providers_id","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogState"}}},"description":"Catalogue synchronization result"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Administrator role or scope required"},"503":{"description":"Catalogue synchronization unavailable"}},"security":[{"sessionAuth":[]},{"bearerAuth":[]}],"summary":"Read current catalogue and unresolved warnings","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/catalog/providers/{id}/versions":{"get":{"description":"Requires a current system Administrator role. Responses use Cache-Control: no-store. See docs/catalog-sync.md for publication and warning semantics.","operationId":"get_v1_system_catalog_providers_id_versions","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"offset","required":false,"schema":{"default":0,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CatalogState"},"type":"array"},"has_more":{"type":"boolean"}},"required":["data","has_more"],"type":"object"}}},"description":"Catalogue synchronization result"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Administrator role or scope required"},"503":{"description":"Catalogue synchronization unavailable"}},"security":[{"sessionAuth":[]},{"bearerAuth":[]}],"summary":"List immutable published catalogue versions","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/catalog/runs":{"get":{"description":"Requires a current system Administrator role. Responses use Cache-Control: no-store. See docs/catalog-sync.md for publication and warning semantics.","operationId":"get_v1_system_catalog_runs","parameters":[{"in":"query","name":"provider","required":false,"schema":{"type":"string"}},{"in":"query","name":"offset","required":false,"schema":{"default":0,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CatalogRun"},"type":"array"},"has_more":{"type":"boolean"}},"required":["data","has_more"],"type":"object"}}},"description":"Catalogue synchronization result"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Administrator role or scope required"},"503":{"description":"Catalogue synchronization unavailable"}},"security":[{"sessionAuth":[]},{"bearerAuth":[]}],"summary":"List catalogue checks including unchanged checks","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/catalog/schedules":{"get":{"description":"Requires a current system Administrator role. Responses use Cache-Control: no-store. See docs/catalog-sync.md for publication and warning semantics.","operationId":"get_v1_system_catalog_schedules","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CatalogSchedule"},"type":"array"}},"type":"object"}}},"description":"Catalogue synchronization result"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Administrator role or scope required"},"503":{"description":"Catalogue synchronization unavailable"}},"security":[{"sessionAuth":[]},{"bearerAuth":[]}],"summary":"List per-provider catalogue schedules","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/catalog/schedules/{id}":{"put":{"description":"Requires a current system Administrator role. Responses use Cache-Control: no-store. See docs/catalog-sync.md for publication and warning semantics.","operationId":"put_v1_system_catalog_schedules_id","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogSchedule"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogSchedule"}}},"description":"Catalogue synchronization result"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Administrator role or scope required"},"409":{"description":"Version changed. Reload before saving."},"503":{"description":"Catalogue synchronization unavailable"}},"security":[{"sessionAuth":[]},{"bearerAuth":[]}],"summary":"Update provider daily time and sources","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/catalog/schedules/{id}/check":{"post":{"description":"Requires a current system Administrator role. Responses use Cache-Control: no-store. See docs/catalog-sync.md for publication and warning semantics.","operationId":"post_v1_system_catalog_schedules_id_check","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"queued":{"type":"boolean"}},"type":"object"}}},"description":"Catalogue synchronization result"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Administrator role or scope required"},"503":{"description":"Catalogue synchronization unavailable"}},"security":[{"sessionAuth":[]},{"bearerAuth":[]}],"summary":"Queue a provider catalogue check","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/catalog/settings":{"get":{"description":"Requires a current system Administrator role. Responses use Cache-Control: no-store. See docs/catalog-sync.md for publication and warning semantics.","operationId":"get_v1_system_catalog_settings","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogSyncSettings"}}},"description":"Catalogue synchronization result"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Administrator role or scope required"},"503":{"description":"Catalogue synchronization unavailable"}},"security":[{"sessionAuth":[]},{"bearerAuth":[]}],"summary":"Read catalogue timezone and report recipient","tags":["System"],"x-required-scope":"system:manage"},"put":{"description":"Requires a current system Administrator role. Responses use Cache-Control: no-store. See docs/catalog-sync.md for publication and warning semantics.","operationId":"put_v1_system_catalog_settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogSyncSettings"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogSyncSettings"}}},"description":"Catalogue synchronization result"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Administrator role or scope required"},"409":{"description":"Version changed. Reload before saving."},"503":{"description":"Catalogue synchronization unavailable"}},"security":[{"sessionAuth":[]},{"bearerAuth":[]}],"summary":"Update common catalogue settings","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/email":{"get":{"description":"Requires a current administrator. Returns available mail providers and saved sender settings; never returns the API key or its ciphertext.","operationId":"get_v1_system_email","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailDeliverySettings"}}},"description":"Email delivery settings"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"sessionAuth":[]}],"summary":"Read email delivery provider settings","tags":["System"],"x-required-scope":"system:manage"},"put":{"description":"Requires a current system administrator. Resend requires an API key and a sender address on a verified domain. An omitted or empty api_key keeps the saved key. An empty provider removes the connection and key. Changes apply immediately without restart. Saving validates the input format; it does not send a test email or verify the key with Resend. Audited without secrets. Version prevents overwriting another administrator's edit.","operationId":"put_v1_system_email","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"api_key":{"maxLength":512,"type":"string","writeOnly":true},"from":{"example":"Sociaro \u003clogin@example.com\u003e","maxLength":320,"type":"string"},"provider":{"enum":["","resend"],"type":"string"},"version":{"format":"int64","minimum":1,"type":"integer"}},"required":["provider","from","version"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailDeliverySettings"}}},"description":"Saved settings"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Settings changed; reload before saving"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"sessionAuth":[]}],"summary":"Configure or remove an email delivery provider","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/installation-access":{"get":{"description":"Central system Administrator browser session only. One summary for the organization table; excludes expired/revoked keys and deferred company-interface grants. Returns organization_id and active_count.","operationId":"summarizeOrganizationInstallationAccess","responses":{"200":{"description":"Active installation access counts"},"403":{"description":"Central Administrator browser session required"}},"security":[{"sessionAuth":[]}],"summary":"Read active installation-key counts by company"}},"/v1/system/legal/{kind}":{"get":{"operationId":"get_v1_system_legal_kind","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocument"}}},"description":"Saved override and optimistic concurrency token"},"401":{"description":"Authentication required"},"403":{"description":"Administrator required"}},"summary":"Read legal document settings (Administrator only)"},"parameters":[{"in":"path","name":"kind","required":true,"schema":{"enum":["privacy","terms"],"type":"string"}}],"put":{"operationId":"put_v1_system_legal_kind","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocument"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocument"}}},"description":"Saved document with incremented concurrency token"},"400":{"description":"Invalid text","version or request body":null},"401":{"description":"Authentication required"},"403":{"description":"Administrator required"},"409":{"description":"Document changed since it was opened"}},"summary":"Publish or reset a plain-text legal document (Administrator only)"}},"/v1/system/limits":{"get":{"description":"Administrators only. Positive integer quotas; null organization values inherit the corresponding system default. User counters combine all keys within the same organization; personal keys use a separate counter. Changes apply to subsequent requests, without resetting usage counters. Version guards concurrent edits. Accepted generations continue even if limits are lowered.","operationId":"get_system_limits","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestLimitPolicy"}}},"description":"System defaults, organization overrides and effective values"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Organization not found"},"409":{"description":"Settings changed; reload before saving"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read system request limits","tags":["System"],"x-required-scope":"system:manage"},"put":{"description":"Administrators only. Positive integer quotas; null organization values inherit the corresponding system default. User counters combine all keys within the same organization; personal keys use a separate counter. Changes apply to subsequent requests, without resetting usage counters. Version guards concurrent edits. Accepted generations continue even if limits are lowered.","operationId":"put_system_limits","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestLimitConfig"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestLimitPolicy"}}},"description":"System defaults, organization overrides and effective values"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Organization not found"},"409":{"description":"Settings changed; reload before saving"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Replace system request limits","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/login-providers":{"get":{"operationId":"get_v1_system_login_providers","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"available_providers":{"items":{"properties":{"id":{"type":"string"},"name":{"type":"string"}},"type":"object"},"type":"array"},"data":{"items":{"$ref":"#/components/schemas/LoginProvider"},"type":"array"},"email_delivery_configured":{"type":"boolean"}},"type":"object"}}},"description":"Provider cards, supported methods and email delivery readiness; secrets are never returned"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List login providers and available methods","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/login-providers/{provider}":{"parameters":[{"in":"path","name":"provider","required":true,"schema":{"enum":["google","email"],"type":"string"}}],"put":{"description":"Administrator only. Updates apply to new authentication attempts immediately; existing users and sessions are preserved. Google credentials are encrypted. An omitted Client Secret preserves the saved secret. Email needs configured delivery to appear on the login screen. Each provider has an independent version.","operationId":"put_v1_system_login_providers_provider","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"client_id":{"description":"Google web OAuth Client ID","maxLength":512,"type":"string"},"client_secret":{"description":"Google OAuth secret; omitted or empty preserves the saved value","maxLength":512,"type":"string","writeOnly":true},"enabled":{"type":"boolean"},"version":{"minimum":1,"type":"integer"}},"required":["enabled","version"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginProvider"}}},"description":"Saved provider without its secret"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Settings changed; reload before saving"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Configure or enable a login provider","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/markups":{"get":{"description":"Administrators only. The first configured rule wins in this order — company model, company provider, company default, system model, system provider, system default. Zero is an explicit override. System default must be set; company default may be null to inherit. Replacements are atomic and require the current version. Only new tasks use changed rates. Model IDs are exact and scoped to their provider; retired IDs remain valid rules.","operationId":"get_system_markups","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkupPolicy"}}},"description":"System and organization pricing rules (administrators only)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Organization not found"},"409":{"description":"Settings changed; reload before saving"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read system markup rules","tags":["System"],"x-required-scope":"system:manage"},"put":{"description":"Administrators only. The first configured rule wins in this order — company model, company provider, company default, system model, system provider, system default. Zero is an explicit override. System default must be set; company default may be null to inherit. Replacements are atomic and require the current version. Only new tasks use changed rates. Model IDs are exact and scoped to their provider; retired IDs remain valid rules.","operationId":"put_system_markups","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkupConfig"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkupPolicy"}}},"description":"System and organization pricing rules (administrators only)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Organization not found"},"409":{"description":"Settings changed; reload before saving"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Replace system markup rules","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/markups/catalog":{"get":{"description":"Administrators only. Lists supported paid providers and model identifiers available through shared connections. Existing rules remain editable when a model is no longer listed. Includes model capabilities, published release dates and public names for the shared model picker. No credentials are included.","operationId":"get_markup_catalog","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"icon_monochrome":{"type":"boolean"},"icon_url":{"description":"Authenticated content-versioned uploaded PNG logo URL; absent until uploaded","type":"string"},"id":{"type":"string"},"models":{"items":{"allOf":[{"$ref":"#/components/schemas/MediaModel"},{"properties":{"name":{"type":"string"}},"type":"object"}]},"type":"array"},"name":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Provider and model choices"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List providers and models for markup exceptions","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/model-settings":{"get":{"description":"Administrator only. Discovers shared provider models, including hidden models. Newly discovered models are enabled by default.","operationId":"get_v1_system_model_settings","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ModelSetting"},"type":"array"}},"type":"object"}}},"description":"Registered models"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List public model identities and default availability","tags":["System"]}},"/v1/system/model-settings/{modelId}":{"parameters":[{"in":"path","name":"modelId","required":true,"schema":{"format":"uuid","type":"string"}}],"put":{"description":"Administrator only. Public IDs are unique and case-sensitive; the previous name is not retained as an alias. Changes affect new requests; accepted generations retain their public-name snapshot.","operationId":"put_v1_system_model_settings_modelId","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"enabled_by_default":{"type":"boolean"},"public_id":{"maxLength":200,"minLength":1,"type":"string"},"version":{"minimum":1,"type":"integer"}},"required":["public_id","enabled_by_default","version"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelSetting"}}},"description":"Saved model settings"},"400":{"description":"Invalid public ID or missing fields"},"403":{"description":"Administrator access required"},"409":{"description":"Name already in use or version changed; reload settings"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Rename a model or change its default availability","tags":["System"]}},"/v1/system/organizations/{company}/installation-access":{"get":{"description":"Central system Administrator browser session only. Includes permanent company-access and expiring generation-only workspace keys, including revoked history. Returns key ID, company ID/name, display name, client origin, access kind, creation/expiry/revocation times and nonsecret key prefix; never credentials. Does not include deferred company-interface grants.","operationId":"listOrganizationInstallationAccess","responses":{"200":{"description":"Company installation access records"},"403":{"description":"Central Administrator browser session required"},"410":{"description":"Organization unavailable"}},"security":[{"sessionAuth":[]}],"summary":"List a company's installation access across issuers"},"parameters":[{"in":"path","name":"company","required":true,"schema":{"format":"uuid","type":"string"}}]},"/v1/system/organizations/{company}/installation-access/{id}":{"delete":{"description":"Central system Administrator browser session only; current role and company/key association checked transactionally. Idempotent revocation clears retained delivery ciphertext, preserving history, companies, jobs, files, charges and other keys. No bulk revocation.","operationId":"revokeOrganizationInstallationAccess","responses":{"200":{"description":"Revoked"},"403":{"description":"Central Administrator browser session required"},"410":{"description":"No matching company installation grant"}},"security":[{"sessionAuth":[]}],"summary":"Revoke one exact installation key in the selected company"},"parameters":[{"in":"path","name":"company","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}]},"/v1/system/payment-integrations":{"post":{"description":"Administrator only. Returns a pay_ bearer token once; only its hash is stored. This trusted issuer can settle any organization, but has no user or general system access. Integrations use service-paid fees; Stripe fee modes are configured separately.","operationId":"post_v1_system_payment_integrations","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"live":{"type":"boolean"},"name":{"maxLength":100,"type":"string"}},"required":["name","live"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"provider":{"$ref":"#/components/schemas/PaymentProvider"},"token":{"type":"string"}},"type":"object"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"summary":"Issue a trusted external payment integration credential","tags":["Payments"]}},"/v1/system/payment-notifications":{"get":{"description":"Requires an administrator and system:manage scope for API keys.","operationId":"get_v1_system_payment_notifications","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentNotificationSettings"}}},"description":"Current subscriptions and delivery queue status"},"403":{"description":"Administrator access required"}},"summary":"Get global payment email notification settings and delivery status","tags":["Payments"]},"put":{"description":"Applies to every payment provider. Both lists must be supplied. Emails must belong to existing administrators. Empty lists disable notifications. Requires administrator access and system:manage scope for API keys.","operationId":"put_v1_system_payment_notifications","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentNotificationUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentNotificationSettings"}}},"description":"Saved subscriptions and delivery queue status"},"400":{"description":"Invalid lists or recipients are not existing administrators"},"403":{"description":"Administrator access required"},"409":{"description":"Settings version changed; reload before saving"}},"summary":"Update global payment notification recipients","tags":["Payments"]}},"/v1/system/payment-providers":{"get":{"description":"Administrator and system:manage when using an API key. Secrets are never returned.","operationId":"get_v1_system_payment_providers","responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"available_providers":{"items":{"additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"type":"object"},"type":"array"},"data":{"items":{"$ref":"#/components/schemas/PaymentProvider"},"type":"array"},"stablecoin_networks":{"items":{"description":"Built-in network and accepted token contracts","type":"object"},"type":"array"}},"type":"object"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"summary":"List payment providers","tags":["Payments"]},"post":{"description":"Save disabled with a secret API key first, configure the returned webhook URL in Stripe, then update with its signing secret and enabled=true. Account and test/live mode are verified with Stripe and cannot later be changed. AUTH_PUBLIC_URL must be a public HTTPS origin.","operationId":"post_v1_system_payment_providers","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentProviderUpdate"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentProvider"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"summary":"Configure card or stablecoin payments","tags":["Payments"]}},"/v1/system/payment-providers/{id}":{"put":{"description":"Administrator only. Blank or omitted secrets preserve saved values. version is required for optimistic concurrency. fee_mode applies to new payments; existing payments retain their snapshot.","operationId":"put_v1_system_payment_providers_id","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentProviderUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentProvider"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"summary":"Update payment configuration","tags":["Payments"]}},"/v1/system/payment-providers/{id}/check":{"post":{"description":"Checks merchant identity, test/live mode and charges_enabled without charging a card or verifying webhook delivery.","operationId":"post_v1_system_payment_providers_id_check","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"account_id":{"type":"string"},"charges_enabled":{"type":"boolean"},"live":{"type":"boolean"}},"type":"object"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"summary":"Verify Stripe credentials","tags":["Payments"]}},"/v1/system/payment-providers/{id}/disable":{"post":{"description":"Stops new checkouts or external settlements. Existing Stripe payments are still reconciled, including refunds and disputes. History and encrypted Stripe credentials are retained.","operationId":"post_v1_system_payment_providers_id_disable","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"version":{"type":"integer"}},"required":["version"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentProvider"}}},"description":"Success"},"400":{"description":"Invalid request"},"403":{"description":"Role, scope, tenant or integration credential denied"},"409":{"description":"Version, idempotency, immutable payment data or fee mode conflict"},"503":{"description":"Payment verification is not available; retry the same operation"}},"summary":"Disable a payment provider or revoke an integration","tags":["Payments"]}},"/v1/system/providers":{"get":{"description":" Requires system:manage on personal keys, or a console session. Available when provider administration is configured.","operationId":"get_v1_system_providers","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AdminProvider"},"type":"array"}},"required":["data"],"type":"object"}}},"description":"Administrative provider catalog"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Shared — List every supported provider and its administrative state","tags":["Providers admin"],"x-required-scope":"system:manage","x-system-administrator-required":true},"post":{"description":"Requires a system administrator. Creates a disabled connection without testing credentials or making a paid request.","operationId":"post_v1_system_providers","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"api_type":{"type":"string"},"name":{"maxLength":120,"type":"string"}},"required":["api_type","name"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminProvider"}}},"description":"Created provider connection"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Create an independent provider connection","tags":["Providers admin"],"x-required-scope":"system:manage"}},"/v1/system/providers/types":{"get":{"description":"Requires a system administrator. Templates describe supported serialization formats; they do not imply access or pricing for manually added models.","operationId":"get_v1_system_providers_types","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/ProviderField"},"type":"array"},"icon_monochrome":{"type":"boolean"},"icon_url":{"description":"Authenticated content-versioned uploaded PNG logo URL; absent until uploaded","type":"string"},"id":{"type":"string"},"name":{"type":"string"},"profiles":{"items":{"additionalProperties":true,"type":"object"},"type":"array"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"API types with connection fields and model capability templates"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"List supported API adapters and request profile templates","tags":["Providers admin"],"x-required-scope":"system:manage"}},"/v1/system/providers/{providerId}":{"get":{"description":" Requires system:manage on personal keys, or a console session. Available when provider administration is configured.","operationId":"get_v1_system_providers_providerId","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminProvider"}}},"description":"Provider state"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Shared — Get provider configuration and live status","tags":["Providers admin"],"x-required-scope":"system:manage"},"parameters":[{"$ref":"#/components/parameters/ProviderID"}],"put":{"description":"Omitted credential fields preserve the stored value; empty strings clear it. Clearing a required credential disables the provider. Requires system:manage on personal keys, or a console session. Available when provider administration is configured.","operationId":"put_v1_system_providers_providerId","requestBody":{"content":{"application/json":{"example":{"api_key":"YOUR_PROVIDER_API_KEY","enabled":true},"schema":{"$ref":"#/components/schemas/ProviderUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminProvider"}}},"description":"Updated and validated provider state"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Shared — Update credentials, endpoints, or enabled state","tags":["Providers admin"],"x-required-scope":"system:manage"}},"/v1/system/providers/{providerId}/check":{"parameters":[{"$ref":"#/components/parameters/ProviderID"}],"post":{"description":" Requires system:manage on personal keys, or a console session. Available when provider administration is configured.","operationId":"post_v1_system_providers_providerId_check","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminProvider"}}},"description":"Refreshed provider state"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Shared — Refresh provider model and connection status information","tags":["Providers admin"],"x-required-scope":"system:manage"}},"/v1/system/providers/{providerId}/logo":{"delete":{"description":"Administrator only. Idempotently remove only this resource owner's provider logo. Credentials, settings, other provider logos and media remain unchanged. Read URLs return 404 afterward; shared renderers show the intentional no-logo fallback.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"icon_url":{"enum":[""],"type":"string"}},"type":"object"}}},"description":"Logo removed or already absent"},"401":{"description":"Authentication required"},"403":{"description":"Administrator permission and applicable API-key scopes required"},"404":{"description":"Provider not found"},"503":{"description":"Logo storage unavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Shared — Remove a provider logo","tags":["Providers admin"]},"parameters":[{"$ref":"#/components/parameters/ProviderID"}],"put":{"description":"Administrator only. Atomically replace this connection's logo without changing settings or credentials. PNG signature and full decoding are checked. Opaque and transparent PNG are accepted, including palette tRNS and 16-bit samples. SVG and other formats are rejected. Failures preserve the previous upload. No remote URL import is supported.","requestBody":{"content":{"image/png":{"schema":{"description":"Decoded PNG","format":"binary","maxLength":1048576,"opaque or transparent; maximum 2048 pixels per side":null,"type":"string"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"icon_url":{"type":"string"}},"type":"object"}}},"description":"Logo saved; refresh images using the new content-versioned URL"},"400":{"description":"Unsupported content type","exceeded byte/dimension limit or incomplete upload; previous logo retained":null,"malformed PNG":null},"401":{"description":"Authentication required"},"403":{"description":"Administrator permission and applicable API-key scopes required"},"404":{"description":"Provider not found"},"503":{"description":"Logo storage unavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Shared — Upload or replace a provider logo","tags":["Providers admin"]}},"/v1/system/remote-workspace":{"delete":{"description":"Keeps remote jobs, files and charges. Revoke the customer key remotely to revoke its remote authority. A stale in-flight connection cannot resurrect this record.","operationId":"disconnectRemoteWorkspace","requestBody":{"content":{"application/json":{"schema":{"properties":{"version":{"minimum":1,"type":"integer"}},"required":["version"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Disconnected metadata with incremented version"},"409":{"description":"Stale connection version"}},"summary":"Remove this administrator's encrypted remote credential"},"get":{"description":"No remote request. Credentials and remote grants are never returned. Connected describes a saved verified connection, not current remote availability.","operationId":"getRemoteWorkspace","responses":{"200":{"description":"Saved connection metadata including opaque context (revision/destination/account) and stable operation_scope","or connected false":null}},"summary":"Read this administrator's saved remote-company connection"},"post":{"description":"Explicit legacy-compatibility consent required. Only an active saved legacy connection with the same normalized origin, company, customer and version can be renewed. Fresh connections and dedicated connections must use installation onboarding. HTTPS public server origin only. Does not create accounts, companies, grants or credit. Retries with identical target and credential retain the accepted connection version.","operationId":"connectRemoteWorkspace","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"consent":{"const":true,"type":"boolean"},"organization_id":{"format":"uuid","type":"string"},"origin":{"format":"uri","type":"string"},"token":{"type":"string","writeOnly":true},"version":{"minimum":0,"type":"integer"}},"required":["origin","organization_id","token","consent","version"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Verified connection metadata without secrets"},"409":{"description":"Connection changed; reload and review"},"502":{"description":"Remote verification failed"}},"summary":"Replace a key for an existing active legacy company connection"}},"/v1/system/remote-workspace/authorization":{"delete":{"description":"Retains pending state when remote cancellation has uncertain outcome (including ambiguous host 410 or missing positive confirmation), allowing identical retry. Expiry never permits overwriting the local proof before confirmed cancellation. A confirmed cancellation removes the encrypted device secret; remote issued grants are revoked atomically by the host.","operationId":"cancelLocalInstallationAuthorization","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"}},"required":["id"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Cancelled"},"502":{"description":"Remote cancellation could not be confirmed"}},"summary":"Cancel this administrator's pending request at the remote host"},"get":{"description":"Local read only. No remote request or device secret is returned.","operationId":"readLocalInstallationAuthorization","responses":{"200":{"description":"Pending id/origin/base_version/historical connection_revision/current_connection_revision/recovery_allowed/user_code/verification_uri/expiry, or pending false"}},"summary":"Read this local administrator's pending connection request"},"post":{"description":"Current local Administrator plus explicit metadata-transfer consent. Preserves the current dedicated connection and company until its renewed key is verified; active legacy connections require explicit legacy management. The backend retains a durable installation proof per normalized central origin and stores an encrypted device secret and makes checked outbound HTTPS calls only; no local management credential is forwarded. Retries resume the same pending request, retaining its original display metadata and proof. The destination is fixed server-side to the canonical Sociaro origin; request headers and browser fields cannot select another host. The display address comes from UI_PUBLIC_URL (AUTH_PUBLIC_URL fallback); missing configuration uses http://localhost. Names and addresses are display-only, not ownership verification.","operationId":"beginLocalInstallationAuthorization","requestBody":{"content":{"application/json":{"schema":{"properties":{"client_name":{"deprecated":true,"description":"Ignored; trusted public configuration supplies the installation label.","type":"string"},"client_origin":{"deprecated":true,"description":"Ignored; trusted public configuration supplies the display address.","format":"uri","type":"string"},"consent":{"const":true,"type":"boolean"},"origin":{"deprecated":true,"description":"Optional legacy field; must equal the configured canonical Sociaro origin.","format":"uri","type":"string"},"version":{"minimum":0,"type":"integer"}},"required":["version","consent"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Safe authorization view with trusted-host URI and user code"},"403":{"description":"Consent/role/host onboarding unavailable"},"409":{"description":"Connection or pending request changed"}},"summary":"Connect this installation to Sociaro with explicit approval"}},"/v1/system/remote-workspace/authorization/poll":{"post":{"description":"Uses this local Administrator's encrypted device secret and checks returned provisioning/proof identity before saving dedicated state. A legacy reply cannot silently become dedicated. Does not expose the resulting remote credential to the browser. Version checks reject replies after disconnect or replacement.","operationId":"completeLocalInstallationAuthorization","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"}},"required":["id"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Verified connection metadata"},"410":{"description":"Expired/denied authorization"},"428":{"description":"Awaiting browser consent"},"429":{"description":"Retry after the requested interval"},"502":{"description":"Remote response uncertain; retry the same request"}},"summary":"Poll consent and atomically connect the verified remote company"}},"/v1/system/remote-workspace/authorization/recover":{"post":{"description":"Explicit verified local Administrator consent. Atomically archives the exact pending device proof and its own origin identity, separately preserves any saved connection under that connection's own binding, advances legacy and global fences and removes only the matching active attempt. A valid saved connection remains active; a different active destination still requires explicit local disconnect. No remote revocation or full company-mode activation is implied. Destination comes only from trusted server configuration. Exact operation replay returns the committed result even after later company activation; changed binding conflicts. New quarantine is denied while a full-company grant is active. JSON is limited to 8192 bytes; authorization/body/cleanup share a 15-second total deadline.","operationId":"quarantineLocalLegacyAuthorization","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"connection_revision":{"minimum":0,"type":"integer"},"consent":{"const":true,"type":"boolean"},"id":{"format":"uuid","type":"string"},"operation_id":{"format":"uuid","type":"string"},"version":{"minimum":0,"type":"integer"}},"required":["id","operation_id","version","connection_revision","consent"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Immutable transition id","original origin":null,"resulting version/revision and unresolved state":null},"400":{"description":"Invalid request or missing explicit consent"},"401":{"description":"Verified local browser sign-in required"},"403":{"description":"Local Administrator required"},"409":{"description":"Attempt/revision changed or active full-company binding prevents a new transition"}},"summary":"Preserve unresolved legacy access and free its exact pending slot"}},"/v1/system/remote-workspace/authorization/recovery":{"get":{"description":"Verified local Administrator browser session only. Returns current_connection_revision separately from historical attempt revisions, recovery_allowed, secret-free items and next_cursor. Follow the stable opaque cursor to discover older pending custody; each page contains at most 100 records. No proof, credential or saved private snapshot is returned. A live full-company binding prohibits new quarantine but does not erase terminal cleanup custody.","operationId":"listLocalLegacyRecoveryCustody","parameters":[{"in":"query","name":"cursor","schema":{"maxLength":256,"type":"string"}}],"responses":{"200":{"description":"Bounded owner-specific recovery history and current revision"},"400":{"description":"Invalid or repeated cursor"},"401":{"description":"Verified local browser sign-in required"},"403":{"description":"Local Administrator required"}},"summary":"Read bounded unresolved legacy recovery history"}},"/v1/system/remote-workspace/authorization/recovery/cleanup":{"post":{"description":"Uses the owner-specific archived device proof and original destination server-side. Never uses a separately saved snapshot key as cancellation authority. A positive original-host acknowledgement is required; timeout, expiry or lost response retains unresolved proof. Exact retry is idempotent and cannot activate an archive or revoke a successor. Terminal history is retained after confirmation. No browser-supplied destination, proof or credential is accepted.","operationId":"cleanupLocalLegacyAuthorizationCustody","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"id":{"format":"uuid","type":"string"}},"required":["id"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Original device request cancellation confirmed"},"401":{"description":"Verified local browser sign-in required"},"403":{"description":"Local Administrator required"},"404":{"description":"Recovery record not owned by this administrator"},"502":{"description":"Original-host cleanup remains uncertain; retained custody can be retried"}},"summary":"Confirm terminal cleanup only at the archived original host"}},"/v1/system/remote-workspace/proxy/{path}":{"get":{"description":"Uses only the calling administrator's saved connection. Never proxies arbitrary hosts, organizations, payments, credentials or management. No remote token is returned to the browser. Every call requires its reviewed context; stale revision, destination or account returns 409 before outbound dispatch. Already admitted requests use their original captured connection.","operationId":"readRemoteWorkspaceOperation","parameters":[{"description":"Opaque context returned when the connection was reviewed. Required unless workspace_context query is supplied.","in":"header","name":"X-Workspace-Context","schema":{"type":"string"}},{"description":"GET/HEAD download-link alternative to the context header; do not supply both.","in":"query","name":"workspace_context","schema":{"type":"string"}}],"responses":{"200":{"description":"Remote customer JSON or authorized media download"},"409":{"description":"Reviewed connection changed; no remote dispatch"},"428":{"description":"Reviewed context required"},"502":{"description":"Remote unavailable or invalid response"}},"summary":"Read remote catalogue, current key/balance, generation history/status or authorized content"},"parameters":[{"description":"Allowlisted remote v1 media path; may contain slashes.","in":"path","name":"path","required":true,"schema":{"type":"string"}}],"post":{"description":"Only v1/generations/estimate and v1/generations are allowed. Generation requires Idempotency-Key and X-Workspace-Context. Its remote operation identity is stable for the local owner/remote origin/company across key renewal, with distinct namespaces for other hosts/companies. No local task or balance debit is created. Requests are bounded to 4 MiB.","operationId":"submitRemoteWorkspaceOperation","parameters":[{"description":"Reviewed context from connection metadata; rejects changed revision/destination/account before dispatch.","in":"header","name":"X-Workspace-Context","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}},"required":true},"responses":{"200":{"description":"Estimate"},"202":{"description":"Remote job accepted"},"402":{"description":"Remote balance or allowance exhausted"},"409":{"description":"Remote quote or idempotency conflict"},"429":{"description":"Remote quota; honor Retry-After"}},"summary":"Estimate or submit a remote generation"}},"/v1/system/reports":{"get":{"description":"Administrator financial history across all organizations and provider modes, including revoked keys. Reports distinguish expected_usd (estimate), metered_usd (reported consumption), and tariff_usd (bill-confirmed gross price). actual_usd is the separate cash payment. Generation cost consumes organization balance and member weekly allowance regardless of package coverage. Provider charge and package units remain separate. No charge is inferred when billing data is absent.","operationId":"get_v1_system_reports","parameters":[{"description":"Aggregate all matching requests; ignores pagination. Cannot combine with CSV.","in":"query","name":"view","schema":{"enum":["summary"],"type":"string"}},{"description":"Summary calendar buckets in the selected timezone. Weeks start Monday. A range of one month or less has one monthly bucket. Maximum 10000 buckets.","in":"query","name":"interval","schema":{"default":"day","enum":["day","week","month"],"type":"string"}},{"description":"Exact user ID or email (case-insensitive); financial viewers only.","in":"query","name":"user","schema":{"type":"string"}},{"description":"IANA time zone for inclusive from/to calendar dates; CSV timestamps remain UTC.","in":"query","name":"timezone","schema":{"default":"UTC","type":"string"}},{"description":"Export every matching row as CSV; limit and offset are ignored.","in":"query","name":"format","schema":{"enum":["csv"],"type":"string"}},{"in":"query","name":"user_id","schema":{"format":"uuid","type":"string"}},{"description":"First included date in the requested timezone; defaults to the start of this month.","in":"query","name":"from","schema":{"format":"date","type":"string"}},{"description":"Last included date in the requested timezone; defaults to today.","in":"query","name":"to","schema":{"format":"date","type":"string"}},{"in":"query","name":"api_key_id","schema":{"format":"uuid","type":"string"}},{"description":"Exact generation ID. Combined with the other filters.","in":"query","name":"generation_id","schema":{"format":"uuid","type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"offset","schema":{"default":0,"maximum":100000,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ReportSummary"},{"properties":{"data":{"items":{"properties":{"api_key_id":{"type":["string","null"]},"api_key_name":{"type":"string"},"consumed_usd":{"description":"Generation cost before package coverage; null while unknown.","type":["number","null"]},"cost":{"$ref":"#/components/schemas/TaskCost"},"created_at":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"identity_historical":{"description":"True when labels were captured at request acceptance. False for legacy current-directory fallbacks.","type":"boolean"},"identity_snapshot":{"additionalProperties":true,"type":"object"},"model":{"type":"string"},"organization_id":{"format":"uuid","type":"string"},"organization_name":{"type":"string"},"provider":{"type":"string"},"provider_name":{"type":"string"},"status":{"type":"string"},"usage":{"$ref":"#/components/schemas/ProviderUsage"},"user_email":{"type":"string"},"user_id":{"format":"uuid","type":"string"},"user_picture":{"description":"Current profile image for the authorized report user; historical identity labels remain unchanged.","format":"uri","type":"string"}},"type":"object"},"type":"array"},"has_more":{"type":"boolean"},"next_offset":{"type":"integer"}},"type":"object"}]}},"text/csv":{"example":"Created at (UTC),Cost (USD)","schema":{"type":"string"}}},"description":"Tasks in descending creation order."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read generation cost history across all organizations","tags":["System"],"x-required-scope":"system:manage","x-system-administrator-required":true}},"/v1/system/reports/{id}":{"get":{"description":"Requires a system administrator. Resolves the owning organization from the authorized Reports list; excludes private personal tasks. Returns every retained public generation field and exact saved request settings when content access is allowed. Minimal logging omits prompt, instructions, webhook and references, exposing only retained resolution, ratio, duration and generate_audio. Customer views retain the existing financial sanitization. Provider/storage credentials are never returned.","operationId":"get_v1_system_reports_id","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}},"description":"Generation details authorized for this viewer"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No generation report in the authorized scope"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read full system-wide organization generation report","tags":["Reports"]}},"/v1/system/reports/{id}/content":{"get":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"get_v1_system_reports_id_content","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file content"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read system-wide organization generation result","tags":["Reports"]},"head":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"head_v1_system_reports_id_content","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file headers"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Inspect system-wide organization generation result","tags":["Reports"]}},"/v1/system/reports/{id}/last-frame":{"get":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"get_v1_system_reports_id_last_frame","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file content"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read system-wide organization generation last frame","tags":["Reports"]},"head":{"description":"Same report ownership and content permissions as the detail route. Supports browser sessions, Range and download=1. Deleted or unstored files return 404; direct storage may redirect to a temporary signed URL.","operationId":"head_v1_system_reports_id_last_frame","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Download as an attachment","in":"query","name":"download","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"description":"Stored file headers"},"206":{"description":"Partial file content"},"307":{"description":"Temporary signed storage URL"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No authorized stored artifact"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Inspect system-wide organization generation last frame","tags":["Reports"]}},"/v1/system/resources/import":{"post":{"description":"Requires an administrator. Copies the caller's saved encrypted provider and S3 connections into empty shared settings. Does not overwrite existing shared connections, migrate files or enable sharing. Audited.","operationId":"post_v1_system_resources_import","responses":{"204":{"description":"Connections copied"},"403":{"description":"Administrator required"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Copy your personal connections to shared resources","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/sales":{"get":{"description":"Administrator browser session only. Includes all sales employees, including those reporting directly to Administrator or skipping a vacant rank. API keys are rejected.","operationId":"get__v1_system_sales","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesStructure"}}},"description":"Consistent hierarchy snapshot"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"sessionAuth":[]}],"summary":"Read the complete sales hierarchy","tags":["System"]}},"/v1/system/sales/bonus-settings":{"put":{"description":"Browser administrator only. Defaults are 5 percent for the assigned manager and 1 percent for their immediate actual supervisor. Sum cannot exceed 100 percent. Changes affect first recognition after saving; existing accruals keep their rate and recipients.","operationId":"put_sales_bonus_settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BonusSettings"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BonusSettings"}}},"description":"Saved settings"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Stale settings version"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"sessionAuth":[]}],"summary":"Set global sales bonus percentages","tags":["System"]}},"/v1/system/sales/{employee}":{"put":{"description":"Administrator browser session only. Requires the current global structure version. Supervisor must be a sales employee of strictly higher rank; empty means Administrator. Role and supervisor change atomically. Incompatible direct reports move to the selected supervisor, retaining their roles and clients. Other reports move with the employee. Existing personal client assignments survive sales-to-sales changes. Adding a non-sales user revokes their keys and is rejected for organization owners/managers and administrators. Changes are audited. API keys are rejected.","operationId":"put__v1_system_sales_employee","parameters":[{"in":"path","name":"employee","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"fill_vacancy":{"default":false,"description":"For lead/regional placement, atomically adopt lower-rank employees directly reporting to the selected supervisor. Cannot be combined with new_team. False preserves compatible direct reports.","type":"boolean"},"new_team":{"default":false,"description":"For lead/regional placement, move only the employee into an empty branch; former direct reports stay with the previous supervisor or Administrator. Works with unchanged role/supervisor. Cannot be combined with fill_vacancy.","type":"boolean"},"role":{"$ref":"#/components/schemas/SalesRole"},"supervisor_id":{"description":"Higher-rank employee UUID or empty for Administrator.","type":"string"},"version":{"minimum":1,"type":"integer"}},"required":["role","supervisor_id","version"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesStructure"}}},"description":"Saved hierarchy and its current version"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Employee not found"},"409":{"description":"Stale hierarchy or invalid role/supervisor placement"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"sessionAuth":[]}],"summary":"Add or move a sales employee and change their sales role","tags":["System"]}},"/v1/system/settings":{"get":{"description":"Requires a current administrator role and either a console session or a personal key with system:manage. Roles are checked on every request. Revoking the last administrator is rejected. Settings use version to prevent overwriting concurrent changes.","operationId":"get__v1_system_settings","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemSettings"}}},"description":"Successful response. Lists return up to 50 records."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"User not found"},"409":{"description":"Last administrator protection or stale settings version"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Read system settings","tags":["System"],"x-required-scope":"system:manage"},"put":{"description":"Requires a current administrator role and either a console session or a personal key with system:manage. Roles are checked on every request. Revoking the last administrator is rejected. Settings use version to prevent overwriting concurrent changes.","operationId":"put__v1_system_settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemSettings"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemSettings"}}},"description":"Successful response. Lists return up to 50 records."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"User not found"},"409":{"description":"Last administrator protection or stale settings version"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Update system settings","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/setup-profile":{"post":{"description":"Administrator plus system:manage for API keys. Preserves unrelated settings, clears setup_pending and rejects disabling access with active jobs. Skip does not call this endpoint. Personal and operator are exclusive local provider modes for all roles. A trusted central installation accepts only operator. Legacy hybrid policy is effectively company-only, without automatic stored-state migration. Role/origin metadata is read-only; profile selection adds no credit.","operationId":"applySetupProfile","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"allow_personal":{"deprecated":true,"description":"Compatibility only; true is rejected. New clients omit this obsolete override.","enum":[false],"type":"boolean"},"profile":{"enum":["personal","operator"],"type":"string"},"version":{"minimum":1,"type":"integer"}},"required":["profile","version"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemSettings"}}},"description":"Persisted settings"},"403":{"description":"Central installation supports companies-service mode only"},"409":{"description":"Stale version or active work prevents disabling access"}},"summary":"Apply a confirmed local setup profile without migrating data"}},"/v1/system/storage":{"get":{"description":"Returns the current local or S3 selection, connection fields and access key ID to authorized storage managers. The secret access key is never returned. Accounts default to local storage.","operationId":"get_v1_system_storage","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettings"}}},"description":"Storage settings"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Shared — Read account storage settings","tags":["System"],"x-required-scope":"system:manage","x-system-administrator-required":true},"put":{"description":"Tests S3 object write, read and delete permissions before activating. Checks browser preflights for configured UI_PUBLIC_URL (or API_PUBLIC_URL), falling back to the request Origin. Missing CORS is configured automatically using the saved key, preserving other rules and bucket privacy; CORS read/update rights are required only for missing browser access. After confirming the saved policy, browser_uploads_pending can be true while provider caches apply the change. Changes apply when results are archived, without restarting the worker. Existing files remain at their original location. Blank credentials preserve saved values; changing endpoint requires both credentials again. Selecting local preserves the last S3 connection. Maximum request body is 16 KiB.","operationId":"put_v1_system_storage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettings"}}},"description":"Saved settings"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Shared — Configure account storage","tags":["System"],"x-required-scope":"system:manage","x-system-administrator-required":true}},"/v1/system/storage/check":{"post":{"description":"Creates, reads and deletes a uniquely named temporary object under the configured prefix. Does not list or create buckets. Uses saved credentials if omitted. A successful check does not activate the settings. Also validates PUT/GET/HEAD browser preflights for configured UI_PUBLIC_URL (or API_PUBLIC_URL), falling back to the request Origin. Without either, retains the server-only probe. Missing browser access returns storage_browser_setup_required. Outbound private-address policy rejection returns storage_endpoint_blocked; DNS resolution failure returns storage_endpoint_dns_failed. Other connection failures retain storage_check_failed. Diagnostic messages omit credentials, signed URLs and raw transport details. No bucket CORS is changed.","operationId":"post_v1_system_storage_check","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"status":{"const":"ok","type":"string"}},"type":"object"}}},"description":"Connection verified"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Shared — Test proposed storage settings without saving","tags":["System"],"x-required-scope":"system:manage","x-system-administrator-required":true}},"/v1/system/storage/quota":{"get":{"operationId":"getSharedStorageQuota","responses":{"200":{"description":"Object with limit_bytes (nullable integer) and version."},"403":{"$ref":"#/components/responses/Forbidden"}},"summary":"Read the global per-user shared-storage allowance","tags":["System"],"x-required-scope":"system:manage"},"put":{"description":"Requires a current administrator. Only new uploads and generations are blocked when current usage already exceeds the limit. Accepted tasks always archive their results. Does not change monetary budgets or delete any files.","operationId":"setSharedStorageQuota","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"limit_bytes":{"maximum":1000000000000000,"minimum":0,"type":["integer","null"]},"version":{"minimum":1,"type":"integer"}},"required":["limit_bytes","version"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Updated limit_bytes and version."},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Settings changed; reload before saving."}},"summary":"Set the global per-user shared-storage allowance","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/template-references":{"get":{"description":"Authenticated users may read and select shared files for permitted generation inputs. Mutation requires a system Administrator and system:manage for bearer credentials. Fixed template inputs cannot be overridden. Pending-deletion entries are unavailable for selection.","operationId":"listSharedTemplateReferences","parameters":[{"in":"query","name":"offset","schema":{"maximum":1000000,"minimum":0,"type":"integer"}}],"responses":{"200":{"content_type":null,"created_at":null,"description":"data with id","name":null,"sha256 and authenticated url; has_more and next_offset":null,"size_bytes":null},"403":{"description":"Template creator permission required"}},"summary":"List the instance-wide shared template asset collection","tags":["Templates"]},"post":{"description":"Uses configured instance storage in a distinct namespace, retains creator audit identity, validates supported media bytes and global limits, and does not assign any slot. No model-specific minimum is invented for generic library uploads. Private uploads are not moved or exposed.","operationId":"uploadSharedTemplateReference","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Existing identical shared source; no private source is adopted"},"201":{"description":"Shared source metadata and authenticated content URL"},"400":{"description":"Unsupported","empty or oversized media":null,"malformed":null},"403":{"description":"Creator permission or shared storage quota restriction"},"429":{"description":"Multipart upload admission busy; retry later"}},"summary":"Upload a reusable source independently of any template slot","tags":["Templates"]}},"/v1/system/template-references/{id}":{"delete":{"description":"Active current-content reference/cover bindings protect an asset under the same transaction lock as binding writes. A reference_in_use error includes every blocking template name, stable id and navigation URL. Unpublishing preserves current-content uses; removed templates cannot be restored by the current lifecycle. Failed physical deletion remains retryable and cannot be selected or rebound.","operationId":"deleteSharedTemplateReference","responses":{"204":{"description":"Shared asset deleted"},"403":{"description":"Creator permission required"},"404":{"description":"Shared source unavailable; private source IDs are not accepted"},"409":{"description":"reference_in_use; error.templates lists all blocking templates with id, name and url"}},"summary":"Delete an unused shared source as a template creator","tags":["Templates"]},"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"patch":{"description":"Edits the filename only. Bytes, asset identity and every reference/cover binding are preserved. Upload new content under a new identity rather than replacing dependent bytes.","operationId":"renameSharedTemplateAsset","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"name":{"maxLength":255,"minLength":1,"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Current shared asset metadata"},"400":{"description":"Invalid filename"},"403":{"description":"Administrator with management scope required"},"404":{"description":"Shared asset unavailable or pending deletion"}},"summary":"Rename shared asset display metadata as an Administrator","tags":["Templates"]}},"/v1/system/template-references/{id}/content":{"get":{"description":"Authenticated read-only access for instance users. Shared assets can be selected for permitted generation inputs; fixed template inputs remain immutable. Returned generation capabilities identify the reserved shared namespace.","operationId":"readSharedTemplateReference","responses":{"200":{"description":"Validated source bytes; Cache-Control private no-store and nosniff"},"403":{"description":"Creator permission required"},"404":{"description":"Shared source unavailable"}},"summary":"Read shared asset content with authentication","tags":["Templates"]},"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}]},"/v1/system/templates":{"get":{"operationId":"listTemplateDrafts","responses":{"200":{"description":"Current template records and shared provider models; publication is a visibility flag"},"403":{"description":"System Administrator role and system scope required"}},"summary":"Administrator-only current template catalog and shared provider models","tags":["Templates"]},"post":{"operationId":"createTemplateDraft","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"anyOf":[{"required":["content"]},{"required":["draft"]}],"properties":{"content":{"$ref":"#/components/schemas/TemplateDefinition"},"draft":{"$ref":"#/components/schemas/TemplateDefinition"},"id":{"description":"Reuse the same ID to recover an uncertain create response.","format":"uuid","type":"string"},"version":{"const":0,"type":"integer"}},"type":"object"}}},"required":true},"responses":{"200":{"description":"Existing current record recovered by the same create ID"},"201":{"description":"Created unpublished TemplateRecord in an available model's References workflow"},"400":{"description":"Missing or unsupported default model","output or reference workflow":null},"403":{"description":"Administrator required; company roles do not grant publishing"}},"summary":"Create an unpublished template with one current content","tags":["Templates"]}},"/v1/system/templates/library":{"get":{"operationId":"listTemplateSourceLibrary","parameters":[{"in":"query","name":"offset","schema":{"maximum":1000000,"minimum":0,"type":"integer"}}],"responses":{"200":{"description":"Creator-only shared library pagination; private personal and company references are excluded"}},"summary":"List the instance-wide template reference library (compatibility route)","tags":["Templates"]}},"/v1/system/templates/{template}":{"delete":{"operationId":"removeTemplate","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"version":{"minimum":1,"type":"integer"}},"required":["version"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Retained versioned record; new use is unavailable"},"409":{"description":"Concurrent edit"}},"summary":"Soft-remove and unpublish without deleting shared assets or historical results","tags":["Templates"]},"get":{"operationId":"getTemplateDraft","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateRecord"}}},"description":"One current content and visibility; legacy aliases resolve to that same content"}},"summary":"Read an Administrator's current content and publication state","tags":["Templates"]},"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}}],"put":{"description":"Save replaces the single current content. If published, the validated replacement immediately applies to subsequent generations; otherwise it remains unpublished. The action field alone toggles visibility. Publish or unpublish may contain only version and action. Supply content or the legacy draft alias; conflicting aliases are rejected. See template-api.md for token and schema-transition semantics.","operationId":"saveTemplateDraft","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"anyOf":[{"required":["content"]},{"required":["draft"]},{"properties":{"action":{"enum":["publish","unpublish"]}},"required":["action"]}],"properties":{"action":{"enum":["","publish","unpublish"],"type":"string"},"content":{"$ref":"#/components/schemas/TemplateDefinition"},"draft":{"$ref":"#/components/schemas/TemplateDefinition"},"version":{"description":"Opaque optimistic edit token from the current record.","minimum":1,"type":"integer"}},"required":["version"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateRecord"}}},"description":"Saved current content and visibility; no separate published definition"},"400":{"description":"Conflicting aliases or invalid content; publish and published Save require valid slots","media and an explicit image/video cover. No content is changed on failure.":null,"model":null},"403":{"description":"Administrator required"},"404":{"description":"Template or selected shared media unavailable; previous current content remains unchanged"},"409":{"description":"Concurrent edit; reload the current record and review local changes"}},"summary":"Save, publish or unpublish a template with optimistic concurrency","tags":["Templates"]}},"/v1/system/templates/{template}/assets":{"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}}],"post":{"description":"Direct uploads enter the instance-wide library. Selecting library_reference_id returns that same asset identity after validation. A cover is display media only. Shared storage quota and protected deletion apply; private reference_id imports are rejected.","operationId":"copyTemplateMedia","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"library_reference_id":{"description":"Existing shared asset; retains its identity without copying bytes.","format":"uuid","type":"string"},"validation":{"$ref":"#/components/schemas/ReferenceValidationTarget"}},"required":["library_reference_id"],"type":"object"}},"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"},"validation":{"description":"JSON-encoded ReferenceValidationTarget","type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"201":{"description":"Uploaded or selected shared asset metadata"},"400":{"description":"Unsupported or uninspectable media"},"403":{"description":"Administrator or storage quota restriction"}},"summary":"Upload or select a shared asset for a template","tags":["Templates"]}},"/v1/system/templates/{template}/assets/{asset}":{"get":{"operationId":"previewTemplateDraftMedia","parameters":[{"description":"Explicit same-origin authenticated editor preview; streams bounded media with range support instead of redirecting.","in":"query","name":"preview","schema":{"enum":[1],"type":"integer"}}],"responses":{"200":{"description":"Sandboxed image/video/audio bytes"},"307":{"description":"Short-lived direct storage delivery from a separate origin"}},"summary":"Administrator preview of a shared template asset","tags":["Templates"]},"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"asset","required":true,"schema":{"format":"uuid","type":"string"}}]},"/v1/system/templates/{template}/assets/{asset}/metadata":{"get":{"operationId":"readTemplateAssetMetadata","responses":{"200":{"description":"Immutable template asset metadata; original names are empty for legacy copies"},"403":{"description":"Creator permission required"},"404":{"description":"Asset unavailable or belongs to another template"}},"summary":"Read fixed media filenames and provenance with creator authorization","tags":["Templates"]},"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"asset","required":true,"schema":{"format":"uuid","type":"string"}}]},"/v1/system/templates/{template}/infer":{"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}}],"post":{"operationId":"inferTemplateSlots","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDefinition"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"slots":{"$ref":"#/components/schemas/TemplateDefinition/properties/slots"},"syntax":{"type":"string"},"warning":{"description":"Advisory actual and maximum slot counts for the selected model.","type":"string"}},"required":["syntax","slots"],"type":"object"}}},"description":"Syntax and ordered slots for Administrator review; repeated mentions bind once. An optional warning reports excess slot counts without discarding inferred slots or preventing unpublished draft saving. Publication independently validates all limits."},"400":{"description":"Unsupported workflow","missing references":null,"or invalid":null,"unsafe or gapped numeric marker":null}},"summary":"Infer stable typed slots using the draft reference syntax and native workflow limits","tags":["Templates"]}},"/v1/system/templates/{template}/validate-media":{"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}}],"post":{"description":"Administrator-only read using the same template and asset membership checks as publication. Incomplete grammar and missing slots are allowed. Model settings, present fixed files and workflow maxima are checked immediately.","operationId":"validateTemplateDraftMedia","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"draft":{"$ref":"#/components/schemas/TemplateDefinition"}},"type":"object"}}},"required":true},"responses":{"200":{"description":"Present fixed references are valid"},"400":{"description":"Incompatible media with actual and allowed values"},"403":{"description":"Administrator permission required"},"404":{"description":"Template or its fixed asset is unavailable"}},"summary":"Check draft fixed media without saving or publishing","tags":["Templates"]}},"/v1/system/users":{"get":{"description":"Requires a current administrator role and either a console session or a personal key with system:manage. Roles are checked on every request. Revoking the last administrator is rejected. Settings use version to prevent overwriting concurrent changes.","operationId":"get__v1_system_users","parameters":[{"in":"query","name":"offset","schema":{"default":0,"maximum":100000,"minimum":0,"type":"integer"}},{"in":"query","name":"search","schema":{"maxLength":200,"type":"string"}},{"in":"query","name":"admins_only","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemUserPage"}}},"description":"Successful response. Lists return up to 50 records."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"User not found"},"409":{"description":"Last administrator protection or stale settings version"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Find users and administrators","tags":["System"],"x-required-scope":"system:manage"}},"/v1/system/users/{id}/role":{"put":{"description":"Requires a current administrator role and either a console session or a personal key with system:manage. Roles are checked on every request. Revoking the last administrator is rejected. Settings use version to prevent overwriting concurrent changes.","operationId":"put__v1_system_users_id_role","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"oneOf":[{"required":["role"]},{"required":["is_system_admin"]},{"required":["is_client_manager"]}],"properties":{"is_client_manager":{"description":"Read-only assigned-organization access. Enabling revokes existing keys; disabling clears assignments. Remove administrator roles first.","type":"boolean"},"is_system_admin":{"type":"boolean"},"role":{"description":"Atomic role transition.","enum":["user","system_admin","client_manager","lead_client_manager","regional_client_manager"],"type":"string"}},"type":"object"}}},"required":true},"responses":{"204":{"description":"Role updated"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"User not found"},"409":{"description":"Last administrator protection or stale settings version"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"security":[{"bearerAuth":[]},{"sessionAuth":[]}],"summary":"Grant or revoke administrator access","tags":["System"],"x-required-scope":"system:manage"}},"/v1/templates":{"get":{"operationId":"listTemplates","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"cover_type":{"type":"string"},"cover_url":{"type":"string"},"description":{"type":"string"},"id":{"format":"uuid","type":"string"},"revision":{"type":"integer"},"title":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Published cover cards for recipes in References mode with reviewed slots. Legacy incompatible recipes remain stored and are omitted. No private drafts, user inputs or history."}},"summary":"Browse the instance-wide published gallery","tags":["Templates"]}},"/v1/templates/{template}":{"get":{"operationId":"getPublishedTemplate","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"asset_error":{"type":"string"},"catalog":{"items":{"$ref":"#/components/schemas/ProviderDescriptor"},"type":"array"},"default_available":{"type":"boolean"},"effective_resolutions":{"additionalProperties":{"additionalProperties":{"type":"string"},"type":"object"},"description":"Validated effective output resolution by provider ID then model ID. Only eligible models are present. Empty string means omit resolution; missing entries on older servers use the documented deterministic fallback. Stored preferences remain unchanged.","type":"object"},"fixed_references":{"description":"Read-only previews of fixed assets in this published revision only. Draft replacements are excluded.","items":{"properties":{"asset_id":{"format":"uuid","type":"string"},"content_type":{"type":"string"},"name":{"type":"string"},"slot_id":{"type":"string"},"url":{"type":"string"}},"type":"object"},"type":"array"},"id":{"format":"uuid","type":"string"},"revision":{"type":"integer"},"template":{"$ref":"#/components/schemas/TemplateDefinition"},"validation_status":{"description":"Ready requires completed media and workflow validation plus a compatible model; pending metadata never enables actions","enum":["ready","failed"],"type":"string"},"workflow_error":{"description":"Incompatible saved workflow or missing reference slots; explicit Administrator revision and republication required","type":"string"}},"type":"object"}}},"description":"Default unavailability is explicit; a replacement is never silently selected. Models are selected by their complete returned contracts and current key access, never a model-name allowlist. Templates require explicit references mode and at least one reviewed slot. Legacy incompatible revisions are retained but have no compatible models and return workflow_error; they are not mapped to empty or frame workflows."},"400":{"description":"Invalid revision query"},"404":{"description":"Unpublished","removed or unavailable template":null},"409":{"description":"Template changed before or during validation"}},"summary":"Read current published content and validated compatible models","tags":["Templates"]},"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional current metadata token; checked before media work and before the response","in":"query","name":"revision","required":false,"schema":{"minimum":0,"type":"integer"}}]},"/v1/templates/{template}/editing":{"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}}],"post":{"description":"Requires generation scope. Fixed slots cannot be replaced; only declared variable slots accept owned reference IDs. Uses published settings and authorized model capabilities. Returns prompt, provider, model, media_type and normalized options with signed library URLs. Empty string reference positions and duplicates are preserved. No files are copied. Does not change the recipe, estimate, or create work.","operationId":"prepareTemplateEditing","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateGenerationRequest"}}},"required":true},"responses":{"200":{"description":"Editable snapshot; empty reference positions must be filled or removed before ordinary generation"},"400":{"description":"Invalid or incompatible input"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Template or owned input unavailable"},"409":{"description":"Published revision changed"}},"summary":"Resolve an editable Playground snapshot","tags":["Templates"]}},"/v1/templates/{template}/estimate":{"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}}],"post":{"description":"Requires the same explicit bearer key as Playground. Rechecks live revision, key model access, fixed media and actual uploaded file limits. Unknown fields including prompt, options and fixed-reference overrides are rejected.","operationId":"estimateTemplateGeneration","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateGenerationRequest"}}},"required":true},"responses":{"200":{"description":"Existing generation cost estimate and budget response"},"400":{"actual file":null,"description":"Invalid binding","model or unsupported override":null},"409":{"description":"Published revision changed; review again"}},"summary":"Resolve typed inputs and estimate through the existing generation pipeline","tags":["Templates"]}},"/v1/templates/{template}/generations":{"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}}],"post":{"operationId":"createTemplateGeneration","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TemplateGenerationRequest"},{"required":["max_expected_cost_usd"]}]}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Queued generation with an immutable template snapshot, using normal ownership/project/history rules"},"400":{"description":"Invalid input","model or missing confirmation/idempotency key":null,"override":null},"401":{"description":"An explicit active generation bearer key is required"},"402":{"description":"Existing generation budget exhausted"},"409":{"description":"Revision","estimate or idempotency conflict":null}},"summary":"Submit a confirmed template generation using the caller's existing billing and storage","tags":["Templates"]}},"/v1/templates/{template}/metadata":{"get":{"description":"Authenticated canonical content for progressive rendering only. Existing policy middleware applies. Generation, editing and reference changes remain blocked until full detail for the same revision reports ready.","operationId":"getPublishedTemplateMetadata","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"revision":{"type":"integer"},"template":{"$ref":"#/components/schemas/TemplateDefinition"},"validation_status":{"enum":["pending"],"type":"string"}},"required":["id","revision","template","validation_status"],"type":"object"}}},"description":"Media/model compatibility has not been validated; no media URLs or catalogue are included."},"401":{"description":"A valid generation key is required; browser sign-in alone is insufficient"},"403":{"description":"Generation scope or existing policy denied access"},"404":{"description":"Unpublished","removed or unavailable template":null}},"summary":"Read current published content without opening media storage","tags":["Templates"]},"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}}]},"/v1/templates/{template}/validate-media":{"parameters":[{"in":"path","name":"template","required":true,"schema":{"format":"uuid","type":"string"}}],"post":{"description":"Requires generation scope. Fixed slots cannot be replaced; only declared variable slots accept owned reference IDs. Uses published settings and authorized model capabilities. Does not change the recipe, estimate, or create work.","operationId":"validateTemplateInputMedia","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateGenerationRequest"}}},"required":true},"responses":{"200":{"description":"Present references are valid"},"400":{"description":"Invalid or incompatible input"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Template or owned input unavailable"},"409":{"description":"Published revision changed"}},"summary":"Check partial owned inputs for a published recipe","tags":["Templates"]}},"/v1/videos":{"post":{"description":"Returns HTTP 202 immediately after queue admission. Poll status_url until completed/failed; download content_url with the same API key. Provider execution never runs synchronously in this request. This endpoint selects media_type=video. Multipart video forms may omit input_reference for text-to-video. Text-only forms do not require reference storage. File uploads are local-storage only, with a 32 MiB total limit. S3 file uploads return 409 direct_upload_required; upload with /v1/references/uploads and send the reference ID or URL. Local uploads are saved to the reference library; uploaded files remain reusable even if later generation admission fails. Use image/image[] for edits, input_reference for video. options is JSON text.","operationId":"post_v1_videos","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationRequest"}},"multipart/form-data":{"schema":{"properties":{"input_reference":{"format":"binary","type":"string"},"model":{"type":"string"},"options":{"description":"JSON-encoded MediaOptions","type":"string"},"prompt":{"type":"string"},"seconds":{"type":"string"},"size":{"type":"string"},"timeout_seconds":{"format":"int64","maximum":9223372036,"minimum":1,"type":"integer"}},"required":["model","prompt"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Generation accepted"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Budget exceeded"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Idempotency conflict or changed estimate"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Pricing unavailable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Create a video","tags":["Generations"],"x-required-scope":"generation"}},"/v1/videos/{id}":{"get":{"description":"Owner-scoped status. The video route returns 404 for other media types. All routes use the same statuses and Unix timestamps.","operationId":"get_v1_videos_id","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Generation"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Generation not found"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Retrieve asynchronous generation","tags":["Generations"]},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}]},"/v1/videos/{id}/content":{"get":{"description":"Authenticated result download using existing storage, Range and deletion behavior. Until a result is stored, no media is returned.","operationId":"get_v1_videos_id_content","responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"Stored media"},"206":{"description":"Partial content"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Result not available"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not ready"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Download generation content","tags":["Media"]},"head":{"description":"Authenticated result download using existing storage, Range and deletion behavior. Until a result is stored, no media is returned.","operationId":"head_v1_videos_id_content","responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"Stored media"},"206":{"description":"Partial content"},"307":{"description":"S3 file; follow the signed storage URL without forwarding Gateway credentials. S3 serves file bytes and Range requests directly.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Result not available"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not ready"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Inspect generation content","tags":["Media"]},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}]},"/v1/workspace-authorizations/approve":{"post":{"description":"Browser session and cross-origin protection. Requires the initiating customer's explicit consent. A new durable installation proof atomically creates a dedicated company and Supermanager membership; renewal reuses only its immutable customer/company binding. The central owner's personal approval is not required. Never accepts another recipient, billing credit, caller-selected scopes or provider keys. company-api-v1 requires an explicit matching access field and grants only the three documented company scopes; omitted/legacy intent remains generation-only. Company creation and approval are atomic/idempotent; keys are issued only on successful device proof. Optional rotation may revoke only a prior key of this exact installation and customer; a key from another company/installation is rejected.","operationId":"approveInstallationConsent","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"access":{"description":"Must match the persisted company consent intent when requesting company-api-v1","enum":["generation-v1","company-api-v1"],"type":"string"},"consent":{"type":"boolean"},"deny":{"type":"boolean"},"replace_previous":{"default":false,"type":"boolean"},"user_code":{"type":"string"}},"required":["user_code"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Approved or denied metadata; no credential"},"403":{"description":"Missing consent","role or company ownership":null,"wrong origin":null},"409":{"description":"Changed request","legacy protocol or installation binding conflict":null},"410":{"description":"Expired or unavailable authorization"}},"security":[{"sessionAuth":[]}],"summary":"Confirm a dedicated installation company or renew its own access"}},"/v1/workspace-authorizations/inspect":{"post":{"description":"Browser session only; API and deployment keys are rejected. Existing companies are never offered. request.provisioning is new or renewal; renewal exposes only this proof-bound organization_id/company_name after verifying the initiating customer and current Supermanager membership. Code inspection does not approve or create anything. The client origin/name are unverified display data and must be checked against the initiating installation.","operationId":"inspectInstallationConsent","requestBody":{"content":{"application/json":{"schema":{"properties":{"user_code":{"type":"string"}},"required":["user_code"],"type":"object"}}},"required":true},"responses":{"200":{"description":"request metadata with provisioning=new|renewal and bound organization_id/company_name for renewal; companies is empty; can_create indicates new provisioning"},"401":{"description":"Sign in or register through existing host identity flows"},"403":{"description":"Key authentication","sales account or disabled host":null},"410":{"description":"Missing or expired user code"}},"security":[{"sessionAuth":[]}],"summary":"Review a new dedicated-company request or the installation's existing binding"}},"/v1/workspace-installations":{"get":{"deprecated":true,"description":"Disabled. Use company-scoped central Administrator installation access. Internal disconnect/recovery and ordinary API-key management are unchanged.","operationId":"listMyInstallationGrants","responses":{"403":{"description":"Personal installation administration is unavailable"}},"security":[{"sessionAuth":[]}],"summary":"Former personal installation administration endpoint"}},"/v1/workspace-installations/{id}":{"delete":{"deprecated":true,"operationId":"revokeMyInstallationGrant","responses":{"403":{"description":"Use company-scoped central Administrator installation access"}},"security":[{"sessionAuth":[]}],"summary":"Former personal installation revocation endpoint"},"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}]}},"security":[{"bearerAuth":[]}],"servers":[{"description":"Gateway API","url":"https://media-gateway.sunday.games"}],"tags":[{"name":"Generations"},{"name":"Templates"},{"name":"Catalog"},{"name":"Media"},{"name":"References"},{"name":"Providers admin"},{"name":"Storage admin"},{"name":"Storage"},{"name":"API keys"},{"name":"Reports"},{"name":"Audit"},{"name":"Account"},{"name":"System"},{"name":"Organizations"},{"name":"Payments"}],"webhooks":{"taskEvent":{"post":{"description":"Sent to the webhook_url on the task. Delivery may repeat or arrive out of order. Verify the timestamp and HMAC-SHA256 signature over timestamp + a period + raw body using the deployment WEBHOOK_SIGNING_SECRET. This version has a deployment-wide signing secret, provisioned by the operator, not a per-account secret API.","parameters":[{"description":"Stable delivery ID; deduplicate this value.","in":"header","name":"X-Media-Gateway-Delivery","required":true,"schema":{"type":"string"}},{"description":"Task lifecycle event name.","in":"header","name":"X-Media-Gateway-Event","required":true,"schema":{"type":"string"}},{"description":"Unix timestamp in seconds.","in":"header","name":"X-Media-Gateway-Timestamp","required":true,"schema":{"type":"string"}},{"description":"v1= followed by lowercase hex HMAC-SHA256.","in":"header","name":"X-Media-Gateway-Signature","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}},"required":true},"responses":{"200":{"description":"Any 2xx acknowledges durable acceptance. Non-2xx and network failures are retried with bounded exponential backoff."}},"security":[],"summary":"Task lifecycle notification"}}}}
