{"openapi":"3.1.0","info":{"title":"Infrai API","version":"0.1.0","summary":"A zero-install REST API — one key, one wallet, one bill for every online-infrastructure capability an AI agent needs. No SDK.","description":"Unified online-infrastructure REST API for AI agents — called over plain HTTP, no SDK. All GA modules share one Bearer API key, one wallet, and a common Result envelope `{ ok, data?, error? }`. OpenAI-compatible AI inference paths use the OpenAI wire format instead, with an added `infrai` metadata block. Every response carries cost/vendor/latency/cache metadata; every error carries a machine-readable code, human_hint, and retryable flag. This spec is GENERATED from infrai-spec/discovery/manifest.json (SSOT) by web/console/scripts/gen-openapi.mjs — do not hand-edit. Request schemas are inlined for the capabilities that publish one in infrai-spec/schemas; capabilities without a published schema document an honest free-form body (see the discovery manifest for the live request shape). deploy/db/auth are later-phase candidates and are NOT part of this surface.","contact":{"name":"Infrai Support","email":"support@infrai.cc","url":"https://docs.infrai.cc"},"license":{"name":"Apache-2.0","identifier":"Apache-2.0"}},"servers":[{"url":"https://api.infrai.cc/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"account"},{"name":"ai"},{"name":"ai (openai-compatible)","description":"OpenAI-compatible AI inference surface (chat/embeddings/images/moderations/speech/transcriptions/models). Point any OpenAI client at base_url https://api.infrai.cc/v1; use model=\"auto\" for smart vendor routing."},{"name":"analytics"},{"name":"auth"},{"name":"captcha"},{"name":"cron"},{"name":"db"},{"name":"dns"},{"name":"email"},{"name":"errors"},{"name":"flags"},{"name":"image"},{"name":"logs"},{"name":"metrics"},{"name":"pdf"},{"name":"queue"},{"name":"realtime"},{"name":"risk"},{"name":"rtc"},{"name":"sms"},{"name":"storage"},{"name":"vector"},{"name":"video"},{"name":"web"}],"paths":{"/account/autorecharge/configure":{"put":{"tags":["account"],"operationId":"account_autorecharge_configure","summary":"Configure automatic balance top-up when funds fall below a trigger threshold, with anti-abuse caps.","description":"Configure automatic balance top-up when funds fall below a trigger threshold, with anti-abuse caps.","x-infrai-capability":"account.autorecharge.configure","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"AutorechargeConfigureRequest","description":"Request shape for account.autorecharge.configure. max_per_day/max_per_month are anti-abuse caps the trigger engine MUST enforce. Returns an AutorechargeConfig. See REVIEW Account §3.D.","type":"object","required":["trigger_balance","recharge_amount"],"additionalProperties":false,"properties":{"trigger_balance":{"type":"number","minimum":0,"description":"Auto-charge fires when wallet balance drops below this."},"recharge_amount":{"type":"number","exclusiveMinimum":0,"description":"Amount in USD to add each time auto-charge fires."},"payment_method_id":{"type":["string","null"],"description":"null uses the account default payment method."},"max_per_day":{"type":"integer","minimum":1,"default":3,"description":"Maximum recharge amount per day in USD"},"max_per_month":{"type":"integer","minimum":1,"default":30,"description":"Maximum recharge amount per month in USD"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/autorecharge/get":{"get":{"tags":["account"],"operationId":"account_autorecharge_get","summary":"Get the current auto-recharge configuration.","description":"Get the current auto-recharge configuration.","x-infrai-capability":"account.autorecharge.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/balance":{"get":{"tags":["account"],"operationId":"account_balance","summary":"Get the account wallet balance and trial status.","description":"Get the account wallet balance and trial status.","x-infrai-capability":"account.balance","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/budget/get":{"get":{"tags":["account"],"operationId":"account_budget_get","summary":"Get the budget configuration (period, hard cap, alert thresholds).","description":"Get the budget configuration (period, hard cap, alert thresholds).","x-infrai-capability":"account.budget.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/budget/set":{"put":{"tags":["account"],"operationId":"account_budget_set","summary":"Set a hard budget cap and alert thresholds, blocking billable calls when exceeded.","description":"Set a hard budget cap and alert thresholds, blocking billable calls when exceeded.","x-infrai-capability":"account.budget.set","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"BudgetSetRequest","description":"Request shape for account.budget.set. Returns a BudgetConfig. See REVIEW Account §3.D.","type":"object","required":["period"],"additionalProperties":false,"properties":{"hard_cap_usd":{"type":["number","null"],"minimum":0,"description":"Monthly spending hard cap in USD"},"period":{"enum":["daily","monthly"],"description":"Billing or retention period (e.g. monthly, daily)"},"alert_threshold_usd":{"type":["number","null"],"minimum":0,"description":"Monthly spending alert threshold in USD"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/keys/create":{"post":{"tags":["account"],"operationId":"account_keys_create","summary":"Create an API key; the secret is returned only once.","description":"Create an API key; the secret is returned only once.","x-infrai-capability":"account.keys.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"KeyCreateRequest","description":"Request shape for account.keys.create. Returns an ApiKey whose key_secret is populated exactly once. See REVIEW Account §3.B.","type":"object","additionalProperties":false,"properties":{"project_id":{"type":["string","null"],"description":"null = caller's current project."},"name":{"type":["string","null"],"maxLength":128,"description":"Human-readable name for this resource"},"scopes":{"type":["array","null"],"items":{"type":"string"},"description":"Empty/null = all-modules; explicit scopes per enums/key_scope.yaml."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/keys/list":{"get":{"tags":["account"],"operationId":"account_keys_list","summary":"List all API keys on the account and their status.","description":"List all API keys on the account and their status.","x-infrai-capability":"account.keys.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/keys/revoke/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["account"],"operationId":"account_keys_revoke","summary":"Revoke an API key, taking effect immediately.","description":"Revoke an API key, taking effect immediately.","x-infrai-capability":"account.keys.revoke","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/keys/rotate/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["account"],"operationId":"account_keys_rotate","summary":"Rotate an API key; the old secret stays valid during a grace period.","description":"Rotate an API key; the old secret stays valid during a grace period.","x-infrai-capability":"account.keys.rotate","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"KeyRotateRequest","description":"Request shape for account.keys.rotate — mint a new secret while the old key stays valid for grace_hours (status=rotating). Returns an ApiKey with the new key_secret (returned once). See REVIEW Account §3.B.","type":"object","additionalProperties":false,"properties":{"grace_hours":{"type":"integer","minimum":0,"maximum":168,"default":24,"description":"Hours the old key remains valid after rotation"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/keys/suspected_compromise/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["account"],"operationId":"account_keys_suspected_compromise","summary":"Report an API key as suspected compromised to immediately revoke and auto-reissue it.","description":"Report an API key as suspected compromised to immediately revoke and auto-reissue it.","x-infrai-capability":"account.keys.suspected_compromise","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"KeySuspectedCompromiseRequest","description":"Request shape for account.keys.suspected_compromise — report a key as possibly leaked. confirmed_leak=true revokes immediately; auto_rotate mints a replacement. Returns an ApiKey. See REVIEW Account §3.B.","type":"object","additionalProperties":false,"properties":{"confirmed_leak":{"type":"boolean","default":false,"description":"Whether the key leak has been confirmed"},"auto_rotate":{"type":"boolean","default":true,"description":"Whether to automatically rotate the compromised key"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/keys/update/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"tags":["account"],"operationId":"account_keys_update","summary":"Update an API key's name or scopes; scope tightening takes effect immediately.","description":"Update an API key's name or scopes; scope tightening takes effect immediately.","x-infrai-capability":"account.keys.update","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"KeyUpdateRequest","description":"Request shape for account.keys.update — rename and/or re-scope an existing key. Scope tightening takes effect immediately. Returns the updated ApiKey. Net-new (no prior SDK signature). See REVIEW Account §3.B.","type":"object","additionalProperties":false,"properties":{"name":{"type":["string","null"],"maxLength":128,"description":"Human-readable name for this resource"},"scopes":{"type":["array","null"],"items":{"type":"string"},"description":"Permission scopes granted to this API key"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/payment_method/set_default":{"post":{"tags":["account"],"operationId":"account_payment_method_set_default","summary":"Set a payment method as the account default.","description":"Set a payment method as the account default.","x-infrai-capability":"account.payment_method.set_default","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PaymentMethodSetDefaultRequest","description":"Request shape for account.payment_method.set_default. Returns the updated AccountPaymentMethod. See REVIEW Account §3.D.","type":"object","required":["payment_method_id"],"additionalProperties":false,"properties":{"payment_method_id":{"type":"string","description":"Identifier of the payment method used"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/routing/get":{"get":{"tags":["account"],"operationId":"account_routing_get","summary":"Get the account's AI routing preference: per-capability vendor chains (model-annotated) + excluded vendors.","description":"Get the account's AI routing preference: per-capability vendor chains (model-annotated) + excluded vendors.","x-infrai-capability":"account.routing.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/routing/set":{"put":{"tags":["account"],"operationId":"account_routing_set","summary":"Exclude vendors from an AI capability's routing (cost / reliability / data sovereignty).","description":"Exclude vendors from an AI capability's routing (cost / reliability / data sovereignty).","x-infrai-capability":"account.routing.set","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"RoutingSetRequest","description":"Request shape for account.routing.set — set a per-account vendor routing preference for one AI-inference capability (only ai.* stateless capabilities are customizable). The only lever is `exclude` (never route my AI traffic to these vendors); failover ORDER is platform-managed by health/price, and WHICH model runs is the `model` pin / task+mode axes, not a vendor list.","type":"object","required":["capability"],"additionalProperties":false,"properties":{"capability":{"type":"string","description":"AI-inference capability id (ai.*) whose vendor exclude is being set.","example":"ai.chat"},"exclude":{"type":"array","items":{"type":"string"},"default":[],"description":"Vendors to never route this capability to (cost / reliability / data sovereignty).","example":["openai"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/routing/test":{"post":{"tags":["account"],"operationId":"account_routing_test","summary":"Test routing resolution for an AI capability: the vendor chain and the model each serves.","description":"Test routing resolution for an AI capability: the vendor chain and the model each serves.","x-infrai-capability":"account.routing.test","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"RoutingTestRequest","description":"Request for account.routing.test — dry-run the account's effective vendor fallback chain for one capability. Read-only reachability probe: returns the resolved chain (each entry's vendor + model + whether it is currently up) with NO vendor call and NO spend.","type":"object","additionalProperties":false,"properties":{"capability":{"type":["string","null"],"default":"ai.chat","example":"ai.chat","description":"Capability id whose routing chain to test (defaults to ai.chat)."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/subscription/get":{"get":{"tags":["account"],"operationId":"account_subscription_get","summary":"Get the subscription status and billing period.","description":"Get the subscription status and billing period.","x-infrai-capability":"account.subscription.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/tier":{"get":{"tags":["account"],"operationId":"account_tier","summary":"Get the current tier and its quota limits.","description":"Get the current tier and its quota limits.","x-infrai-capability":"account.tier","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/tier/upgrade":{"post":{"tags":["account"],"operationId":"account_tier_upgrade","summary":"Upgrade the account tier (pro/team/enterprise), returning a checkout URL when payment is required.","description":"Upgrade the account tier (pro/team/enterprise), returning a checkout URL when payment is required.","x-infrai-capability":"account.tier.upgrade","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"UpgradeRequest","description":"Request shape for account.tier.upgrade. `target` upgrade set is {pro,team,enterprise}; note `team` is a checkout/subscription label only — the persisted TierInfo.tier is always one of standard/pro/enterprise. See REVIEW Account §3.A / §4.","type":"object","required":["target"],"additionalProperties":false,"properties":{"target":{"enum":["pro","team","enterprise"],"description":"Target URL or resource for webhook or notification"},"return_url":{"type":["string","null"],"format":"uri","description":"Where checkout redirects after success/cancel; echoed into the hosted checkout session."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/topup":{"post":{"tags":["account"],"operationId":"account_topup","summary":"Create a Stripe top-up session and return the hosted payment page URL.","description":"Create a Stripe top-up session and return the hosted payment page URL.","x-infrai-capability":"account.topup","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"TopupRequest","description":"Request shape for account.topup — start a wallet top-up. The top-up stays PENDING until the caller completes browser checkout; the wallet is never fake-credited. Returns topup_id + checkout_url. See Strategy §5.6 (email-bind gate).","type":"object","additionalProperties":false,"properties":{"amount_usd":{"type":["number","null"],"minimum":0,"description":"Top-up amount in USD."},"amount":{"type":["number","null"],"minimum":0,"description":"Legacy alias for amount_usd."},"currency":{"type":"string","default":"USD","description":"ISO 4217 currency code (e.g. USD, CNY)"},"return_url":{"type":["string","null"],"description":"URL the checkout redirects back to; defaults to the configured return URL.","format":"uri"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/usage":{"get":{"tags":["account"],"operationId":"account_usage","summary":"Summarize usage for the current billing period: spend, request count, and a per-capability breakdown.","description":"Summarize usage for the current billing period: spend, request count, and a per-capability breakdown.","x-infrai-capability":"account.usage","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/usage/timeseries":{"get":{"tags":["account"],"operationId":"account_usage_timeseries","summary":"Return a usage time series at hour, day, or month granularity.","description":"Return a usage time series at hour, day, or month granularity.","x-infrai-capability":"account.usage.timeseries","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/webhooks/delete/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["account"],"operationId":"account_webhooks_delete","summary":"Delete a webhook registration; no further event deliveries are sent to its URL. Idempotent.","description":"Delete a webhook registration; no further event deliveries are sent to its URL. Idempotent.","x-infrai-capability":"account.webhooks.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/webhooks/deliveries/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["account"],"operationId":"account_webhooks_deliveries","summary":"List a webhook's delivery records with pagination.","description":"List a webhook's delivery records with pagination.","x-infrai-capability":"account.webhooks.deliveries","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/webhooks/get/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["account"],"operationId":"account_webhooks_get","summary":"Get details for a single webhook.","description":"Get details for a single webhook.","x-infrai-capability":"account.webhooks.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/webhooks/list":{"get":{"tags":["account"],"operationId":"account_webhooks_list","summary":"List registered webhooks with pagination.","description":"List registered webhooks with pagination.","x-infrai-capability":"account.webhooks.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/webhooks/register":{"post":{"tags":["account"],"operationId":"account_webhooks_register","summary":"Register a webhook (public HTTPS, SSRF-validated); the signing secret is returned only once.","description":"Register a webhook (public HTTPS, SSRF-validated); the signing secret is returned only once.","x-infrai-capability":"account.webhooks.register","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"WebhookRegisterRequest","description":"Request shape for account.webhooks.register. url MUST be a public https endpoint — the server runs an SSRF check and rejects private/loopback ranges. Returns a Webhook (secret returned once). See REVIEW Account §3.E.","type":"object","required":["url","events"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","description":"URL for this resource or endpoint"},"events":{"type":"array","minItems":1,"items":{"type":"string","enum":["account.created","account.updated","account.absorbed","account.device_linked","account.deleted","topup.succeeded","topup.failed","topup.review_started","autorecharge.charged","autorecharge.failed","subscription.activated","subscription.renewed","subscription.cancelled","kyc.status_changed","tier.upgraded","tier.downgraded","wallet.low_balance","wallet.expiring_soon","wallet.expired","email.queued","email.sent","email.delivered","email.opened","email.clicked","email.bounced","email.complained","email.deferred","email.cancelled","email.unsubscribed","email.auto_suppressed","sms.queued","sms.sent","sms.delivered","sms.failed","sms.inbound","image.job.completed","image.job.failed","video.job.completed","video.job.failed","ai.batch.completed","ai.batch.failed","captcha.verified","captcha.failed","realtime.channel.occupied","realtime.channel.vacated","realtime.member.added","realtime.member.removed","cron.executed","cron.failed","queue.dlq","error.captured","error.rate_anomaly","system.vendor.down","system.maintenance.scheduled"],"description":"THE single global catalog of webhook events. Per SDK Conventions §10, Infrai"},"description":"Event types to subscribe this webhook to; the closed set is the global event catalog."},"description":{"type":["string","null"],"maxLength":256,"description":"Free-text description of this resource"},"secret":{"type":["string","null"],"description":"Optional caller-provided signing secret; auto-generated when null."},"retry_policy":{"type":["string","null"],"enum":["default","aggressive",null],"description":"Retry policy configuration"},"headers":{"type":["object","null"],"description":"Custom HTTP headers added to every delivery."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/webhooks/test/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["account"],"operationId":"account_webhooks_test","summary":"Send a test event to a webhook to verify connectivity.","description":"Send a test event to a webhook to verify connectivity.","x-infrai-capability":"account.webhooks.test","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"No request schema is published in infrai-spec for this capability yet; see the discovery manifest (/.well-known/infrai-discovery.json, capability `account.webhooks.test`) for the live request shape."}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/webhooks/update/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"tags":["account"],"operationId":"account_webhooks_update","summary":"Partially update a webhook; changing the URL re-runs SSRF validation.","description":"Partially update a webhook; changing the URL re-runs SSRF validation.","x-infrai-capability":"account.webhooks.update","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"WebhookUpdateRequest","description":"Request shape for account.webhooks.update — partial update of an existing Webhook. url change re-runs the SSRF check. Returns the updated Webhook. See REVIEW Account §3.E.","type":"object","additionalProperties":false,"properties":{"url":{"type":["string","null"],"format":"uri","description":"URL for this resource or endpoint"},"events":{"type":["array","null"],"minItems":1,"items":{"type":"string","enum":["account.created","account.updated","account.absorbed","account.device_linked","account.deleted","topup.succeeded","topup.failed","topup.review_started","autorecharge.charged","autorecharge.failed","subscription.activated","subscription.renewed","subscription.cancelled","kyc.status_changed","tier.upgraded","tier.downgraded","wallet.low_balance","wallet.expiring_soon","wallet.expired","email.queued","email.sent","email.delivered","email.opened","email.clicked","email.bounced","email.complained","email.deferred","email.cancelled","email.unsubscribed","email.auto_suppressed","sms.queued","sms.sent","sms.delivered","sms.failed","sms.inbound","image.job.completed","image.job.failed","video.job.completed","video.job.failed","ai.batch.completed","ai.batch.failed","captcha.verified","captcha.failed","realtime.channel.occupied","realtime.channel.vacated","realtime.member.added","realtime.member.removed","cron.executed","cron.failed","queue.dlq","error.captured","error.rate_anomaly","system.vendor.down","system.maintenance.scheduled"],"description":"THE single global catalog of webhook events. Per SDK Conventions §10, Infrai"},"description":"List of event types this subscription listens to"},"description":{"type":["string","null"],"maxLength":256,"description":"Free-text description of this resource"},"active":{"type":["boolean","null"],"description":"Whether this resource is currently active"},"retry_policy":{"type":["string","null"],"enum":["default","aggressive",null],"description":"Retry policy configuration"},"headers":{"type":["object","null"],"description":"Custom HTTP headers to include in requests or responses"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/account/whoami":{"get":{"tags":["account"],"operationId":"account_whoami","summary":"Get an account summary (ID, type, status, tier, balance).","description":"Get an account summary (ID, type, status, tier, balance).","x-infrai-capability":"account.whoami","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/batch/cancel/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["ai"],"operationId":"ai_batch_cancel","summary":"Cancel an in-progress batch job (idempotent).","description":"Cancel an in-progress batch job (idempotent).","x-infrai-capability":"ai.batch.cancel","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"BatchCancelRequest","description":"Request shape for ai.batch.cancel — cancel a batch job. Returns batch_id + state.","type":"object","required":["batch_id"],"additionalProperties":false,"properties":{"batch_id":{"type":"string","description":"Id of the batch job to cancel."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/batch/export/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["ai"],"operationId":"ai_batch_export","summary":"Export batch results to a JSONL or CSV file and return a download job.","description":"Export batch results to a JSONL or CSV file and return a download job.","x-infrai-capability":"ai.batch.export","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ExportRequest","description":"Request shape for ai.batch.export / ai.chat.history.export. Kicks off an async export of the addressed resource. See docs/Infrai_SDK_AI_Runtime.md §2.3.","type":"object","additionalProperties":false,"properties":{"batch_id":{"type":["string","null"],"pattern":"^batch_[A-Za-z0-9]{20,}$","description":"Target batch for ai.batch.export."},"conversation_id":{"type":["string","null"],"description":"Target conversation for ai.chat.history.export; null = all history."},"format":{"enum":["jsonl","csv"],"default":"jsonl","description":"Output or input format (e.g. json, csv, png)"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"metadata":{"type":["object","null"],"description":"Arbitrary key-value metadata attached to this resource"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/batch/list":{"get":{"tags":["ai"],"operationId":"ai_batch_list","summary":"List all batch jobs on the account with pagination.","description":"List all batch jobs on the account with pagination.","x-infrai-capability":"ai.batch.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/batch/results/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["ai"],"operationId":"ai_batch_results","summary":"Fetch per-item results of a batch job with pagination.","description":"Fetch per-item results of a batch job with pagination.","x-infrai-capability":"ai.batch.results","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/batch/status/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["ai"],"operationId":"ai_batch_status","summary":"Get a batch job's status, progress, and completed/failed counts.","description":"Get a batch job's status, progress, and completed/failed counts.","x-infrai-capability":"ai.batch.status","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/batch/submit":{"post":{"tags":["ai"],"operationId":"ai_batch_submit","summary":"Submit a batch of AI requests as one async batch job (billed at cost pass-through with no markup).","description":"Submit a batch of AI requests as one async batch job (billed at cost pass-through with no markup).","x-infrai-capability":"ai.batch.submit","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"BatchSubmitRequest","description":"Request shape for ai.chat.batch_submit / ai.embed.batch_submit. requests is an array of individual capability requests. See docs/Infrai_SDK_AI_Runtime.md §2.2.1.","type":"object","required":["requests"],"additionalProperties":false,"properties":{"requests":{"type":"array","minItems":1,"items":{"type":"object"},"description":"Each item is a ChatRequest / EmbeddingRequest payload."},"batch_timeout":{"type":"string","default":"24h","examples":["1h","24h"],"description":"Maximum wall-clock the batch may run before expiring."},"metadata":{"type":["object","null"],"description":"Arbitrary key-value metadata attached to this resource"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced asset/record in Infrai's own store (default false = stateless passthrough: process, return inline, keep nothing). When true, Infrai persists the asset, bills a self-hosted storage line item and applies a retention TTL — and only then do the *.list/get/delete read caps see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/cost/compare":{"post":{"tags":["ai"],"operationId":"ai_cost_compare","summary":"Estimate and compare the cost of the same request across multiple models.","description":"Estimate and compare the cost of the same request across multiple models.","x-infrai-capability":"ai.cost.compare","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"CostEstimateRequest","description":"Request shape for ai.cost.estimate (single model) and ai.cost.compare (models[] for multi-model comparison). Unknown model_id MUST raise MODEL_NOT_FOUND (no silent fallback). See docs/Infrai_SDK_AI_Runtime.md §1.6.","type":"object","required":["messages"],"additionalProperties":false,"properties":{"messages":{"type":"array","minItems":1,"items":{"title":"ChatMessage","type":"object","required":["role"],"additionalProperties":false,"properties":{"role":{"enum":["system","user","assistant","tool"],"description":"Role of the message author (system, user, assistant, tool)"},"content":{"oneOf":[{"type":"string"},{"type":"array"},{"type":"null"}],"description":"DNS record value/content"},"name":{"type":"string","description":"Human-readable name for this resource"},"tool_calls":{"type":"array","items":{"title":"ToolCall","type":"object","required":["id","type","function"],"additionalProperties":false,"properties":{"id":{"type":"string","description":"Unique identifier for this resource"},"type":{"const":"function","description":"Type discriminator for this resource"},"function":{"type":"object","required":["name","arguments"],"additionalProperties":false,"properties":{"name":{"type":"string"},"arguments":{"type":"string","description":"JSON-encoded string."}},"description":"Function definition for tool calling"}}},"description":"Tool/function calls requested by the model"},"tool_call_id":{"type":"string","description":"Present when role='tool'."}}},"description":"Chat messages to price (same shape as ai.chat); cost is estimated from their token count."},"model":{"type":["string","null"],"default":"openai/gpt-4o","description":"Single model to estimate. Used by ai.cost.estimate. Explicit model_id is allowed here (selection semantics)."},"models":{"type":["array","null"],"items":{"type":"string"},"description":"Models to compare. Used by ai.cost.compare; result is sorted ascending by final cost."},"expected_output_tokens":{"type":"integer","minimum":0,"default":500,"description":"Assumed completion length for the estimate."},"cache_strategy":{"enum":["vendor","infrai","none"],"default":"vendor","description":"Cache strategy hint (none, exact, semantic)"},"batch_mode":{"type":"boolean","default":false,"description":"When true, applies the 50% batch discount to the estimate."},"tools":{"type":["array","null"],"items":{"type":"object"},"description":"Tool/function definitions for the model to call"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/cost/estimate":{"post":{"tags":["ai"],"operationId":"ai_cost_estimate","summary":"Estimate token counts and itemized cost for an AI request before calling it.","description":"Estimate token counts and itemized cost for an AI request before calling it.","x-infrai-capability":"ai.cost.estimate","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"CostEstimateRequest","description":"Request shape for ai.cost.estimate (single model) and ai.cost.compare (models[] for multi-model comparison). Unknown model_id MUST raise MODEL_NOT_FOUND (no silent fallback). See docs/Infrai_SDK_AI_Runtime.md §1.6.","type":"object","required":["messages"],"additionalProperties":false,"properties":{"messages":{"type":"array","minItems":1,"items":{"title":"ChatMessage","type":"object","required":["role"],"additionalProperties":false,"properties":{"role":{"enum":["system","user","assistant","tool"],"description":"Role of the message author (system, user, assistant, tool)"},"content":{"oneOf":[{"type":"string"},{"type":"array"},{"type":"null"}],"description":"DNS record value/content"},"name":{"type":"string","description":"Human-readable name for this resource"},"tool_calls":{"type":"array","items":{"title":"ToolCall","type":"object","required":["id","type","function"],"additionalProperties":false,"properties":{"id":{"type":"string","description":"Unique identifier for this resource"},"type":{"const":"function","description":"Type discriminator for this resource"},"function":{"type":"object","required":["name","arguments"],"additionalProperties":false,"properties":{"name":{"type":"string"},"arguments":{"type":"string","description":"JSON-encoded string."}},"description":"Function definition for tool calling"}}},"description":"Tool/function calls requested by the model"},"tool_call_id":{"type":"string","description":"Present when role='tool'."}}},"description":"Chat messages to price (same shape as ai.chat); cost is estimated from their token count."},"model":{"type":["string","null"],"default":"openai/gpt-4o","description":"Single model to estimate. Used by ai.cost.estimate. Explicit model_id is allowed here (selection semantics)."},"models":{"type":["array","null"],"items":{"type":"string"},"description":"Models to compare. Used by ai.cost.compare; result is sorted ascending by final cost."},"expected_output_tokens":{"type":"integer","minimum":0,"default":500,"description":"Assumed completion length for the estimate."},"cache_strategy":{"enum":["vendor","infrai","none"],"default":"vendor","description":"Cache strategy hint (none, exact, semantic)"},"batch_mode":{"type":"boolean","default":false,"description":"When true, applies the 50% batch discount to the estimate."},"tools":{"type":["array","null"],"items":{"type":"object"},"description":"Tool/function definitions for the model to call"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/image/upscale":{"post":{"tags":["ai"],"operationId":"ai_image_upscale","summary":"Upscale an image losslessly by 2x or 4x with an AI model (idempotent). To transform an EXISTING image otherwise use the image.* module.","description":"Upscale an image losslessly by 2x or 4x with an AI model (idempotent). To transform an EXISTING image otherwise use the image.* module.","x-infrai-capability":"ai.image.upscale","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageUpscaleRequest","description":"Request shape for ai.image.upscale. See docs/Infrai_SDK_AI_Runtime.md §3.4.","type":"object","required":["image"],"additionalProperties":false,"properties":{"image":{"type":"string","description":"URL / file path / base64 of the source image.","example":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="},"factor":{"enum":[2,4],"default":2,"description":"Upscale factor (e.g. 2 or 4)"},"model":{"type":["string","null"],"description":"Model identifier to use for generation"},"vendor":{"type":["string","null"],"description":"Vendor that handled or will handle this request"},"timeout_seconds":{"type":"integer","minimum":1,"maximum":600,"default":120,"description":"Maximum execution time in seconds"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"metadata":{"type":["object","null"],"description":"Arbitrary key-value metadata attached to this resource"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced asset/record in Infrai's own store (default false = stateless passthrough: process, return inline, keep nothing). When true, Infrai persists the asset, bills a self-hosted storage line item and applies a retention TTL — and only then do the *.list/get/delete read caps see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/rerank":{"post":{"tags":["ai"],"operationId":"ai_rerank","summary":"Reorder a list of candidate documents by relevance to a query, returning each candidate's original index and a vendor relevance score. Real vendor dispatch: Cohere rerank, Qwen/DashScope gte-rerank. Replaces the previous original-order mock.","description":"Reorder a list of candidate documents by relevance to a query, returning each candidate's original index and a vendor relevance score. Real vendor dispatch: Cohere rerank, Qwen/DashScope gte-rerank. Replaces the previous original-order mock.","x-infrai-capability":"ai.rerank","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"RerankRequest","description":"Request payload for ai.rerank — order candidate documents by relevance to a query.","type":"object","required":["query","candidates"],"additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"Search query string for reranking"},"candidates":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Documents to score against the query; the response returns them reordered by relevance."},"top_k":{"type":"integer","minimum":1,"default":10,"description":"Number of top results to return"},"model":{"type":"string","description":"Optional model pin (e.g. rerank-english-v3.0, gte-rerank)."},"vendor":{"enum":["cohere","jina","qwen"],"description":"Optional vendor pin."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/tokens/count":{"post":{"tags":["ai"],"operationId":"ai_tokens_count","summary":"Count input tokens for a set of messages under a given model.","description":"Count input tokens for a set of messages under a given model.","x-infrai-capability":"ai.tokens.count","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"TokenCountRequest","description":"Request shape for ai.tokens.count. Counts prompt tokens (incl. tool-definition overhead) before sending. Read-only / no network. See docs/Infrai_SDK_AI_Runtime.md §1.5.","type":"object","required":["messages"],"additionalProperties":false,"properties":{"messages":{"type":"array","minItems":1,"items":{"title":"ChatMessage","type":"object","required":["role"],"additionalProperties":false,"properties":{"role":{"enum":["system","user","assistant","tool"],"description":"Role of the message author (system, user, assistant, tool)"},"content":{"oneOf":[{"type":"string"},{"type":"array"},{"type":"null"}],"description":"DNS record value/content"},"name":{"type":"string","description":"Human-readable name for this resource"},"tool_calls":{"type":"array","items":{"title":"ToolCall","type":"object","required":["id","type","function"],"additionalProperties":false,"properties":{"id":{"type":"string","description":"Unique identifier for this resource"},"type":{"const":"function","description":"Type discriminator for this resource"},"function":{"type":"object","required":["name","arguments"],"additionalProperties":false,"properties":{"name":{"type":"string"},"arguments":{"type":"string","description":"JSON-encoded string."}},"description":"Function definition for tool calling"}}},"description":"Tool/function calls requested by the model"},"tool_call_id":{"type":"string","description":"Present when role='tool'."}}},"description":"Chat messages to tokenize (same shape as ai.chat), including tool-definition overhead."},"model":{"type":["string","null"],"description":"Tokenizer model; null = default. Determines which encoding is used."},"tools":{"type":["array","null"],"items":{"type":"object"},"description":"Tool definitions; their serialized overhead is included in the count."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/tts/voices":{"get":{"tags":["ai"],"operationId":"ai_tts_voices","summary":"List available text-to-speech voices with pagination.","description":"List available text-to-speech voices with pagination.","x-infrai-capability":"ai.tts.voices","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/ai/voice/session":{"post":{"tags":["ai"],"operationId":"ai_voice_session","summary":"Mint a short-lived token for an AI realtime VOICE/multimodal conversation session (e.g. OpenAI Realtime). NOT pub/sub channel auth — see realtime.token.issue.","description":"Mint a short-lived token for an AI realtime VOICE/multimodal conversation session (e.g. OpenAI Realtime). NOT pub/sub channel auth — see realtime.token.issue.","x-infrai-capability":"ai.voice.session","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"VoiceSessionRequest","description":"Request shape for ai.voice.session — mint a short-lived realtime voice session credential from the vendor. Returns client_secret + model. Fail-closed: no usable key yields VENDOR_AUTH_ERROR (never a fabricated token).","type":"object","additionalProperties":false,"properties":{"model":{"type":["string","null"],"description":"Realtime voice model; null lets the server pick a default."},"voice":{"type":["string","null"],"description":"Voice id/name to use for the session."},"vendor":{"type":["string","null"],"description":"Pin to a specific vendor; disables failover."},"instructions":{"type":["string","null"],"description":"System instructions for the realtime session."},"modalities":{"type":["array","null"],"items":{"type":"string"},"description":"Enabled modalities (e.g. text, audio)."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/analytics/alias":{"post":{"tags":["analytics"],"operationId":"analytics_alias","summary":"Rename or merge an anonymous distinct_id (old_id) into a known identity (new_id).","description":"Rename or merge an anonymous distinct_id (old_id) into a known identity (new_id).","x-infrai-capability":"analytics.alias","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"AnalyticsAliasRequest","description":"Request for analytics.alias: rename / merge an anonymous distinct_id (old_id) into a known one (new_id). Carried through ingest_event(kind=alias). `merged` is a RESULT field (see AliasResult), not an input.","type":"object","required":["old_id","new_id"],"additionalProperties":false,"properties":{"old_id":{"type":"string","description":"The distinct_id to rename from (e.g. anonymous id)."},"new_id":{"type":"string","description":"The canonical distinct_id to merge into."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/analytics/batch":{"post":{"tags":["analytics"],"operationId":"analytics_batch","summary":"Ingest up to 1000 TrackEvent events in a single call (idempotency is per-event).","description":"Ingest up to 1000 TrackEvent events in a single call (idempotency is per-event).","x-infrai-capability":"analytics.batch","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"AnalyticsBatchRequest","description":"Request for analytics.batch. Up to 1000 TrackEvent items written in one call (direct to ingest_batch). Idempotency is per-event (each TrackEvent carries its own idempotency_key) — there is NO batch-level idempotency_key. Over 1000 events raises ANALYTICS_BATCH_TOO_LARGE.","type":"object","required":["events"],"additionalProperties":false,"properties":{"events":{"type":"array","minItems":1,"maxItems":1000,"items":{"title":"TrackEvent","description":"Single ingestion event for analytics.track. See docs/phase2/P2_03_New_Modules.md §12.2.","type":"object","required":["event","distinct_id"],"additionalProperties":false,"properties":{"event":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_.-]{0,127}$","description":"Event name you are recording (e.g. 'signup', 'purchase') — the verb of the action."},"distinct_id":{"type":"string","description":"Distinct identifier for the user or entity"},"properties":{"type":["object","null"],"description":"Additional properties for risk assessment"},"timestamp":{"type":["string","null"],"format":"date-time","description":"Unix timestamp of the data point"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"context":{"type":["object","null"],"description":"{ip, ua, session_id}"}}},"description":"Up to 1000 TrackEvent items."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/analytics/group":{"post":{"tags":["analytics"],"operationId":"analytics_group","summary":"Associate a distinct_id with a group (organization/team/account) for B2B account-level aggregation.","description":"Associate a distinct_id with a group (organization/team/account) for B2B account-level aggregation.","x-infrai-capability":"analytics.group","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"AnalyticsGroupRequest","description":"Request for analytics.group: associate a distinct_id with a group (org/team/account) for B2B account-level aggregation. Carried through ingest_event(kind=group).","type":"object","required":["distinct_id","group_type","group_key"],"additionalProperties":false,"properties":{"distinct_id":{"type":"string","description":"Distinct identifier for the user or entity"},"group_type":{"type":"string","description":"Group dimension, e.g. \"company\" / \"team\"."},"group_key":{"type":"string","description":"Group identifier within group_type."},"traits":{"type":["object","null"],"description":"Optional group profile traits."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/analytics/identify":{"post":{"tags":["analytics"],"operationId":"analytics_identify","summary":"Set profile traits on a distinct_id, optionally merging a prior id via alias_for.","description":"Set profile traits on a distinct_id, optionally merging a prior id via alias_for.","x-infrai-capability":"analytics.identify","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"AnalyticsIdentifyRequest","description":"Request for analytics.identify: set profile traits on a distinct_id and, optionally, merge a prior id via alias_for (second identity-merge path). Returns IdentifyResult (which does NOT echo traits).","type":"object","required":["distinct_id"],"additionalProperties":false,"properties":{"distinct_id":{"type":"string","description":"Distinct identifier for the user or entity"},"traits":{"type":["object","null"],"description":"Profile traits to merge onto the user."},"alias_for":{"type":["string","null"],"description":"Optional prior distinct_id to merge into this one at identify time."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/analytics/query/events":{"post":{"tags":["analytics"],"operationId":"analytics_query_events","summary":"Query raw events within a time window, with attribute filters and cursor pagination.","description":"Query raw events within a time window, with attribute filters and cursor pagination.","x-infrai-capability":"analytics.query.events","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"AnalyticsQueryEventsRequest","description":"Request for analytics.query.events: retrieve raw events in a time window with optional property filter, cursor-paginated (native cursor from query_events). Returns EventQueryResult.","type":"object","required":["since","until"],"additionalProperties":false,"properties":{"since":{"type":"string","format":"date-time","description":"Window start (inclusive)."},"until":{"type":"string","format":"date-time","description":"Window end (exclusive)."},"filter":{"type":["object","null"],"description":"Optional property filter (key/value match)."},"limit":{"type":"integer","minimum":1,"maximum":1000,"default":1000,"description":"Maximum number of items to return per page"},"cursor":{"type":["string","null"],"description":"Opaque cursor from a prior page's next_cursor."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/analytics/query/path":{"post":{"tags":["analytics"],"operationId":"analytics_query_path","summary":"Build behavioral path/sequence trees rooted at a start event within a time window.","description":"Build behavioral path/sequence trees rooted at a start event within a time window.","x-infrai-capability":"analytics.query.path","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"AnalyticsQueryPathRequest","description":"Request for analytics.query.path: behavior path/sequence tree rooted at start_event over a time window, up to max_depth. Returns PathResult (root: str, recursive children tree).","type":"object","required":["start_event","since","until"],"additionalProperties":false,"properties":{"start_event":{"type":"string","description":"Root event the path tree branches from."},"since":{"type":"string","format":"date-time","description":"ISO 8601 date when the current tier or state became effective"},"until":{"type":"string","format":"date-time","description":"ISO 8601 date/time for the end of the query range"},"max_depth":{"type":"integer","minimum":1,"maximum":20,"default":5,"description":"Maximum depth of the path tree to return"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/analytics/query/retention":{"post":{"tags":["analytics"],"operationId":"analytics_query_retention","summary":"Compute a retention matrix bucketed by period from a born event to a return event.","description":"Compute a retention matrix bucketed by period from a born event to a return event.","x-infrai-capability":"analytics.query.retention","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"AnalyticsQueryRetentionRequest","description":"Request for analytics.query.retention: retention matrix from a born_event to a return_event over a time window, bucketed by interval. Returns RetentionResult.","type":"object","required":["born_event","return_event","since","until"],"additionalProperties":false,"properties":{"born_event":{"type":"string","description":"Event that defines cohort membership (day 0)."},"return_event":{"type":"string","description":"Event whose recurrence defines retention."},"since":{"type":"string","format":"date-time","description":"ISO 8601 date when the current tier or state became effective"},"until":{"type":"string","format":"date-time","description":"ISO 8601 date/time for the end of the query range"},"interval":{"default":"day","description":"Time interval for retention buckets (e.g. day, week)","type":"string","enum":["day","week","month"]}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/analytics/track":{"post":{"tags":["analytics"],"operationId":"analytics_track","summary":"Ingest a single product analytics event with properties for a distinct user; idempotent.","description":"Ingest a single product analytics event with properties for a distinct user; idempotent.","x-infrai-capability":"analytics.track","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"TrackEvent","description":"Single ingestion event for analytics.track. See docs/phase2/P2_03_New_Modules.md §12.2.","type":"object","required":["event","distinct_id"],"additionalProperties":false,"properties":{"event":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_.-]{0,127}$","description":"Event name you are recording (e.g. 'signup', 'purchase') — the verb of the action."},"distinct_id":{"type":"string","description":"Distinct identifier for the user or entity"},"properties":{"type":["object","null"],"description":"Additional properties for risk assessment"},"timestamp":{"type":["string","null"],"format":"date-time","description":"Unix timestamp of the data point"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"context":{"type":["object","null"],"description":"{ip, ua, session_id}"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/audio/speech":{"post":{"tags":["ai (openai-compatible)"],"operationId":"audio_speech","summary":"Synthesize speech audio from text — text-to-speech (OpenAI-compatible).","description":"Synthesize speech audio from text — text-to-speech (OpenAI-compatible). OpenAI-compatible: point the official OpenAI SDK/client at base_url https://api.infrai.cc/v1 with your infrai key as the Bearer token. See https://platform.openai.com/docs/api-reference for the full request/response contract; infrai adds smart routing (model=\"auto\") and returns an extra `infrai` metadata block (cost_usd / vendor / latency / cache_hit) on every response.","x-infrai-openai-compatible":true,"x-infrai-capability":"ai.tts","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input","voice"],"properties":{"model":{"type":"string","description":"Model to use. \"auto\" (default) = infrai smart routing picks the best/cheapest healthy vendor; or pin a specific model as \"vendor/model\" (e.g. \"openai/gpt-4o-mini\", \"dashscope/qwen-plus\").","examples":["auto","openai/gpt-4o-mini"]},"input":{"type":"string","description":"The text to synthesize."},"voice":{"type":"string","description":"Voice id (e.g. \"alloy\")."},"response_format":{"type":"string","description":"e.g. \"mp3\", \"wav\"."},"speed":{"type":"number"}},"additionalProperties":true}}}},"responses":{"200":{"description":"OpenAI-compatible binary audio response. Infrai metadata is returned in X-Infrai-* headers.","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}},"audio/wav":{"schema":{"type":"string","format":"binary"}},"audio/ogg":{"schema":{"type":"string","format":"binary"}},"audio/flac":{"schema":{"type":"string","format":"binary"}},"audio/mp4":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request — INVALID_ARGUMENT and other client-input errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"401":{"description":"Unauthorized — missing/invalid/revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"402":{"description":"Payment required — INSUFFICIENT_CREDIT / wallet errors (carries checkout_url).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"409":{"description":"Conflict — idempotency-key conflict or resource-state conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"429":{"description":"Too many requests — rate limited (carries retry backoff).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"503":{"description":"Service unavailable — maintenance / no healthy vendor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"default":{"description":"OpenAI-compatible error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}}}}},"/audio/transcriptions":{"post":{"tags":["ai (openai-compatible)"],"operationId":"audio_transcriptions","summary":"Transcribe audio to text — speech-to-text (OpenAI-compatible, multipart/form-data).","description":"Transcribe audio to text — speech-to-text (OpenAI-compatible, multipart/form-data). OpenAI-compatible: point the official OpenAI SDK/client at base_url https://api.infrai.cc/v1 with your infrai key as the Bearer token. See https://platform.openai.com/docs/api-reference for the full request/response contract; infrai adds smart routing (model=\"auto\") and returns an extra `infrai` metadata block (cost_usd / vendor / latency / cache_hit) on every response.","x-infrai-openai-compatible":true,"x-infrai-capability":"ai.asr","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OpenAI-compatible JSON response with infrai metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAITranscription"}}}},"400":{"description":"Bad request — INVALID_ARGUMENT and other client-input errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"401":{"description":"Unauthorized — missing/invalid/revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"402":{"description":"Payment required — INSUFFICIENT_CREDIT / wallet errors (carries checkout_url).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"409":{"description":"Conflict — idempotency-key conflict or resource-state conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"429":{"description":"Too many requests — rate limited (carries retry backoff).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"503":{"description":"Service unavailable — maintenance / no healthy vendor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"default":{"description":"OpenAI-compatible error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Audio file to transcribe."},"model":{"type":"string","description":"Model to use. \"auto\" (default) = infrai smart routing picks the best/cheapest healthy vendor; or pin a specific model as \"vendor/model\" (e.g. \"openai/gpt-4o-mini\", \"dashscope/qwen-plus\").","examples":["auto","openai/gpt-4o-mini"]},"language":{"type":"string","description":"ISO-639-1 language hint."},"response_format":{"type":"string","enum":["json","text","srt","verbose_json","vtt"]}},"additionalProperties":true}}}}}},"/auth/consent/check/{user_id}/{category}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"category","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["auth"],"operationId":"auth_consent_check","summary":"Check whether a user currently holds consent for a given category (boolean).","description":"Check whether a user currently holds consent for a given category (boolean).","x-infrai-capability":"auth.consent.check","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/consent/grant/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["auth"],"operationId":"auth_consent_grant","summary":"Record a GDPR/CCPA consent grant for a user/category. Accepts idempotency_key.","description":"Record a GDPR/CCPA consent grant for a user/category. Accepts idempotency_key.","x-infrai-capability":"auth.consent.grant","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ConsentGrantRequest","description":"Request for auth.consent.grant — record a user's consent for a category (path user_id).","type":"object","required":["user_id","category"],"additionalProperties":false,"properties":{"user_id":{"type":"string","pattern":"^au_usr_[A-Za-z0-9]{20,}$","description":"Path param."},"category":{"type":"string","enum":["marketing","analytics","essential","third_party"],"description":"Consent category (e.g. marketing, analytics)"},"source":{"type":"string","default":"explicit","description":"How consent was captured."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/consent/list_for_user/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["auth"],"operationId":"auth_consent_list_for_user","summary":"List all consent records for a user across GDPR categories.","description":"List all consent records for a user across GDPR categories.","x-infrai-capability":"auth.consent.list_for_user","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/consent/revoke/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["auth"],"operationId":"auth_consent_revoke","summary":"Revoke a previously granted consent for a user/category. Accepts idempotency_key.","description":"Revoke a previously granted consent for a user/category. Accepts idempotency_key.","x-infrai-capability":"auth.consent.revoke","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ConsentRevokeRequest","description":"Request for auth.consent.revoke — withdraw a user's consent for a category (path user_id).","type":"object","required":["user_id","category"],"additionalProperties":false,"properties":{"user_id":{"type":"string","pattern":"^au_usr_[A-Za-z0-9]{20,}$","description":"Path param."},"category":{"type":"string","enum":["marketing","analytics","essential","third_party"],"description":"Consent category (e.g. marketing, analytics)"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/email/change_confirm":{"post":{"tags":["auth"],"operationId":"auth_email_change_confirm","summary":"Confirm an email change with the single-use token from the new address; switches the user's email. Returns AUTH_TOKEN_REUSED on replay. Accepts idempotency_key.","description":"Confirm an email change with the single-use token from the new address; switches the user's email. Returns AUTH_TOKEN_REUSED on replay. Accepts idempotency_key.","x-infrai-capability":"auth.email.change_confirm","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"EmailChangeConfirmRequest","description":"Request for auth.email.change_confirm — confirm an email change with the single-use token from the new address. Replay returns AUTH_TOKEN_REUSED.","type":"object","required":["token"],"additionalProperties":false,"properties":{"token":{"type":"string","minLength":1,"description":"Authentication or verification token"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/email/change_request":{"post":{"tags":["auth"],"operationId":"auth_email_change_request","summary":"Start an email change for a user; sends a single-use signed verification token to the NEW address (self-built, no BYOK). Accepts idempotency_key.","description":"Start an email change for a user; sends a single-use signed verification token to the NEW address (self-built, no BYOK). Accepts idempotency_key.","x-infrai-capability":"auth.email.change_request","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"EmailChangeRequest","description":"Request for auth.email.change_request — start an email change for a user; sends a single-use signed verification token to the NEW address.","type":"object","required":["user_id","new_email"],"additionalProperties":false,"properties":{"user_id":{"type":"string","minLength":1,"description":"User identifier associated with this resource"},"new_email":{"type":"string","minLength":3,"format":"email","description":"New email address; the signed verification link is sent here."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/email/send_code":{"post":{"tags":["auth"],"operationId":"auth_email_send_code","summary":"Send a short-lived single-use email OTP to a user for verification or passwordless login (self-built). Accepts idempotency_key.","description":"Send a short-lived single-use email OTP to a user for verification or passwordless login (self-built). Accepts idempotency_key.","x-infrai-capability":"auth.email.send_code","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"EmailSendCodeRequest","description":"Request for auth.email.send_code — send a short-lived single-use email OTP (self-built, no BYOK).","type":"object","required":["email"],"additionalProperties":false,"properties":{"email":{"type":"string","minLength":3,"format":"email","description":"Email address"},"purpose":{"type":"string","enum":["verify","login"],"default":"verify","description":"Purpose of the DNS record"},"locale":{"type":"string","description":"End-user's current language (BCP-47, e.g. 'zh-CN' / 'en'); the OTP email is rendered in it (zh/en supported, default en). Pass your app's UI locale so the code reaches the user in their language.","examples":["zh-CN","en"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/email/verify":{"post":{"tags":["auth"],"operationId":"auth_email_verify","summary":"Verify an email OTP AND log in: on success resolves-or-creates the unified user (passwordless signup) and mints a session, returning {verified, user_id, created, session_id, access_token, refresh_token, expires_at} — a one-call login matching Auth0/Clerk/Supabase verifyOtp. Pass login=false for a bare code-check. Wrong/expired returns AUTH_CODE_INVALID. Accepts idempotency_key.","description":"Verify an email OTP AND log in: on success resolves-or-creates the unified user (passwordless signup) and mints a session, returning {verified, user_id, created, session_id, access_token, refresh_token, expires_at} — a one-call login matching Auth0/Clerk/Supabase verifyOtp. Pass login=false for a bare code-check. Wrong/expired returns AUTH_CODE_INVALID. Accepts idempotency_key.","x-infrai-capability":"auth.email.verify","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"EmailVerifyRequest","description":"Request for auth.email.verify — verify an email OTP code (single-use, short TTL). Wrong/expired returns AUTH_CODE_INVALID; replay returns AUTH_TOKEN_REUSED.","type":"object","required":["email","code"],"additionalProperties":false,"properties":{"email":{"type":"string","minLength":3,"format":"email","description":"Email address"},"code":{"type":"string","minLength":1,"description":"Authorization code from the OAuth provider"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/identity/add/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["auth"],"operationId":"auth_identity_add","summary":"Bind an additional login identity (email/phone/external) to an existing user. Idempotent if already this user's; IDENTITY_ALREADY_LINKED if another user owns it (no auto-merge).","description":"Bind an additional login identity (email/phone/external) to an existing user. Idempotent if already this user's; IDENTITY_ALREADY_LINKED if another user owns it (no auto-merge).","x-infrai-capability":"auth.identity.add","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"IdentityResolveRequest","description":"Resolve / look up / add an identity. `type` + `value` are REQUIRED: type is the identity kind (email | phone | external), value is the address/subject (an email, an E.164 phone, or a provider subject id). For external (e.g. wechat/google OIDC) also pass `provider`. resolve() creates the unified user when none exists (create defaults true); add() attaches the identity to the path user_id. Returns the resolved/created user.","type":"object","additionalProperties":false,"required":["type","value"],"properties":{"type":{"type":"string","enum":["email","phone","external"],"example":"email","description":"Identity kind."},"value":{"type":"string","example":"user@example.com","description":"The identity address/subject — an email, an E.164 phone, or a provider subject id (must match `type`)."},"provider":{"type":["string","null"],"description":"For type=external: the provider id (e.g. wechat, google, github)."},"create":{"type":["boolean","null"],"default":true,"description":"resolve(): create a unified user when none matches (default true)."},"verified":{"type":["boolean","null"],"description":"Mark the identity verified on attach (e.g. a tenant-vouched external subject)."},"account_id":{"type":["string","null"],"description":"Tenant scope (defaults to the authenticated account)."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/identity/get":{"post":{"tags":["auth"],"operationId":"auth_identity_get","summary":"Look up the end-user that owns a given identity (email/phone/external subject) without creating one; returns IDENTITY_NOT_FOUND if unknown.","description":"Look up the end-user that owns a given identity (email/phone/external subject) without creating one; returns IDENTITY_NOT_FOUND if unknown.","x-infrai-capability":"auth.identity.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"IdentityResolveRequest","description":"Resolve / look up / add an identity. `type` + `value` are REQUIRED: type is the identity kind (email | phone | external), value is the address/subject (an email, an E.164 phone, or a provider subject id). For external (e.g. wechat/google OIDC) also pass `provider`. resolve() creates the unified user when none exists (create defaults true); add() attaches the identity to the path user_id. Returns the resolved/created user.","type":"object","additionalProperties":false,"required":["type","value"],"properties":{"type":{"type":"string","enum":["email","phone","external"],"example":"email","description":"Identity kind."},"value":{"type":"string","example":"user@example.com","description":"The identity address/subject — an email, an E.164 phone, or a provider subject id (must match `type`)."},"provider":{"type":["string","null"],"description":"For type=external: the provider id (e.g. wechat, google, github)."},"create":{"type":["boolean","null"],"default":true,"description":"resolve(): create a unified user when none matches (default true)."},"verified":{"type":["boolean","null"],"description":"Mark the identity verified on attach (e.g. a tenant-vouched external subject)."},"account_id":{"type":["string","null"],"description":"Tenant scope (defaults to the authenticated account)."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/identity/list/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["auth"],"operationId":"auth_identity_list","summary":"List every login identity (email/phone/external) attached to a user.","description":"List every login identity (email/phone/external) attached to a user.","x-infrai-capability":"auth.identity.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/identity/remove/{user_id}/{identity_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"identity_id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["auth"],"operationId":"auth_identity_remove","summary":"Unlink one identity from a user; refuses IDENTITY_LAST_REMAINING when it is the user's only remaining identity.","description":"Unlink one identity from a user; refuses IDENTITY_LAST_REMAINING when it is the user's only remaining identity.","x-infrai-capability":"auth.identity.remove","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/identity/resolve":{"post":{"tags":["auth"],"operationId":"auth_identity_resolve","summary":"Unified login/register: resolve a (tenant-vouched) email, phone, or external-provider identity to its end-user, minting the user + identity if unknown. type=external + provider (e.g. 'wechat') + value=<subject> handles any third-party login; one person who arrives via different identities maps to the SAME user_id.","description":"Unified login/register: resolve a (tenant-vouched) email, phone, or external-provider identity to its end-user, minting the user + identity if unknown. type=external + provider (e.g. 'wechat') + value=<subject> handles any third-party login; one person who arrives via different identities maps to the SAME user_id.","x-infrai-capability":"auth.identity.resolve","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"IdentityResolveRequest","description":"Resolve / look up / add an identity. `type` + `value` are REQUIRED: type is the identity kind (email | phone | external), value is the address/subject (an email, an E.164 phone, or a provider subject id). For external (e.g. wechat/google OIDC) also pass `provider`. resolve() creates the unified user when none exists (create defaults true); add() attaches the identity to the path user_id. Returns the resolved/created user.","type":"object","additionalProperties":false,"required":["type","value"],"properties":{"type":{"type":"string","enum":["email","phone","external"],"example":"email","description":"Identity kind."},"value":{"type":"string","example":"user@example.com","description":"The identity address/subject — an email, an E.164 phone, or a provider subject id (must match `type`)."},"provider":{"type":["string","null"],"description":"For type=external: the provider id (e.g. wechat, google, github)."},"create":{"type":["boolean","null"],"default":true,"description":"resolve(): create a unified user when none matches (default true)."},"verified":{"type":["boolean","null"],"description":"Mark the identity verified on attach (e.g. a tenant-vouched external subject)."},"account_id":{"type":["string","null"],"description":"Tenant scope (defaults to the authenticated account)."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/oauth/authorize_url":{"get":{"tags":["auth"],"operationId":"auth_oauth_authorize_url","summary":"Build the provider authorize URL (provider must be one of the enabled set — see auth.oauth.providers) with state, nonce and PKCE challenge; return_to/redirect_uri must be in the account's registered allowlist.","description":"Build the provider authorize URL (provider must be one of the enabled set — see auth.oauth.providers) with state, nonce and PKCE challenge; return_to/redirect_uri must be in the account's registered allowlist.","x-infrai-capability":"auth.oauth.authorize_url","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/oauth/callback":{"post":{"tags":["auth"],"operationId":"auth_oauth_callback","summary":"Complete the OAuth flow: validate state + redirect_uri, exchange the code, link/create the user and mint a session. Honest typed error if the provider is not configured.","description":"Complete the OAuth flow: validate state + redirect_uri, exchange the code, link/create the user and mint a session. Honest typed error if the provider is not configured.","x-infrai-capability":"auth.oauth.callback","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"OAuthCallbackRequest","description":"Request for auth.oauth.callback — complete the OAuth flow: validate state + redirect_uri, exchange the code, link/create the user and mint a session.","type":"object","required":["provider","code","state","redirect_uri"],"additionalProperties":false,"properties":{"provider":{"description":"OAuth provider name (e.g. google, github)","type":"string","enum":["google","github","apple","facebook"]},"code":{"type":"string","minLength":1,"description":"Authorization code from the OAuth provider"},"state":{"type":"string","minLength":1,"description":"Current lifecycle state of this resource"},"redirect_uri":{"type":"string","minLength":1,"format":"uri","description":"Redirect URI registered with the OAuth provider"},"code_verifier":{"type":["string","null"],"description":"PKCE verifier matching the challenge from authorize_url."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/oauth/providers":{"get":{"tags":["auth"],"operationId":"auth_oauth_providers","summary":"List the OAuth providers an end user can sign in with right now, each flagged ready (real client_id configured), plus the unified consent-screen brand. The runtime companion to the AuthProvider enum in discovery.","description":"List the OAuth providers an end user can sign in with right now, each flagged ready (real client_id configured), plus the unified consent-screen brand. The runtime companion to the AuthProvider enum in discovery.","x-infrai-capability":"auth.oauth.providers","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/password/change":{"post":{"tags":["auth"],"operationId":"auth_password_change","summary":"Change a user's password after verifying the current one (AUTH_INVALID_CREDENTIALS on mismatch); argon2id re-hash. Accepts idempotency_key.","description":"Change a user's password after verifying the current one (AUTH_INVALID_CREDENTIALS on mismatch); argon2id re-hash. Accepts idempotency_key.","x-infrai-capability":"auth.password.change","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PasswordChangeRequest","description":"Request for auth.password.change — verify current password then argon2id re-hash the new one. Mismatch returns AUTH_INVALID_CREDENTIALS; weak password returns AUTH_PASSWORD_TOO_WEAK.","type":"object","required":["user_id","current_password","new_password"],"additionalProperties":false,"properties":{"user_id":{"type":"string","minLength":1,"description":"User identifier associated with this resource"},"current_password":{"type":"string","minLength":1,"description":"Current password for verification"},"new_password":{"type":"string","minLength":1,"description":"New password for the account"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/password/reset_confirm":{"post":{"tags":["auth"],"operationId":"auth_password_reset_confirm","summary":"Confirm a password reset with {email, code, new_password} — verifies the 6-digit code from reset_request, re-hashes (argon2id) and revokes all sessions. Wrong/expired code returns AUTH_CODE_INVALID; weak password returns AUTH_PASSWORD_TOO_WEAK. Accepts idempotency_key.","description":"Confirm a password reset with {email, code, new_password} — verifies the 6-digit code from reset_request, re-hashes (argon2id) and revokes all sessions. Wrong/expired code returns AUTH_CODE_INVALID; weak password returns AUTH_PASSWORD_TOO_WEAK. Accepts idempotency_key.","x-infrai-capability":"auth.password.reset_confirm","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PasswordResetConfirmRequest","description":"Request for auth.password.reset_confirm — confirm a password reset with the email, the single-use 6-digit code from reset_request, and the new password (code-style, Supabase pattern). Re-hashes (argon2id) and revokes all of the user's sessions. Wrong/expired code returns AUTH_CODE_INVALID; weak password returns AUTH_PASSWORD_TOO_WEAK.","type":"object","required":["email","code","new_password"],"additionalProperties":false,"properties":{"email":{"type":"string","format":"email","description":"Email address"},"code":{"type":"string","minLength":4,"maxLength":8,"description":"Authorization code from the OAuth provider"},"new_password":{"type":"string","minLength":1,"description":"New password for the account"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/password/reset_request":{"post":{"tags":["auth"],"operationId":"auth_password_reset_request","summary":"Request a password reset (code-style, Supabase pattern); always returns 200 (no user-existence leak) and emails a single-use 6-digit code when the email is known. Accepts idempotency_key.","description":"Request a password reset (code-style, Supabase pattern); always returns 200 (no user-existence leak) and emails a single-use 6-digit code when the email is known. Accepts idempotency_key.","x-infrai-capability":"auth.password.reset_request","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PasswordResetRequest","description":"Request for auth.password.reset_request — always returns 200 (no user-existence leak) and emails a single-use signed reset token.","type":"object","required":["email"],"additionalProperties":false,"properties":{"email":{"type":"string","minLength":3,"format":"email","description":"Email address"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/phone/send_code":{"post":{"tags":["auth"],"operationId":"auth_phone_send_code","summary":"Send a short-lived single-use phone (SMS) OTP to a user (self-built; SMS delivery depends on infra.sms). Accepts idempotency_key.","description":"Send a short-lived single-use phone (SMS) OTP to a user (self-built; SMS delivery depends on infra.sms). Accepts idempotency_key.","x-infrai-capability":"auth.phone.send_code","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PhoneSendCodeRequest","description":"Request for auth.phone.send_code — send a short-lived single-use SMS OTP (self-built; SMS delivery depends on infra.sms).","type":"object","required":["phone"],"additionalProperties":false,"properties":{"phone":{"type":"string","minLength":3,"description":"Phone number in E.164 format"},"purpose":{"type":"string","enum":["verify","login"],"default":"verify","description":"Purpose of the DNS record"},"locale":{"type":"string","description":"End-user's current language (BCP-47, e.g. 'zh-CN' / 'en'); the OTP SMS is rendered in it (zh/en supported, default en). Pass your app's UI locale so the code reaches the user in their language.","examples":["zh-CN","en"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/phone/verify":{"post":{"tags":["auth"],"operationId":"auth_phone_verify","summary":"Verify a phone OTP AND log in: on success resolves-or-creates the unified user (passwordless signup) and mints a session, returning {verified, user_id, created, session_id, access_token, refresh_token, expires_at} — a one-call login matching Auth0/Clerk/Supabase. Pass login=false for a bare code-check. Wrong/expired returns AUTH_CODE_INVALID. Accepts idempotency_key.","description":"Verify a phone OTP AND log in: on success resolves-or-creates the unified user (passwordless signup) and mints a session, returning {verified, user_id, created, session_id, access_token, refresh_token, expires_at} — a one-call login matching Auth0/Clerk/Supabase. Pass login=false for a bare code-check. Wrong/expired returns AUTH_CODE_INVALID. Accepts idempotency_key.","x-infrai-capability":"auth.phone.verify","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PhoneVerifyRequest","description":"Request for auth.phone.verify — verify a phone OTP code (single-use, short TTL). Wrong/expired returns AUTH_CODE_INVALID; replay returns AUTH_TOKEN_REUSED.","type":"object","required":["phone","code"],"additionalProperties":false,"properties":{"phone":{"type":"string","minLength":3,"description":"Phone number in E.164 format"},"code":{"type":"string","minLength":1,"description":"Authorization code from the OAuth provider"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/session/create":{"post":{"tags":["auth"],"operationId":"auth_session_create","summary":"Mint an authenticated session for a user; routes to the user's pinned vendor. May return AUTH_MFA_REQUIRED. Accepts idempotency_key.","description":"Mint an authenticated session for a user; routes to the user's pinned vendor. May return AUTH_MFA_REQUIRED. Accepts idempotency_key.","x-infrai-capability":"auth.session.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SessionCreateRequest","description":"Request for auth.session.create — mint a session for a user (vendor inferred from the user).","type":"object","required":["user_id"],"additionalProperties":false,"properties":{"user_id":{"type":"string","pattern":"^au_usr_[A-Za-z0-9]{20,}$","description":"User identifier associated with this resource"},"method":{"type":"string","enum":["password","magic_link","otp","oauth","passkey"],"default":"password","description":"Authentication method used (e.g. email_otp, oauth, password)"},"mfa_factor":{"type":["string","null"],"description":"MFA factor / code when require_mfa."},"require_mfa":{"type":"boolean","default":false,"description":"Whether MFA is required to complete authentication"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/session/list_for_user/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["auth"],"operationId":"auth_session_list_for_user","summary":"List active sessions for a given user.","description":"List active sessions for a given user.","x-infrai-capability":"auth.session.list_for_user","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/session/refresh":{"post":{"tags":["auth"],"operationId":"auth_session_refresh","summary":"Exchange a refresh token for a new session; enforces 5-min cooldown (AUTH_REFRESH_TOO_FREQUENT). Accepts idempotency_key.","description":"Exchange a refresh token for a new session; enforces 5-min cooldown (AUTH_REFRESH_TOO_FREQUENT). Accepts idempotency_key.","x-infrai-capability":"auth.session.refresh","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SessionRefreshRequest","description":"Request for auth.session.refresh — exchange a refresh token for a fresh session (5-min cooldown).","type":"object","required":["refresh_token"],"additionalProperties":false,"properties":{"refresh_token":{"type":"string","minLength":1,"description":"Long-lived token used to obtain new access tokens"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/session/revoke_all_for_user/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["auth"],"operationId":"auth_session_revoke_all_for_user","summary":"Revoke all active sessions for a user (e.g. password reset / logout-everywhere). Accepts idempotency_key.","description":"Revoke all active sessions for a user (e.g. password reset / logout-everywhere). Accepts idempotency_key.","x-infrai-capability":"auth.session.revoke_all_for_user","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SessionRevokeAllRequest","description":"Request for auth.session.revoke_all_for_user — log out all devices for a user (path user_id).","type":"object","required":["user_id"],"additionalProperties":false,"properties":{"user_id":{"type":"string","pattern":"^au_usr_[A-Za-z0-9]{20,}$","description":"Path param; revoke all this user's active sessions."},"except_session_id":{"type":["string","null"],"description":"Keep this one session alive (e.g. the current browser)."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/session/revoke/{session_id}":{"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["auth"],"operationId":"auth_session_revoke","summary":"Revoke a single session by session_id. Accepts idempotency_key.","description":"Revoke a single session by session_id. Accepts idempotency_key.","x-infrai-capability":"auth.session.revoke","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SessionRevokeRequest","description":"Request for auth.session.revoke — revoke a single session (path session_id; idempotent).","type":"object","required":["session_id"],"additionalProperties":false,"properties":{"session_id":{"type":"string","minLength":1,"description":"Path param; the session to revoke."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/session/verify/{session_id}":{"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["auth"],"operationId":"auth_session_verify","summary":"Verify a session_id / JWT against the vendor JWKS (RS256+ES256) and return the Session.","description":"Verify a session_id / JWT against the vendor JWKS (RS256+ES256) and return the Session.","x-infrai-capability":"auth.session.verify","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/token/jwks":{"get":{"tags":["auth"],"operationId":"auth_token_jwks","summary":"Return the public JWKS (EdDSA) for offline verification of Infrai-issued access JWTs — clients verify tokens with zero round-trips.","description":"Return the public JWKS (EdDSA) for offline verification of Infrai-issued access JWTs — clients verify tokens with zero round-trips.","x-infrai-capability":"auth.token.jwks","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/user/create":{"post":{"tags":["auth"],"operationId":"auth_user_create","summary":"Create an auth user across a vendor (Clerk/WorkOS/Supabase Auth). Pins the vendor of record (sticky-on-resource). Accepts idempotency_key.","description":"Create an auth user across a vendor (Clerk/WorkOS/Supabase Auth). Pins the vendor of record (sticky-on-resource). Accepts idempotency_key.","x-infrai-capability":"auth.user.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"UserCreateRequest","description":"Request for auth.user.create — create an auth user (vendor pinned at create). server-assigned user_id is returned, not sent.","type":"object","required":["email"],"additionalProperties":false,"properties":{"email":{"type":"string","format":"email","description":"Email address"},"password":{"type":["string","null"],"description":"Optional initial password (vendor-dependent)."},"metadata":{"type":["object","null"],"additionalProperties":true,"description":"Arbitrary key-value metadata attached to this resource"},"vendor":{"type":["string","null"],"enum":["infrai_native",null],"description":"Explicit vendor pin (auth is self-operated: infrai_native only)."},"mode":{"type":"string","enum":["default_vendor","verified_account"],"default":"default_vendor","description":"Delivery mode or operation mode"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/user/delete/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["auth"],"operationId":"auth_user_delete","summary":"Delete an auth user and cascade-revoke its sessions. Accepts idempotency_key.","description":"Delete an auth user and cascade-revoke its sessions. Accepts idempotency_key.","x-infrai-capability":"auth.user.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/user/get_by_email":{"get":{"tags":["auth"],"operationId":"auth_user_get_by_email","summary":"Look up an auth user by email address.","description":"Look up an auth user by email address.","x-infrai-capability":"auth.user.get_by_email","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/user/get/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["auth"],"operationId":"auth_user_get","summary":"Fetch a single auth user by user_id from its pinned vendor.","description":"Fetch a single auth user by user_id from its pinned vendor.","x-infrai-capability":"auth.user.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/user/list":{"get":{"tags":["auth"],"operationId":"auth_user_list","summary":"Cursor-paginated list of auth users for the account.","description":"Cursor-paginated list of auth users for the account.","x-infrai-capability":"auth.user.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/auth/user/update/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"tags":["auth"],"operationId":"auth_user_update","summary":"Update mutable fields (metadata, phone, MFA) of an existing auth user. Accepts idempotency_key.","description":"Update mutable fields (metadata, phone, MFA) of an existing auth user. Accepts idempotency_key.","x-infrai-capability":"auth.user.update","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"UserUpdateRequest","description":"Request for auth.user.update — patch a user's mutable fields (path user_id).","type":"object","required":["user_id"],"additionalProperties":false,"properties":{"user_id":{"type":"string","pattern":"^au_usr_[A-Za-z0-9]{20,}$","description":"Path param; the user to update."},"metadata":{"type":["object","null"],"additionalProperties":true,"description":"Arbitrary key-value metadata attached to this resource"},"email_verified":{"type":["boolean","null"],"description":"Whether the email address has been verified"},"mfa_enabled":{"type":["boolean","null"],"description":"Whether multi-factor authentication is enabled for this user"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/captcha/verify":{"post":{"tags":["captcha"],"operationId":"captcha_verify","summary":"Verify a client-submitted CAPTCHA token against the vendor and return the success result; idempotent.","description":"Verify a client-submitted CAPTCHA token against the vendor and return the success result; idempotent.","x-infrai-capability":"captcha.verify","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"CaptchaVerifyRequest","description":"Request for captcha.verify. Canonical param names (edge/module contract): use `ip` (alias `remoteip`), `action`, `score_threshold`, and result field `success` (NOT remote_ip/expected_action/min_score/valid).","type":"object","required":["token"],"additionalProperties":false,"properties":{"token":{"type":"string","minLength":1,"description":"One-time vendor response token from the client widget."},"vendor":{"type":["string","null"],"description":"Pin to a specific vendor (turnstile/hcaptcha/recaptcha). Default: routed."},"ip":{"type":["string","null"],"description":"End-user IP for vendor-side risk scoring. Alias: `remoteip`."},"remoteip":{"type":["string","null"],"description":"Alias of `ip` (module accepts both; `ip = ip or remoteip`)."},"action":{"type":["string","null"],"description":"Action name bound at challenge time; rejected if mismatched (anti cross-form replay)."},"expected_hostname":{"type":["string","null"],"description":"If set, token hostname must match."},"score_threshold":{"type":["number","null"],"minimum":0,"maximum":1,"description":"Minimum acceptable score [0,1]; below → fail with low-score reason."},"mode":{"enum":["default_vendor","verified_account"],"default":"default_vendor","description":"Routing axis (CaptchaMode); orthogonal to widget_mode."},"sitekey_label":{"type":"string","default":"default","description":"KeyPool entry name selecting which sitekey/secret to verify against (multi-sitekey accounts)."},"idempotency_key":{"type":["string","null"],"description":"Carries one-time-token semantics; duplicate replay → CAPTCHA_IDEMPOTENCY_KEY_CONFLICT."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/chat/completions":{"post":{"tags":["ai (openai-compatible)"],"operationId":"chat_completions","summary":"Create a chat completion (OpenAI-compatible) with smart vendor routing.","description":"Create a chat completion (OpenAI-compatible) with smart vendor routing. OpenAI-compatible: point the official OpenAI SDK/client at base_url https://api.infrai.cc/v1 with your infrai key as the Bearer token. See https://platform.openai.com/docs/api-reference for the full request/response contract; infrai adds smart routing (model=\"auto\") and returns an extra `infrai` metadata block (cost_usd / vendor / latency / cache_hit) on every response.","x-infrai-openai-compatible":true,"x-infrai-capability":"ai.chat","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messages"],"properties":{"model":{"type":"string","description":"Model to use. \"auto\" (default) = infrai smart routing picks the best/cheapest healthy vendor; or pin a specific model as \"vendor/model\" (e.g. \"openai/gpt-4o-mini\", \"dashscope/qwen-plus\").","examples":["auto","openai/gpt-4o-mini"]},"messages":{"type":"array","description":"OpenAI chat messages: a list of {role, content}.","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"]},"content":{"description":"String, or an OpenAI content-part array (vision)."}},"additionalProperties":true}},"temperature":{"type":"number"},"max_tokens":{"type":"integer"},"top_p":{"type":"number"},"stream":{"type":"boolean","description":"Server-Sent Events streaming when true."},"tools":{"type":"array","items":{"type":"object","additionalProperties":true}},"response_format":{"type":"object","additionalProperties":true}},"additionalProperties":true}}}},"responses":{"200":{"description":"OpenAI-compatible JSON response with infrai metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIChatCompletion"}}}},"400":{"description":"Bad request — INVALID_ARGUMENT and other client-input errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"401":{"description":"Unauthorized — missing/invalid/revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"402":{"description":"Payment required — INSUFFICIENT_CREDIT / wallet errors (carries checkout_url).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"409":{"description":"Conflict — idempotency-key conflict or resource-state conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"429":{"description":"Too many requests — rate limited (carries retry backoff).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"503":{"description":"Service unavailable — maintenance / no healthy vendor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"default":{"description":"OpenAI-compatible error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}}}}},"/cron/create":{"post":{"tags":["cron"],"operationId":"cron_create","summary":"Create a scheduled job: recurring via cron_expr, or a one-shot via run_at (fires once); idempotent write.","description":"Create a scheduled job: recurring via cron_expr, or a one-shot via run_at (fires once); idempotent write.","x-infrai-capability":"cron.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"CronCreateRequest","description":"Request shape for cron.create. A job is EITHER recurring (provide cron_expr) OR a one-shot (provide run_at, an absolute time — fires once via max_runs=1; supersedes the retired scheduling.task.schedule). Exposes the full module schedule() surface (task / overlap_policy / on_failure_webhook / timezone / retry / timeout). See REVIEW Scheduling §3.A and docs/Infrai_SDK_Scheduling.md §1.","type":"object","required":["task"],"oneOf":[{"required":["cron_expr"]},{"required":["run_at"]}],"additionalProperties":false,"properties":{"cron_expr":{"type":"string","description":"Standard 5/6-field cron expression (recurring schedule). Mutually exclusive with run_at."},"run_at":{"type":"string","format":"date-time","description":"Absolute UTC time for a ONE-SHOT job that fires exactly once (max_runs=1). Mutually exclusive with cron_expr."},"task":{"type":"string","format":"uri","description":"Delivery target URL the cron fires against (http_url task type)."},"name":{"type":["string","null"],"description":"Human-readable name for this resource"},"timezone":{"type":"string","default":"UTC","description":"IANA tz name."},"retry":{"type":"integer","minimum":0,"maximum":10,"default":3,"description":"Retry configuration for failed executions"},"timeout_seconds":{"type":"integer","minimum":1,"maximum":900,"default":300,"description":"Maximum execution time in seconds"},"overlap_policy":{"enum":["allow","skip","queue"],"default":"skip","description":"Policy for handling overlapping runs (skip, queue, cancel)"},"max_runs":{"type":["integer","null"],"minimum":1,"description":"Maximum number of runs to retain"},"payload":{"type":["object","null"],"description":"Payload data for the message or request body"},"headers":{"type":["object","null"],"description":"Custom HTTP headers to include in requests or responses"},"on_failure_webhook":{"type":["string","null"],"format":"uri","description":"Webhook URL to call on execution failure"},"secret":{"type":["string","null"],"description":"HMAC signing secret for the fired request; never returned (only secret_fingerprint)."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/cron/delete/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["cron"],"operationId":"cron_delete","summary":"Delete a cron job and stop all of its future scheduled runs; idempotent.","description":"Delete a cron job and stop all of its future scheduled runs; idempotent.","x-infrai-capability":"cron.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/cron/get/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["cron"],"operationId":"cron_get","summary":"Get a single cron job's configuration and next run time.","description":"Get a single cron job's configuration and next run time.","x-infrai-capability":"cron.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/cron/list":{"get":{"tags":["cron"],"operationId":"cron_list","summary":"List the account's cron jobs with pagination.","description":"List the account's cron jobs with pagination.","x-infrai-capability":"cron.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/cron/pause/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["cron"],"operationId":"cron_pause","summary":"Pause a cron job, halting subsequent triggers.","description":"Pause a cron job, halting subsequent triggers.","x-infrai-capability":"cron.pause","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"CronActionRequest","description":"Request shape for cron lifecycle actions (cron.pause / .resume / .trigger). Returns the updated CronJob (pause/resume) or the fired CronRun (trigger).","type":"object","required":["cron_id"],"additionalProperties":false,"properties":{"cron_id":{"type":"string","description":"Id of the cron job to act on."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/cron/resume/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["cron"],"operationId":"cron_resume","summary":"Resume a paused cron job.","description":"Resume a paused cron job.","x-infrai-capability":"cron.resume","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"CronActionRequest","description":"Request shape for cron lifecycle actions (cron.pause / .resume / .trigger). Returns the updated CronJob (pause/resume) or the fired CronRun (trigger).","type":"object","required":["cron_id"],"additionalProperties":false,"properties":{"cron_id":{"type":"string","description":"Id of the cron job to act on."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/cron/runs/get/{id}/{run_id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["cron"],"operationId":"cron_runs_get","summary":"Retrieve details of a single cron job execution (CronRun).","description":"Retrieve details of a single cron job execution (CronRun).","x-infrai-capability":"cron.runs.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/cron/runs/list/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["cron"],"operationId":"cron_runs_list","summary":"List a cron job's run history (executions) with pagination.","description":"List a cron job's run history (executions) with pagination.","x-infrai-capability":"cron.runs.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/cron/trigger/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["cron"],"operationId":"cron_trigger","summary":"Manually trigger an immediate run of a scheduled cron job.","description":"Manually trigger an immediate run of a scheduled cron job.","x-infrai-capability":"cron.trigger","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"CronActionRequest","description":"Request shape for cron lifecycle actions (cron.pause / .resume / .trigger). Returns the updated CronJob (pause/resume) or the fired CronRun (trigger).","type":"object","required":["cron_id"],"additionalProperties":false,"properties":{"cron_id":{"type":"string","description":"Id of the cron job to act on."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/cron/update/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"tags":["cron"],"operationId":"cron_update","summary":"Update a cron job's schedule expression, target, overlap policy, and other fields.","description":"Update a cron job's schedule expression, target, overlap policy, and other fields.","x-infrai-capability":"cron.update","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"CronUpdateRequest","description":"Request shape for cron.update. Partial update; preserves job_id + run history. See REVIEW Scheduling §3.A.","type":"object","additionalProperties":false,"properties":{"cron_expr":{"type":["string","null"],"description":"Cron expression for the schedule"},"task":{"type":["string","null"],"format":"uri","description":"Task URL or function to invoke on trigger"},"name":{"type":["string","null"],"description":"Human-readable name for this resource"},"timezone":{"type":["string","null"],"description":"IANA tz name."},"retry":{"type":["integer","null"],"minimum":0,"maximum":10,"description":"Retry configuration for failed executions"},"timeout_seconds":{"type":["integer","null"],"minimum":1,"maximum":900,"description":"Maximum execution time in seconds"},"overlap_policy":{"type":["string","null"],"enum":["allow","skip","queue",null],"description":"Policy for handling overlapping runs (skip, queue, cancel)"},"max_runs":{"type":["integer","null"],"minimum":1,"description":"Maximum number of runs to retain"},"payload":{"type":["object","null"],"description":"Payload data for the message or request body"},"headers":{"type":["object","null"],"description":"Custom HTTP headers to include in requests or responses"},"on_failure_webhook":{"type":["string","null"],"format":"uri","description":"Webhook URL to call on execution failure"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/branch/create":{"post":{"tags":["db"],"operationId":"db_branch_create","summary":"db branch create — managed database (Neon/Supabase/PlanetScale).","description":"db branch create — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.branch.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"BranchCreateRequest","description":"Request for db.branch.create — branch/clone a project off an existing branch.","type":"object","required":["project_id","branch_name"],"additionalProperties":false,"properties":{"project_id":{"type":"string","description":"Parent project id."},"branch_name":{"type":"string","minLength":1,"description":"Name of the database branch"},"from_branch":{"type":"string","default":"main","description":"Source branch to clone from."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/branch/delete/{project_id}":{"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["db"],"operationId":"db_branch_delete","summary":"db branch delete — managed database (Neon/Supabase/PlanetScale).","description":"db branch delete — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.branch.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/branch/get/{project_id}":{"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["db"],"operationId":"db_branch_get","summary":"db branch get — managed database (Neon/Supabase/PlanetScale).","description":"db branch get — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.branch.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/branch/list":{"get":{"tags":["db"],"operationId":"db_branch_list","summary":"db branch list — managed database (Neon/Supabase/PlanetScale).","description":"db branch list — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.branch.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/project/create":{"post":{"tags":["db"],"operationId":"db_project_create","summary":"db project create — managed database (Neon/Supabase/PlanetScale).","description":"db project create — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.project.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ProjectCreateRequest","description":"Request for db.project.create — provision a managed Postgres-compatible project (vendor sticky after create).","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"description":"Human-readable name for this resource"},"vendor":{"type":["string","null"],"enum":["tencent_pg",null],"description":"Explicit vendor pin (db is self-operated: tencent_pg only)."},"region":{"type":"string","default":"us-east-1","description":"Geographic region where this resource is located or processed"},"plan":{"type":"string","enum":["hobby","pro","scale"],"default":"hobby","description":"Pricing plan for the database instance"},"mode":{"type":"string","enum":["default_vendor","verified_account"],"default":"default_vendor","description":"Delivery mode or operation mode"},"postgres_version":{"type":"string","default":"15","description":"PostgreSQL version for the database"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/project/delete/{project_id}":{"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["db"],"operationId":"db_project_delete","summary":"db project delete — managed database (Neon/Supabase/PlanetScale).","description":"db project delete — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.project.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/project/get/{project_id}":{"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["db"],"operationId":"db_project_get","summary":"db project get — managed database (Neon/Supabase/PlanetScale).","description":"db project get — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.project.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/project/list":{"get":{"tags":["db"],"operationId":"db_project_list","summary":"db project list — managed database (Neon/Supabase/PlanetScale).","description":"db project list — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.project.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/snapshot/create":{"post":{"tags":["db"],"operationId":"db_snapshot_create","summary":"db snapshot create — managed database (Neon/Supabase/PlanetScale).","description":"db snapshot create — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.snapshot.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SnapshotCreateRequest","description":"Request for db.snapshot.create — take a point-in-time snapshot of a project.","type":"object","required":["project_id"],"additionalProperties":false,"properties":{"project_id":{"type":"string","description":"Project identifier"},"label":{"type":["string","null"],"description":"Human-readable snapshot label."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/snapshot/get/{snapshot_id}":{"parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["db"],"operationId":"db_snapshot_get","summary":"db snapshot get — managed database (Neon/Supabase/PlanetScale).","description":"db snapshot get — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.snapshot.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/snapshot/list":{"get":{"tags":["db"],"operationId":"db_snapshot_list","summary":"db snapshot list — managed database (Neon/Supabase/PlanetScale).","description":"db snapshot list — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.snapshot.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/db/snapshot/restore/{snapshot_id}":{"parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["db"],"operationId":"db_snapshot_restore","summary":"db snapshot restore — managed database (Neon/Supabase/PlanetScale).","description":"db snapshot restore — managed database (Neon/Supabase/PlanetScale).","x-infrai-capability":"db.snapshot.restore","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SnapshotRestoreRequest","description":"Request for db.snapshot.restore — restore a snapshot into a new project (path snapshot_id).","type":"object","required":["snapshot_id"],"additionalProperties":false,"properties":{"snapshot_id":{"type":"string","description":"Path param; the snapshot to restore."},"new_name":{"type":["string","null"],"description":"Name for the restored project (defaults to source-restored)."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/dns/domain/add":{"post":{"tags":["dns"],"operationId":"dns_domain_add","summary":"Bind a domain YOU already own: Infrai creates a managed DNS zone for it at the vendor (Cloudflare / Route53 / AliDNS) and returns zone_id + name servers — point your registrar's NS at them to activate. Not domain registration (you must already own the name).","description":"Bind a domain YOU already own: Infrai creates a managed DNS zone for it at the vendor (Cloudflare / Route53 / AliDNS) and returns zone_id + name servers — point your registrar's NS at them to activate. Not domain registration (you must already own the name).","x-infrai-capability":"dns.domain.add","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"DnsDomainAddRequest","description":"Request shape for dns.domain.add — bind a custom domain (create a managed zone). NOT domain registration.","type":"object","required":["domain"],"additionalProperties":false,"properties":{"domain":{"type":"string","description":"Apex domain, e.g. example.com."},"vendor":{"type":["string","null"],"enum":["cloudflare","route53","aliyun_dns",null],"description":"Pin to a DNS vendor (explicit)."},"account_id":{"type":["string","null"],"description":"Vendor account id / caller-reference."},"metadata":{"type":["object","null"],"description":"Arbitrary key-value metadata attached to this resource"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/dns/domain/delete":{"delete":{"tags":["dns"],"operationId":"dns_domain_delete","summary":"Delete a bound domain's managed zone at the vendor (requires zone_id).","description":"Delete a bound domain's managed zone at the vendor (requires zone_id).","x-infrai-capability":"dns.domain.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/dns/domain/get":{"get":{"tags":["dns"],"operationId":"dns_domain_get","summary":"Fetch a bound domain (zone) by zone_id or name, returning its state and name servers.","description":"Fetch a bound domain (zone) by zone_id or name, returning its state and name servers.","x-infrai-capability":"dns.domain.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/dns/domain/list":{"get":{"tags":["dns"],"operationId":"dns_domain_list","summary":"List the domains YOU have bound (managed zones) at the DNS vendor. Empty until you bind one via dns.domain.add — a new account manages no domains yet (an empty list is expected, not an error).","description":"List the domains YOU have bound (managed zones) at the DNS vendor. Empty until you bind one via dns.domain.add — a new account manages no domains yet (an empty list is expected, not an error).","x-infrai-capability":"dns.domain.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/dns/domain/verify":{"post":{"tags":["dns"],"operationId":"dns_domain_verify","summary":"Verify a bound domain's activation/delegation against the same vendor zone it was created on (sticky_resource); read-only lookup of zone state.","description":"Verify a bound domain's activation/delegation against the same vendor zone it was created on (sticky_resource); read-only lookup of zone state.","x-infrai-capability":"dns.domain.verify","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"DnsDomainRef","description":"Reference shape for dns.domain.verify / .get / .delete — identify a bound domain by zone_id and/or domain name. verify is sticky_resource (must hit the same vendor/zone).","type":"object","required":["domain"],"additionalProperties":false,"properties":{"domain":{"type":"string","description":"Domain name"},"zone_id":{"type":["string","null"],"description":"Vendor zone id (preferred for get/verify/delete)."},"vendor":{"type":["string","null"],"enum":["cloudflare","route53","aliyun_dns",null],"description":"Vendor that handled or will handle this request"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/dns/record/create":{"post":{"tags":["dns"],"operationId":"dns_record_create","summary":"Create a DNS record (A/AAAA/CNAME/TXT/MX) in a bound zone with TTL and optional MX priority / Cloudflare proxying.","description":"Create a DNS record (A/AAAA/CNAME/TXT/MX) in a bound zone with TTL and optional MX priority / Cloudflare proxying.","x-infrai-capability":"dns.record.create","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"DnsRecordCreateRequest","description":"Request shape for dns.record.create / .update — a DNS record within a bound zone.","type":"object","required":["zone_id","record_type","name","content"],"additionalProperties":false,"properties":{"zone_id":{"type":"string","description":"DNS zone identifier"},"record_type":{"type":"string","enum":["A","AAAA","CNAME","TXT","MX"],"description":"DNS record type (e.g. A, AAAA, CNAME, MX, TXT)"},"name":{"type":"string","description":"Record name, e.g. www or www.example.com."},"content":{"type":"string","description":"IP / target / text value."},"ttl":{"type":"integer","default":300,"minimum":1,"description":"Time-to-live in seconds for this DNS record"},"priority":{"type":["integer","null"],"description":"MX preference (MX only)."},"proxied":{"type":["boolean","null"],"description":"Cloudflare orange-cloud (A/AAAA/CNAME only)."},"record_id":{"type":["string","null"],"description":"Required for dns.record.update."},"metadata":{"type":["object","null"],"description":"Arbitrary key-value metadata attached to this resource"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/dns/record/delete":{"delete":{"tags":["dns"],"operationId":"dns_record_delete","summary":"Delete a DNS record from a bound zone (requires record_id).","description":"Delete a DNS record from a bound zone (requires record_id).","x-infrai-capability":"dns.record.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/dns/record/list":{"get":{"tags":["dns"],"operationId":"dns_record_list","summary":"List DNS records in a bound zone.","description":"List DNS records in a bound zone.","x-infrai-capability":"dns.record.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/dns/record/update":{"patch":{"tags":["dns"],"operationId":"dns_record_update","summary":"Update an existing DNS record (by record_id; Route53 uses UPSERT).","description":"Update an existing DNS record (by record_id; Route53 uses UPSERT).","x-infrai-capability":"dns.record.update","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"DnsRecordCreateRequest","description":"Request shape for dns.record.create / .update — a DNS record within a bound zone.","type":"object","required":["zone_id","record_type","name","content"],"additionalProperties":false,"properties":{"zone_id":{"type":"string","description":"DNS zone identifier"},"record_type":{"type":"string","enum":["A","AAAA","CNAME","TXT","MX"],"description":"DNS record type (e.g. A, AAAA, CNAME, MX, TXT)"},"name":{"type":"string","description":"Record name, e.g. www or www.example.com."},"content":{"type":"string","description":"IP / target / text value."},"ttl":{"type":"integer","default":300,"minimum":1,"description":"Time-to-live in seconds for this DNS record"},"priority":{"type":["integer","null"],"description":"MX preference (MX only)."},"proxied":{"type":["boolean","null"],"description":"Cloudflare orange-cloud (A/AAAA/CNAME only)."},"record_id":{"type":["string","null"],"description":"Required for dns.record.update."},"metadata":{"type":["object","null"],"description":"Arbitrary key-value metadata attached to this resource"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/dns/record/upsert":{"put":{"tags":["dns"],"operationId":"dns_record_upsert","summary":"Idempotently ensure a DNS record exists with a given value — create it if absent, update it in place if a single record of the same type+name exists, no-op if already identical. The declarative, no-list-first primitive for automation: ACME / Let's Encrypt DNS-01 challenge TXT records, pointing www/CNAME at a deploy, SPF/DKIM/DMARC setup, and infrastructure-as-code reconcile. Matched by (type, name); if several records share that type+name (e.g. round-robin A or multiple concurrent _acme-challenge TXT) it is ambiguous — use record.create to append or record.update with an explicit record_id.","description":"Idempotently ensure a DNS record exists with a given value — create it if absent, update it in place if a single record of the same type+name exists, no-op if already identical. The declarative, no-list-first primitive for automation: ACME / Let's Encrypt DNS-01 challenge TXT records, pointing www/CNAME at a deploy, SPF/DKIM/DMARC setup, and infrastructure-as-code reconcile. Matched by (type, name); if several records share that type+name (e.g. round-robin A or multiple concurrent _acme-challenge TXT) it is ambiguous — use record.create to append or record.update with an explicit record_id.","x-infrai-capability":"dns.record.upsert","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"DnsRecordCreateRequest","description":"Request shape for dns.record.create / .update — a DNS record within a bound zone.","type":"object","required":["zone_id","record_type","name","content"],"additionalProperties":false,"properties":{"zone_id":{"type":"string","description":"DNS zone identifier"},"record_type":{"type":"string","enum":["A","AAAA","CNAME","TXT","MX"],"description":"DNS record type (e.g. A, AAAA, CNAME, MX, TXT)"},"name":{"type":"string","description":"Record name, e.g. www or www.example.com."},"content":{"type":"string","description":"IP / target / text value."},"ttl":{"type":"integer","default":300,"minimum":1,"description":"Time-to-live in seconds for this DNS record"},"priority":{"type":["integer","null"],"description":"MX preference (MX only)."},"proxied":{"type":["boolean","null"],"description":"Cloudflare orange-cloud (A/AAAA/CNAME only)."},"record_id":{"type":["string","null"],"description":"Required for dns.record.update."},"metadata":{"type":["object","null"],"description":"Arbitrary key-value metadata attached to this resource"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/batch/send":{"post":{"tags":["email"],"operationId":"email_batch_send","summary":"Send up to 100 personalized emails under one idempotency_key (batch passthrough, not billed per message).","description":"Send up to 100 personalized emails under one idempotency_key (batch passthrough, not billed per message).","x-infrai-capability":"email.batch.send","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"BatchSendRequest","description":"Batch personalised send for email.batch.send (POST /v1/email/batch). Up to 100 distinct messages share ONE idempotency_key (batch passthrough — per-message is not re-charged). See docs/Infrai_SDK_Comm.md §2.3.","type":"object","required":["messages"],"additionalProperties":false,"properties":{"messages":{"type":"array","minItems":1,"maxItems":100,"items":{"title":"EmailSendRequest","type":"object","required":["to"],"additionalProperties":false,"properties":{"to":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Recipient address, or an array of addresses for multiple recipients."},"cc":{"type":"array","items":{"type":"string"},"description":"Carbon copy recipients"},"bcc":{"type":"array","items":{"type":"string"},"description":"Blind carbon copy recipients"},"from":{"type":["string","null"],"description":"Optional. Omit to use Infrai's default sender on send.infrai.cc. If you provide a custom-domain sender, that domain must be verified first."},"from_display_name":{"type":["string","null"],"description":"Display name for the sender"},"reply_to":{"type":["string","null"],"description":"Reply-to email address"},"subject":{"type":["string","null"],"description":"Email subject line"},"body":{"type":["string","null"],"description":"Plain text body."},"html":{"type":["string","null"],"description":"HTML body of the email"},"template_id":{"type":["string","null"],"description":"Identifier of the template used for rendering"},"template_vars":{"type":["object","null"],"description":"Variables to substitute in the template"},"attachments":{"type":"array","items":{"type":"object"},"description":"List of email attachments"},"headers":{"type":["object","null"],"description":"Custom HTTP headers to include in requests or responses"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for categorization and filtering"},"track_opens":{"type":"boolean","default":false,"description":"Whether to track email opens"},"track_clicks":{"type":"boolean","default":false,"description":"Whether to track link clicks in the email"},"scheduled_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp when the resource is scheduled to activate"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"vendor":{"type":["string","null"],"description":"Pin to a specific vendor."},"message_class":{"enum":["transactional","marketing"],"default":"transactional","description":"Semantic class of the message. Only transactional is currently live; marketing is reserved and fails closed."},"auto_unsubscribe_link":{"type":["boolean","null"],"description":"Whether to append a signed unsubscribe link. Transactional messages omit it by default; marketing-like content may still be forced to include it."}}},"description":"Each entry is a full EmailSendRequest with its own recipients / template_vars."},"idempotency_key":{"type":["string","null"],"description":"One key for the whole batch; per-message sends are not re-charged."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/domain/delete/{domain}":{"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["email"],"operationId":"email_domain_delete","summary":"Delete a previously added sender domain.","description":"Delete a previously added sender domain.","x-infrai-capability":"email.domain.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/domain/get/{domain}":{"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["email"],"operationId":"email_domain_get","summary":"Get the verification status and reputation of a sender domain.","description":"Get the verification status and reputation of a sender domain.","x-infrai-capability":"email.domain.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/domain/list":{"get":{"tags":["email"],"operationId":"email_domain_list","summary":"List the sender domains added to the account.","description":"List the sender domains added to the account.","x-infrai-capability":"email.domain.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/domain/rotate_dkim/{domain}":{"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["email"],"operationId":"email_domain_rotate_dkim","summary":"Rotate DKIM for a sender domain and return the new DNS records.","description":"Rotate DKIM for a sender domain and return the new DNS records.","x-infrai-capability":"email.domain.rotate_dkim","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"DomainRotateDkimRequest","description":"Rotate a domain's DKIM keypair for email.domain.rotate_dkim (POST /v1/email/domains/{domain}/rotate-dkim). Returns DomainVerification with new DKIM dns_records + updated expires_at. See docs/Infrai_SDK_Comm.md §3.1.","type":"object","additionalProperties":false,"properties":{"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/domain/verify":{"post":{"tags":["email"],"operationId":"email_domain_verify","summary":"Verify a sender domain's DNS records to complete verification.","description":"Verify a sender domain's DNS records to complete verification.","x-infrai-capability":"email.domain.verify","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"DomainVerifyRequest","description":"Request shape for email.domain.verify — trigger the vendor's DNS/domain verification for a sending domain. Returns domain + status + dns_records.","type":"object","required":["domain"],"additionalProperties":false,"properties":{"domain":{"type":"string","description":"Sending domain to verify (e.g. mail.example.com)."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/event/list":{"get":{"tags":["email"],"operationId":"email_event_list","summary":"List email delivery events (delivered, bounced, opened, clicked, complained).","description":"List email delivery events (delivered, bounced, opened, clicked, complained).","x-infrai-capability":"email.event.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/get/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["email"],"operationId":"email_get","summary":"Get the delivery details of one email by message_id.","description":"Get the delivery details of one email by message_id.","x-infrai-capability":"email.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/send":{"post":{"tags":["email"],"operationId":"email_send","summary":"Send a transactional email (inline body/HTML or a template) with tracking; idempotent.","description":"Send a transactional email (inline body/HTML or a template) with tracking; idempotent.","x-infrai-capability":"email.send","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"EmailSendRequest","type":"object","required":["to"],"additionalProperties":false,"properties":{"to":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Recipient address, or an array of addresses for multiple recipients."},"cc":{"type":"array","items":{"type":"string"},"description":"Carbon copy recipients"},"bcc":{"type":"array","items":{"type":"string"},"description":"Blind carbon copy recipients"},"from":{"type":["string","null"],"description":"Optional. Omit to use Infrai's default sender on send.infrai.cc. If you provide a custom-domain sender, that domain must be verified first."},"from_display_name":{"type":["string","null"],"description":"Display name for the sender"},"reply_to":{"type":["string","null"],"description":"Reply-to email address"},"subject":{"type":["string","null"],"description":"Email subject line"},"body":{"type":["string","null"],"description":"Plain text body."},"html":{"type":["string","null"],"description":"HTML body of the email"},"template_id":{"type":["string","null"],"description":"Identifier of the template used for rendering"},"template_vars":{"type":["object","null"],"description":"Variables to substitute in the template"},"attachments":{"type":"array","items":{"type":"object"},"description":"List of email attachments"},"headers":{"type":["object","null"],"description":"Custom HTTP headers to include in requests or responses"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for categorization and filtering"},"track_opens":{"type":"boolean","default":false,"description":"Whether to track email opens"},"track_clicks":{"type":"boolean","default":false,"description":"Whether to track link clicks in the email"},"scheduled_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp when the resource is scheduled to activate"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"vendor":{"type":["string","null"],"description":"Pin to a specific vendor."},"message_class":{"enum":["transactional","marketing"],"default":"transactional","description":"Semantic class of the message. Only transactional is currently live; marketing is reserved and fails closed."},"auto_unsubscribe_link":{"type":["boolean","null"],"description":"Whether to append a signed unsubscribe link. Transactional messages omit it by default; marketing-like content may still be forced to include it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/suppression/add":{"post":{"tags":["email"],"operationId":"email_suppression_add","summary":"Add a recipient address to the suppression list to stop future delivery; idempotent.","description":"Add a recipient address to the suppression list to stop future delivery; idempotent.","x-infrai-capability":"email.suppression.add","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SuppressRequest","description":"Add a recipient to the suppression list for email.suppression.add (POST /v1/email/suppress). SDK alias: email.suppression.add (same route). Returns the back-filled SuppressionRecord. See docs/Infrai_SDK_Comm.md §6 and enums/suppression_reason.yaml.","type":"object","required":["email"],"additionalProperties":false,"properties":{"email":{"type":"string","format":"email","description":"Email address"},"reason":{"enum":["hard_bounce","soft_bounce_5x","complained","unsubscribed","invalid","manual","user_request"],"default":"manual","description":"Reason for the current state or action"},"scope":{"enum":["account","domain"],"default":"account","description":"Scope of applicability for this resource"},"domain_scope":{"type":["string","null"],"description":"When scope=domain, the specific verified domain."},"notes":{"type":["string","null"],"description":"Free-text notes about this suppression"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/suppression/check/{email}":{"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["email"],"operationId":"email_suppression_check","summary":"Check whether an address is on the suppression list.","description":"Check whether an address is on the suppression list.","x-infrai-capability":"email.suppression.check","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/suppression/delete/{email}":{"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["email"],"operationId":"email_suppression_delete","summary":"Remove an address from the suppression list to resume delivery.","description":"Remove an address from the suppression list to resume delivery.","x-infrai-capability":"email.suppression.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/suppression/list":{"get":{"tags":["email"],"operationId":"email_suppression_list","summary":"List recipient addresses on the suppression list.","description":"List recipient addresses on the suppression list.","x-infrai-capability":"email.suppression.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/template/create":{"post":{"tags":["email"],"operationId":"email_template_create","summary":"Create an email template.","description":"Create an email template.","x-infrai-capability":"email.template.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"TemplateCreateRequest","description":"Create a stored email template for email.template.create (POST /v1/email/templates). Returns Template. See docs/Infrai_SDK_Comm.md §4.1.","type":"object","required":["name","subject","html"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128,"description":"Unique within account."},"subject":{"type":"string","description":"May contain double-brace var placeholders."},"html":{"type":"string","description":"HTML body; may contain double-brace var, double-brace #section, double-brace ^inverted."},"body_text":{"type":["string","null"],"description":"Plain-text alternative."},"variables":{"type":["object","null"],"description":"Declared variables: { name: 'string' | 'int' | 'bool' | 'array' | 'object' }."},"default_vars":{"type":["object","null"],"description":"Defaults used when var missing in send()."},"tags":{"type":["array","null"],"items":{"type":"string"},"description":"Tags for categorization and filtering"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/template/delete/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["email"],"operationId":"email_template_delete","summary":"Delete an email template.","description":"Delete an email template.","x-infrai-capability":"email.template.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/template/preview/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["email"],"operationId":"email_template_preview","summary":"Render and preview a template with the given variables.","description":"Render and preview a template with the given variables.","x-infrai-capability":"email.template.preview","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"TemplatePreviewRequest","description":"Render a stored template with sample vars for email.template.preview (POST /v1/email/templates/{id}/preview). Returns TemplatePreview. See docs/Infrai_SDK_Comm.md §4.2.","type":"object","required":["vars"],"additionalProperties":false,"properties":{"vars":{"type":"object","description":"Variable values merged with the template's default_vars before rendering."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/email/template/update/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"tags":["email"],"operationId":"email_template_update","summary":"Update an existing email template.","description":"Update an existing email template.","x-infrai-capability":"email.template.update","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"TemplateUpdateRequest","description":"Patch a stored email template for email.template.update (PATCH /v1/email/templates/{id}). Returns Template. See docs/Infrai_SDK_Comm.md §4.1.","type":"object","additionalProperties":false,"properties":{"subject":{"type":["string","null"],"description":"May contain double-brace var placeholders."},"html":{"type":["string","null"],"description":"HTML body; may contain double-brace var, double-brace #section, double-brace ^inverted."},"body_text":{"type":["string","null"],"description":"Plain-text alternative."},"variables":{"type":["object","null"],"description":"Template variable definitions"},"default_vars":{"type":["object","null"],"description":"Default variable values for the template"},"tags":{"type":["array","null"],"items":{"type":"string"},"description":"Tags for categorization and filtering"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/embeddings":{"post":{"tags":["ai (openai-compatible)"],"operationId":"embeddings","summary":"Create embeddings for text (OpenAI-compatible).","description":"Create embeddings for text (OpenAI-compatible). OpenAI-compatible: point the official OpenAI SDK/client at base_url https://api.infrai.cc/v1 with your infrai key as the Bearer token. See https://platform.openai.com/docs/api-reference for the full request/response contract; infrai adds smart routing (model=\"auto\") and returns an extra `infrai` metadata block (cost_usd / vendor / latency / cache_hit) on every response.","x-infrai-openai-compatible":true,"x-infrai-capability":"ai.embed","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"model":{"type":"string","description":"Model to use. \"auto\" (default) = infrai smart routing picks the best/cheapest healthy vendor; or pin a specific model as \"vendor/model\" (e.g. \"openai/gpt-4o-mini\", \"dashscope/qwen-plus\").","examples":["auto","openai/gpt-4o-mini"]},"input":{"description":"Text string or array of strings to embed.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"encoding_format":{"type":"string","enum":["float","base64"]},"dimensions":{"type":"integer"}},"additionalProperties":true}}}},"responses":{"200":{"description":"OpenAI-compatible JSON response with infrai metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIEmbeddingList"}}}},"400":{"description":"Bad request — INVALID_ARGUMENT and other client-input errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"401":{"description":"Unauthorized — missing/invalid/revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"402":{"description":"Payment required — INSUFFICIENT_CREDIT / wallet errors (carries checkout_url).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"409":{"description":"Conflict — idempotency-key conflict or resource-state conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"429":{"description":"Too many requests — rate limited (carries retry backoff).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"503":{"description":"Service unavailable — maintenance / no healthy vendor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"default":{"description":"OpenAI-compatible error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}}}}},"/errors/capture":{"post":{"tags":["errors"],"operationId":"errors_capture","summary":"Capture an error event, aggregated into a group by fingerprint.","description":"Capture an error event, aggregated into a group by fingerprint.","x-infrai-capability":"errors.capture","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ErrorCaptureRequest","description":"Request shape for errors.capture — ingest an error/exception event. Returns the event_id. The title falls back to message or exception.value when absent.","type":"object","additionalProperties":false,"properties":{"title":{"type":["string","null"],"description":"Short error title; falls back to message or exception.value."},"message":{"type":["string","null"],"description":"Detailed message content"},"exception":{"type":["object","null"],"description":"Structured exception, e.g. {type, value, stacktrace}."},"level":{"type":"string","default":"error","description":"Severity level (e.g. error, warning, info)."},"tags":{"type":["object","null"],"description":"Tags for categorization and filtering"},"user_id":{"type":["string","null"],"description":"User identifier associated with this resource"},"fingerprint":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Grouping fingerprint."},"breadcrumbs":{"type":["array","null"],"items":{"type":"object"},"description":"List of breadcrumb events leading up to the error"},"context":{"type":["object","null"],"description":"Additional context data for the error"},"extra":{"type":["object","null"],"description":"Extra metadata attached to the error event"},"environment":{"type":["string","null"],"description":"Deployment environment (e.g. production, staging)"},"release":{"type":["string","null"],"description":"Software release version"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/errors/events/{error_group_id}":{"parameters":[{"name":"error_group_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["errors"],"operationId":"errors_events","summary":"Page through all events within an error group.","description":"Page through all events within an error group.","x-infrai-capability":"errors.events","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/errors/get/{event_id}":{"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["errors"],"operationId":"errors_get","summary":"Get the details of one error event by event ID.","description":"Get the details of one error event by event ID.","x-infrai-capability":"errors.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/errors/group_detail/{error_group_id}":{"parameters":[{"name":"error_group_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["errors"],"operationId":"errors_group_detail","summary":"Get the aggregated details of a specified error group.","description":"Get the aggregated details of a specified error group.","x-infrai-capability":"errors.group_detail","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/errors/groups":{"get":{"tags":["errors"],"operationId":"errors_groups","summary":"Page through error groups, with status filtering and sorting.","description":"Page through error groups, with status filtering and sorting.","x-infrai-capability":"errors.groups","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/errors/list":{"get":{"tags":["errors"],"operationId":"errors_list","summary":"Page through captured error events, with filtering.","description":"Page through captured error events, with filtering.","x-infrai-capability":"errors.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/errors/message":{"post":{"tags":["errors"],"operationId":"errors_message","summary":"Capture a structured error/log message (level, tags, user, release, environment).","description":"Capture a structured error/log message (level, tags, user, release, environment).","x-infrai-capability":"errors.message","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ErrorMessageRequest","description":"Request shape for errors.message — capture a plain-text message event (twin of error.capture, no exception). Returns CaptureResult.","type":"object","required":["text"],"additionalProperties":false,"properties":{"text":{"type":"string","minLength":1,"description":"Message body; becomes the event title."},"level":{"type":"string","enum":["debug","info","warning","error","fatal"],"default":"info","description":"Severity or log level (e.g. info, warn, error)"},"tags":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Tags for categorization and filtering"},"user_id":{"type":["string","null"],"description":"User identifier associated with this resource"},"release":{"type":["string","null"],"description":"Software release version"},"environment":{"type":["string","null"],"enum":["production","staging","development",null],"description":"Deployment environment (e.g. production, staging)"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/errors/resolve/{error_group_id}":{"parameters":[{"name":"error_group_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["errors"],"operationId":"errors_resolve","summary":"Mark an error group as resolved.","description":"Mark an error group as resolved.","x-infrai-capability":"errors.resolve","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ErrorGroupActionRequest","description":"Request shape for errors.resolve / .unresolve / .ignore — PATCH a single error group to a fixed target triage state (naturally idempotent). Returns ErrorGroupDetail.","type":"object","required":["error_group_id"],"additionalProperties":false,"properties":{"error_group_id":{"type":"string","pattern":"^errgrp_[A-Za-z0-9]{20,}$","description":"Identifier of the error group this event belongs to"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/errors/search":{"get":{"tags":["errors"],"operationId":"errors_search","summary":"Full-text search error events by keyword.","description":"Full-text search error events by keyword.","x-infrai-capability":"errors.search","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/flags/delete/{key}":{"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["flags"],"operationId":"flags_delete","summary":"Delete a feature flag permanently.","description":"Delete a feature flag permanently.","x-infrai-capability":"flags.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/flags/get_all":{"get":{"tags":["flags"],"operationId":"flags_get_all","summary":"Evaluate all feature flags at once for a given evaluation context.","description":"Evaluate all feature flags at once for a given evaluation context.","x-infrai-capability":"flags.get_all","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/flags/get_value/{key}":{"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["flags"],"operationId":"flags_get_value","summary":"Evaluate a single feature flag's value for a given evaluation context.","description":"Evaluate a single feature flag's value for a given evaluation context.","x-infrai-capability":"flags.get_value","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/flags/get/{key}":{"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["flags"],"operationId":"flags_get","summary":"Retrieve the full definition of a feature flag.","description":"Retrieve the full definition of a feature flag.","x-infrai-capability":"flags.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/flags/is_enabled/{key}":{"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["flags"],"operationId":"flags_is_enabled","summary":"Check whether a feature flag is enabled for the current evaluation context.","description":"Check whether a feature flag is enabled for the current evaluation context.","x-infrai-capability":"flags.is_enabled","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/flags/list":{"get":{"tags":["flags"],"operationId":"flags_list","summary":"List feature flags with pagination, optionally including archived ones.","description":"List feature flags with pagination, optionally including archived ones.","x-infrai-capability":"flags.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/flags/rollout/{key}":{"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["flags"],"operationId":"flags_rollout","summary":"Configure a percentage-based gradual rollout for a feature flag.","description":"Configure a percentage-based gradual rollout for a feature flag.","x-infrai-capability":"flags.rollout","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"FlagRolloutRequest","description":"Request shape for flags.rollout — configure percentage / sticky-bucket / multi-variant rollout under optimistic lock. Returns the full Flag. Flat signature mirrors RolloutConfig.","type":"object","required":["key","percentage","salt","sticky_unit","version"],"additionalProperties":false,"properties":{"key":{"type":"string","pattern":"^[a-z0-9_.-]{1,128}$","description":"Unique identifier key for this resource"},"percentage":{"type":"integer","minimum":0,"maximum":100,"description":"Rollout percentage (0-100)"},"salt":{"type":"string","description":"Consistent-hash salt; rotate to reshuffle bucket assignments."},"sticky_unit":{"type":"string","enum":["user_id","session_id","device_id"],"default":"user_id","description":"Sticky unit for consistent rollout assignment"},"variants":{"type":["array","null"],"items":{"title":"Variant","description":"One variant inside a multi-variant rollout (A/B/C test). See docs/Infrai_SDK_Observability.md §1.2.","type":"object","required":["value","weight"],"additionalProperties":false,"properties":{"value":{"description":"Variant value; type must match flag.type."},"weight":{"type":"integer","minimum":0,"maximum":100,"description":"0..100; sum of weights must be <= rollout.percentage."}}},"description":"Variant definitions for the flag"},"version":{"type":"integer","minimum":1,"description":"Current version; mismatch triggers FLAG_VERSION_CONFLICT."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/flags/set":{"post":{"tags":["flags"],"operationId":"flags_set","summary":"Create or update a feature-flag definition.","description":"Create or update a feature-flag definition.","x-infrai-capability":"flags.set","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"FlagSetRequest","description":"Request shape for flags.set (POST /v1/flags, upsert). SDK ergonomic surface = flag.create(key, description, ...) and flag.update(key, **patch, version) both map here. Create omits version (server assigns version=1). Update MUST carry the current version (integer>=1) for optimistic locking (FLAG_VERSION_CONFLICT). Returns the full Flag.","type":"object","required":["key"],"additionalProperties":false,"properties":{"key":{"type":"string","pattern":"^[a-z0-9_.-]{1,128}$","description":"Unique identifier key for this resource"},"description":{"type":["string","null"],"minLength":5,"maxLength":500,"description":"Required on create (FLAG_DESCRIPTION_TOO_SHORT if <5 chars)."},"type":{"type":["string","null"],"enum":["bool","string","number","json",null],"description":"Flag value type (enums/flag_type.yaml). Defaults to bool on create."},"default_value":{"description":"Value returned when no rule matches; type must match `type` (FLAG_TYPE_MISMATCH)."},"rules":{"type":["array","null"],"items":{"title":"FlagRule","description":"Conditional rule on a feature flag. if_ is a recursive predicate using enums/flag_operator.yaml; then is the value returned when matched.","type":"object","required":["if","then"],"additionalProperties":false,"properties":{"if":{"description":"Predicate object. Top-level keys are context field paths (e.g. 'user_id', 'context.country') OR boolean composition keys ($and / $or / $not). Leaf values are operator objects { eq: ..., in: [...], gte: ..., matches: '...', percentage: N, cohort: 'cohort_id', ... }.","type":"object"},"then":{"description":"Value returned when the predicate matches. Type must match flag.type."},"description":{"type":["string","null"],"description":"Human-readable explanation."}}},"description":"Targeting rules for the flag"},"rollout":{"oneOf":[{"title":"RolloutConfig","description":"Percentage / sticky-bucket rollout config attached to a feature flag. See docs/Infrai_SDK_Observability.md §1.2.","type":"object","required":["percentage","salt","sticky_unit"],"additionalProperties":false,"properties":{"percentage":{"type":"integer","minimum":0,"maximum":100,"description":"Rollout percentage (0-100)"},"salt":{"type":"string","description":"Consistent-hash salt; rotate to reshuffle bucket assignments."},"variants":{"type":["array","null"],"items":{"title":"Variant","description":"One variant inside a multi-variant rollout (A/B/C test). See docs/Infrai_SDK_Observability.md §1.2.","type":"object","required":["value","weight"],"additionalProperties":false,"properties":{"value":{"description":"Variant value; type must match flag.type."},"weight":{"type":"integer","minimum":0,"maximum":100,"description":"0..100; sum of weights must be <= rollout.percentage."}}},"description":"Variant definitions for the flag"},"sticky_unit":{"enum":["user_id","session_id","device_id"],"default":"user_id","description":"Sticky unit for consistent rollout assignment"}}},{"type":"null"}],"description":"Rollout configuration for gradual delivery"},"tags":{"type":["object","null"],"description":"Tags for categorization and filtering"},"enabled":{"type":["boolean","null"],"default":true,"description":"Whether this feature or configuration is enabled"},"version":{"type":["integer","null"],"minimum":1,"description":"Required for update (optimistic lock). Omit for create."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/flags/toggle/{key}":{"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["flags"],"operationId":"flags_toggle","summary":"Enable or disable a feature flag with optimistic version checking.","description":"Enable or disable a feature flag with optimistic version checking.","x-infrai-capability":"flags.toggle","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"FlagToggleRequest","description":"Request shape for flags.toggle — flip a flag's enabled state under optimistic lock. Returns the full Flag.","type":"object","required":["key","enabled","version"],"additionalProperties":false,"properties":{"key":{"type":"string","pattern":"^[a-z0-9_.-]{1,128}$","description":"Unique identifier key for this resource"},"enabled":{"type":"boolean","description":"Whether this feature or configuration is enabled"},"version":{"type":"integer","minimum":1,"description":"Current version; mismatch triggers FLAG_VERSION_CONFLICT."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/background_remove":{"post":{"tags":["image"],"operationId":"image_background_remove","summary":"Transform an EXISTING image by AI-removing its background. To GENERATE images with AI use ai.image.","description":"Transform an EXISTING image by AI-removing its background. To GENERATE images with AI use ai.image.","x-infrai-capability":"image.background_remove","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageBackgroundRemoveRequest","description":"Request shape for image.background_remove — AI cutout (libvips_ai / cloudinary). Returns ProcessedImage. See REVIEW Image Processing §3.A.","type":"object","required":["image"],"additionalProperties":false,"properties":{"image":{"description":"Image data or reference for processing","title":"ImageRef","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]},"format":{"description":"Output or input format (e.g. json, csv, png)","type":"string","enum":["auto","webp","avif","jpeg","png","heic"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/batch/cancel/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["image"],"operationId":"image_batch_cancel","summary":"Cancel a batch image-processing job by job ID; idempotent write.","description":"Cancel a batch image-processing job by job ID; idempotent write.","x-infrai-capability":"image.batch.cancel","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageBatchCancelRequest","description":"Request shape for image.batch.cancel — cancel an image batch job. Returns cancelled + job_id.","type":"object","required":["job_id"],"additionalProperties":false,"properties":{"job_id":{"type":"string","description":"Id of the image batch job to cancel."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/batch/status/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["image"],"operationId":"image_batch_status","summary":"Get the progress and results of a batch image-processing job by job ID.","description":"Get the progress and results of a batch image-processing job by job ID.","x-infrai-capability":"image.batch.status","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/batch/submit":{"post":{"tags":["image"],"operationId":"image_batch_submit","summary":"Submit a batch image-processing job and get a job handle, with optional webhook callback.","description":"Submit a batch image-processing job and get a job handle, with optional webhook callback.","x-infrai-capability":"image.batch.submit","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageBatchSubmitRequest","description":"Request shape for image.batch.submit — submit many image pipelines asynchronously. Write-idempotent. Pattern mirrors video.generate -> status -> cancel. Returns ImageBatchSubmitResult. See REVIEW Image Processing §3.D.","type":"object","required":["items"],"additionalProperties":false,"properties":{"items":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["image","ops"],"properties":{"image":{"title":"ImageRef","description":"Source-image reference shared by all single-op image transforms: inline bytes (url/base64) or a stable asset id (image_id). Mirrors ImageProcessRequest.image. See REVIEW Image Processing §3.A/B.","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]},"ops":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["op"],"properties":{"op":{"type":"string","enum":["resize","compress","crop","rotate","watermark","background_remove","smart_crop","format_convert","grayscale","blur","flip_h","flip_v"],"description":"Operation type for infra.image_process pipeline steps."},"params":{"type":["object","null"]}}}}}},"description":"Array of result items in this page"},"webhook_url":{"type":["string","null"],"format":"uri","description":"Optional completion callback; Infrai signs deliveries."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced asset/record in Infrai's own store (default false = stateless passthrough: process, return inline, keep nothing). When true, Infrai persists the asset, bills a self-hosted storage line item and applies a retention TTL — and only then do the *.list/get/delete read caps see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/compress":{"post":{"tags":["image"],"operationId":"image_compress","summary":"Transform an EXISTING image by compressing it to a target quality or byte size, optionally re-encoding. To GENERATE images with AI use ai.image.","description":"Transform an EXISTING image by compressing it to a target quality or byte size, optionally re-encoding. To GENERATE images with AI use ai.image.","x-infrai-capability":"image.compress","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageCompressRequest","description":"Request shape for image.compress — compress by quality or target byte budget (binary search). Returns ProcessedImage. See REVIEW Image Processing §3.A.","type":"object","required":["image"],"additionalProperties":false,"properties":{"image":{"description":"Image data or reference for processing","title":"ImageRef","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]},"quality":{"type":["integer","null"],"minimum":1,"maximum":100,"description":"Encoder quality 1-100; mutually informative with target_bytes."},"target_bytes":{"type":["integer","null"],"minimum":1,"description":"Compress to <= this byte budget via quality binary search."},"format":{"description":"Output or input format (e.g. json, csv, png)","type":"string","enum":["auto","webp","avif","jpeg","png","heic"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced asset/record in Infrai's own store (default false = stateless passthrough: process, return inline, keep nothing). When true, Infrai persists the asset, bills a self-hosted storage line item and applies a retention TTL — and only then do the *.list/get/delete read caps see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/convert":{"post":{"tags":["image"],"operationId":"image_convert","summary":"Transform an EXISTING image by re-encoding it to another format (jpeg/png/webp/avif). To GENERATE images with AI use ai.image.","description":"Transform an EXISTING image by re-encoding it to another format (jpeg/png/webp/avif). To GENERATE images with AI use ai.image.","x-infrai-capability":"image.convert","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageConvertRequest","description":"Request shape for image.convert — re-encode into a different format. Returns ProcessedImage. See REVIEW Image Processing §3.A.","type":"object","required":["image","format"],"additionalProperties":false,"properties":{"image":{"description":"Image data or reference for processing","title":"ImageRef","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]},"format":{"description":"Output or input format (e.g. json, csv, png)","type":"string","enum":["auto","webp","avif","jpeg","png","heic"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced asset/record in Infrai's own store (default false = stateless passthrough: process, return inline, keep nothing). When true, Infrai persists the asset, bills a self-hosted storage line item and applies a retention TTL — and only then do the *.list/get/delete read caps see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/crop":{"post":{"tags":["image"],"operationId":"image_crop","summary":"Transform an EXISTING image by cropping it to an x/y/w/h rectangle. To GENERATE images with AI use ai.image.","description":"Transform an EXISTING image by cropping it to an x/y/w/h rectangle. To GENERATE images with AI use ai.image.","x-infrai-capability":"image.crop","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageCropRequest","description":"Request shape for image.crop — crop to an xywh box. Returns ProcessedImage. See REVIEW Image Processing §3.A.","type":"object","required":["image","x","y","width","height"],"additionalProperties":false,"properties":{"image":{"description":"Image data or reference for processing","title":"ImageRef","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]},"x":{"type":"integer","minimum":0,"description":"X coordinate for crop origin"},"y":{"type":"integer","minimum":0,"description":"Y coordinate for crop origin"},"width":{"type":"integer","minimum":1,"description":"Width of the image in pixels"},"height":{"type":"integer","minimum":1,"description":"Height of the image in pixels"},"format":{"description":"Output or input format (e.g. json, csv, png)","type":"string","enum":["auto","webp","avif","jpeg","png","heic"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced asset/record in Infrai's own store (default false = stateless passthrough: process, return inline, keep nothing). When true, Infrai persists the asset, bills a self-hosted storage line item and applies a retention TTL — and only then do the *.list/get/delete read caps see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/delete/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["image"],"operationId":"image_delete","summary":"Delete a stored image asset by ID; idempotent write.","description":"Delete a stored image asset by ID; idempotent write.","x-infrai-capability":"image.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/get/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["image"],"operationId":"image_get","summary":"Get the metadata of one stored image asset (URL, MIME type, dimensions, byte size) by ID.","description":"Get the metadata of one stored image asset (URL, MIME type, dimensions, byte size) by ID.","x-infrai-capability":"image.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/metadata":{"post":{"tags":["image"],"operationId":"image_metadata","summary":"Inspect an EXISTING image's metadata (dimensions, format, EXIF) without modifying it; read-only.","description":"Inspect an EXISTING image's metadata (dimensions, format, EXIF) without modifying it; read-only.","x-infrai-capability":"image.metadata","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageMetadataRequest","description":"Request shape for image.metadata — read-only inspect. POST carries image bytes (GET impractical); route is idempotent:true as read-idempotency, not a write. Returns ImageMetadata. See REVIEW Image Processing §3.B.","type":"object","required":["image"],"additionalProperties":false,"properties":{"image":{"description":"Image data or reference for processing","title":"ImageRef","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/moderate":{"post":{"tags":["image"],"operationId":"image_moderate","summary":"Classify an image for unsafe content (adult/violence/etc.) returning a flagged verdict plus per-category flags/scores. Real vendor dispatch: Google Vision SafeSearch, Aliyun Green image scan. service_markup applies.","description":"Classify an image for unsafe content (adult/violence/etc.) returning a flagged verdict plus per-category flags/scores. Real vendor dispatch: Google Vision SafeSearch, Aliyun Green image scan. service_markup applies.","x-infrai-capability":"image.moderate","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageModerateRequest","description":"Request payload for image.moderate — classify an image for unsafe content.","type":"object","required":["image"],"additionalProperties":false,"properties":{"image":{"type":"string","description":"Image as data URI, URL, or base64."},"vendor":{"enum":["google","aliyun"],"description":"Optional vendor pin."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/ocr":{"post":{"tags":["image"],"operationId":"image_ocr","summary":"Extract text from an image (distinct from pdf.ocr) returning full text plus per-line blocks. Real vendor dispatch: Aliyun OCR, Baidu OCR, AWS Textract; self_hosted tesseract honestly degrades to a 503 when the binary is absent (no synthetic text).","description":"Extract text from an image (distinct from pdf.ocr) returning full text plus per-line blocks. Real vendor dispatch: Aliyun OCR, Baidu OCR, AWS Textract; self_hosted tesseract honestly degrades to a 503 when the binary is absent (no synthetic text).","x-infrai-capability":"image.ocr","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageOcrRequest","description":"Request payload for image.ocr — extract text from an image (distinct from pdf.ocr).","type":"object","required":["image"],"additionalProperties":false,"properties":{"image":{"type":"string","description":"Image as data URI, URL, or base64."},"language":{"type":"string","description":"Optional language hint (e.g. eng, chi_sim)."},"vendor":{"enum":["aliyun","baidu","aws","self_hosted"],"description":"Optional vendor pin."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/process":{"post":{"tags":["image"],"operationId":"image_process","summary":"Transform an EXISTING image through a chained pipeline of ops, re-encoded once at the end. To GENERATE images with AI use ai.image.","description":"Transform an EXISTING image through a chained pipeline of ops, re-encoded once at the end. To GENERATE images with AI use ai.image.","x-infrai-capability":"image.process","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageProcessRequest","description":"Multi-step pipeline request for image.process. Edge deserializes against THIS schema (reads `image` / `ops[].params`) — not flat top-level keys. ops[] are applied as a chain (in-memory object continued, re-encoded once at the end). See REVIEW Image Processing §3.B.","type":"object","required":["image","ops"],"additionalProperties":false,"properties":{"image":{"description":"The source image, as either inline bytes (url/base64) or a stable asset reference (image_id).","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]},"ops":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["op"],"properties":{"op":{"type":"string","enum":["resize","compress","crop","rotate","watermark","background_remove","smart_crop","format_convert","grayscale","blur","flip_h","flip_v"],"description":"Operation type for infra.image_process pipeline steps."},"params":{"type":["object","null"]}}},"description":"Ordered list of image operations to apply"},"format":{"description":"Output or input format (e.g. json, csv, png)","type":"string","enum":["auto","webp","avif","jpeg","png","heic"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced asset/record in Infrai's own store (default false = stateless passthrough: process, return inline, keep nothing). When true, Infrai persists the asset, bills a self-hosted storage line item and applies a retention TTL — and only then do the *.list/get/delete read caps see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/resize":{"post":{"tags":["image"],"operationId":"image_resize","summary":"Transform an EXISTING image by resizing it with a fit mode and optional upscaling/format. To GENERATE images with AI use ai.image.","description":"Transform an EXISTING image by resizing it with a fit mode and optional upscaling/format. To GENERATE images with AI use ai.image.","x-infrai-capability":"image.resize","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageResizeRequest","description":"Request shape for image.resize. thumbnail = fit=inside + enlarge=false. Returns ProcessedImage. See REVIEW Image Processing §3.A.","type":"object","required":["image"],"additionalProperties":false,"properties":{"image":{"description":"Image data or reference for processing","title":"ImageRef","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]},"width":{"type":["integer","null"],"minimum":1,"description":"Width of the image in pixels"},"height":{"type":["integer","null"],"minimum":1,"description":"Height of the image in pixels"},"fit":{"description":"Fit mode for resizing (cover, contain, fill, inside, outside)","type":"string","enum":["cover","contain","fill","inside","outside"]},"enlarge":{"type":"boolean","default":false,"description":"Allow upscaling beyond source dimensions; false (default) never upscales."},"format":{"description":"Output or input format (e.g. json, csv, png)","type":"string","enum":["auto","webp","avif","jpeg","png","heic"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced asset/record in Infrai's own store (default false = stateless passthrough: process, return inline, keep nothing). When true, Infrai persists the asset, bills a self-hosted storage line item and applies a retention TTL — and only then do the *.list/get/delete read caps see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/rotate":{"post":{"tags":["image"],"operationId":"image_rotate","summary":"Transform an EXISTING image by rotating it, optionally auto-correcting orientation from EXIF. To GENERATE images with AI use ai.image.","description":"Transform an EXISTING image by rotating it, optionally auto-correcting orientation from EXIF. To GENERATE images with AI use ai.image.","x-infrai-capability":"image.rotate","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageRotateRequest","description":"Request shape for image.rotate — rotate by degrees, optionally applying EXIF orientation correction first (ImageOps.exif_transpose). Returns ProcessedImage. See REVIEW Image Processing §3.A.","type":"object","required":["image","degrees"],"additionalProperties":false,"properties":{"image":{"description":"Image data or reference for processing","title":"ImageRef","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]},"degrees":{"type":"number","description":"Clockwise rotation in degrees."},"auto_orient":{"type":"boolean","default":true,"description":"Apply EXIF orientation correction before rotating."},"format":{"description":"Output or input format (e.g. json, csv, png)","type":"string","enum":["auto","webp","avif","jpeg","png","heic"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/smart_crop":{"post":{"tags":["image"],"operationId":"image_smart_crop","summary":"Transform an EXISTING image with saliency-aware cropping to an aspect ratio, optionally targeting faces or subject. To GENERATE images with AI use ai.image.","description":"Transform an EXISTING image with saliency-aware cropping to an aspect ratio, optionally targeting faces or subject. To GENERATE images with AI use ai.image.","x-infrai-capability":"image.smart_crop","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageSmartCropRequest","description":"Request shape for image.smart_crop — saliency-aware crop to a target aspect (libvips_saliency / imagekit / cloudinary). Returns ProcessedImage. See REVIEW Image Processing §3.A.","type":"object","required":["image","aspect"],"additionalProperties":false,"properties":{"image":{"description":"Image data or reference for processing","title":"ImageRef","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]},"aspect":{"type":"string","description":"Target aspect ratio, e.g. '1:1', '16:9'."},"target":{"type":["string","null"],"description":"Saliency target hint, e.g. 'face', 'auto'."},"format":{"description":"Output or input format (e.g. json, csv, png)","type":"string","enum":["auto","webp","avif","jpeg","png","heic"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/tag":{"post":{"tags":["image"],"operationId":"image_tag","summary":"Detect labels/objects in an image returning label + confidence pairs. Real vendor dispatch: Google Vision LABEL_DETECTION, AWS Rekognition DetectLabels. service_markup applies.","description":"Detect labels/objects in an image returning label + confidence pairs. Real vendor dispatch: Google Vision LABEL_DETECTION, AWS Rekognition DetectLabels. service_markup applies.","x-infrai-capability":"image.tag","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageTagRequest","description":"Request payload for image.tag — detect labels/objects in an image.","type":"object","required":["image"],"additionalProperties":false,"properties":{"image":{"type":"string","description":"Image as data URI, URL, or base64."},"max_tags":{"type":"integer","minimum":1,"default":10,"description":"Maximum number of tags to return"},"vendor":{"enum":["google","aws"],"description":"Optional vendor pin."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/transformation/create":{"post":{"tags":["image"],"operationId":"image_transformation_create","summary":"Register a named image-transformation template reusable in delivery URLs.","description":"Register a named image-transformation template reusable in delivery URLs.","x-infrai-capability":"image.transformation.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageTransformationCreateRequest","description":"Request shape for image.transformation.create — register a named transform preset (vendor-gated: cloudinary named transformation; self_hosted needs preset resolver). Write-idempotent. Returns ImageTransformation. See REVIEW Image Processing §3.D.","type":"object","required":["name","transform"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128,"description":"Human-readable name for this resource"},"transform":{"description":"Image transformation specification","title":"ImageTransform","type":"object","additionalProperties":false,"properties":{"w":{"type":["integer","null"],"minimum":1,"description":"Target width."},"h":{"type":["integer","null"],"minimum":1,"description":"Target height."},"f":{"description":"Format for the output image","type":"string","enum":["auto","webp","avif","jpeg","png","heic"]},"q":{"type":["integer","null"],"minimum":1,"maximum":100,"description":"Encoder quality 1-100."},"fit":{"description":"Fit mode for resizing (cover, contain, fill, inside, outside)","type":"string","enum":["cover","contain","fill","inside","outside"]}}},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/transformation/list":{"get":{"tags":["image"],"operationId":"image_transformation_list","summary":"Page through the registered named image-transformation templates.","description":"Page through the registered named image-transformation templates.","x-infrai-capability":"image.transformation.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/upload":{"post":{"tags":["image"],"operationId":"image_upload","summary":"Upload an image and get an asset with an ID and URL for later processing.","description":"Upload an image and get an asset with an ID and URL for later processing.","x-infrai-capability":"image.upload","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageUploadRequest","description":"Request shape for image.upload — store an asset and return a stable image_id (pim_). Write-idempotent. self_hosted stores to Infrai object storage; cloudinary/imagekit native upload. Returns ProcessedImage. See REVIEW Image Processing §3.C.","type":"object","required":["file"],"additionalProperties":false,"properties":{"file":{"type":"string","description":"base64-encoded bytes (multipart is mapped to this field at the transport layer)."},"filename":{"type":["string","null"],"description":"Filename for the uploaded image"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/image/watermark":{"post":{"tags":["image"],"operationId":"image_watermark","summary":"Transform an EXISTING image by overlaying a text or image watermark with position and opacity. To GENERATE images with AI use ai.image.","description":"Transform an EXISTING image by overlaying a text or image watermark with position and opacity. To GENERATE images with AI use ai.image.","x-infrai-capability":"image.watermark","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ImageWatermarkRequest","description":"Request shape for image.watermark — overlay a text or image watermark. Provide exactly one of text / watermark_image. Returns ProcessedImage. See REVIEW Image Processing §3.A.","type":"object","required":["image"],"additionalProperties":false,"oneOf":[{"required":["text"]},{"required":["watermark_image"]}],"properties":{"image":{"description":"Image data or reference for processing","title":"ImageRef","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]},"text":{"type":["string","null"],"description":"Text watermark content."},"watermark_image":{"type":["object","null"],"description":"Image watermark source (same ref shape as `image`); null when text is used.","oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["base64"],"properties":{"base64":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["image_id"],"properties":{"image_id":{"type":"string","pattern":"^pim_[A-Za-z0-9]{20,}$"}}}]},"position":{"enum":["top_left","top","top_right","left","center","right","bottom_left","bottom","bottom_right"],"default":"bottom_right","description":"Position for the watermark (e.g. top-left, center)"},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1,"description":"Watermark opacity (0.0 to 1.0)"},"format":{"description":"Output or input format (e.g. json, csv, png)","type":"string","enum":["auto","webp","avif","jpeg","png","heic"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/images/generations":{"post":{"tags":["ai (openai-compatible)"],"operationId":"images_generations","summary":"Generate images from a text prompt (OpenAI-compatible).","description":"Generate images from a text prompt (OpenAI-compatible). OpenAI-compatible: point the official OpenAI SDK/client at base_url https://api.infrai.cc/v1 with your infrai key as the Bearer token. See https://platform.openai.com/docs/api-reference for the full request/response contract; infrai adds smart routing (model=\"auto\") and returns an extra `infrai` metadata block (cost_usd / vendor / latency / cache_hit) on every response.","x-infrai-openai-compatible":true,"x-infrai-capability":"ai.image","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"model":{"type":"string","description":"Model to use. \"auto\" (default) = infrai smart routing picks the best/cheapest healthy vendor; or pin a specific model as \"vendor/model\" (e.g. \"openai/gpt-4o-mini\", \"dashscope/qwen-plus\").","examples":["auto","openai/gpt-4o-mini"]},"prompt":{"type":"string","description":"Text prompt describing the image."},"n":{"type":"integer"},"size":{"type":"string","description":"e.g. \"1024x1024\"."},"response_format":{"type":"string","enum":["url","b64_json"]}},"additionalProperties":true}}}},"responses":{"200":{"description":"OpenAI-compatible JSON response with infrai metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImageGeneration"}}}},"400":{"description":"Bad request — INVALID_ARGUMENT and other client-input errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"401":{"description":"Unauthorized — missing/invalid/revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"402":{"description":"Payment required — INSUFFICIENT_CREDIT / wallet errors (carries checkout_url).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"409":{"description":"Conflict — idempotency-key conflict or resource-state conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"429":{"description":"Too many requests — rate limited (carries retry backoff).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"503":{"description":"Service unavailable — maintenance / no healthy vendor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"default":{"description":"OpenAI-compatible error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}}}}},"/logs/ingest":{"post":{"tags":["logs"],"operationId":"logs_ingest","summary":"Ingest a batch of log entries.","description":"Ingest a batch of log entries.","x-infrai-capability":"logs.ingest","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"LogIngestRequest","description":"Request shape for logs.ingest — batched structured-log ingestion. Returns AcceptedResult.","type":"object","required":["entries"],"additionalProperties":false,"properties":{"entries":{"type":"array","minItems":1,"items":{"title":"LogEntry","description":"A single structured log line ingested via logs.ingest; also the item type returned by logs.search. `level` uses enums/log_level.yaml.","type":"object","required":["message","level"],"additionalProperties":false,"properties":{"message":{"type":"string","description":"Detailed message content"},"level":{"type":"string","enum":["debug","info","warning","error","fatal"],"description":"Severity or log level (e.g. info, warn, error)"},"timestamp":{"type":["string","null"],"format":"date-time","description":"Defaults to ingest time if omitted."},"service":{"type":["string","null"],"description":"Service name that emitted the log"},"environment":{"type":["string","null"],"description":"Deployment environment (e.g. production, staging)"},"trace_id":{"type":["string","null"],"description":"Correlate with a distributed trace."},"span_id":{"type":["string","null"],"description":"Span identifier for tracing"},"attributes":{"type":["object","null"],"description":"Arbitrary structured fields."}}},"description":"Log entries to ingest"},"idempotency_key":{"type":["string","null"],"description":"Dedup key for the whole batch (route is idempotent:true)."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/logs/search":{"get":{"tags":["logs"],"operationId":"logs_search","summary":"Search logs by keyword and time range.","description":"Search logs by keyword and time range.","x-infrai-capability":"logs.search","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/metrics/batch":{"post":{"tags":["metrics"],"operationId":"metrics_batch","summary":"Report a batch of metric data points.","description":"Report a batch of metric data points.","x-infrai-capability":"metrics.batch","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"MetricBatchRequest","description":"Request shape for metrics.batch — high-frequency batched metric ingestion. Returns MetricBatchResult.","type":"object","required":["points"],"additionalProperties":false,"properties":{"points":{"type":"array","minItems":1,"items":{"title":"MetricPoint","description":"A single metric data point ingested via metrics.report / metrics.batch.","type":"object","required":["name","value","type"],"additionalProperties":false,"properties":{"name":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_.-]{0,127}$","description":"Human-readable name for this resource"},"value":{"type":"number","description":"Value of the DNS record or configuration"},"type":{"type":"string","enum":["counter","gauge","timing","distribution"],"description":"Type discriminator for this resource"},"tags":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Tags for categorization and filtering"},"timestamp":{"type":["string","null"],"format":"date-time","description":"Defaults to ingest time if omitted."}}},"description":"Metric data points"},"idempotency_key":{"type":["string","null"],"description":"Dedup key for the whole batch (route is idempotent:true)."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/metrics/query":{"get":{"tags":["metrics"],"operationId":"metrics_query","summary":"Query a metric time series with aggregation.","description":"Query a metric time series with aggregation.","x-infrai-capability":"metrics.query","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/metrics/report":{"post":{"tags":["metrics"],"operationId":"metrics_report","summary":"Report a single metric point (counter, gauge, timing, or distribution) with tags and idempotency.","description":"Report a single metric point (counter, gauge, timing, or distribution) with tags and idempotency.","x-infrai-capability":"metrics.report","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"MetricReportRequest","description":"Request shape for metrics.report — report a single metric point. The `type` axis aligns with MetricPoint (counter/gauge/timing/distribution).","type":"object","required":["name","value","type"],"additionalProperties":false,"properties":{"name":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_.-]{0,127}$","description":"Human-readable name for this resource"},"value":{"type":"number","description":"Value of the DNS record or configuration"},"type":{"type":"string","enum":["counter","gauge","timing","distribution"],"description":"Type discriminator for this resource"},"tags":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Tags for categorization and filtering"},"timestamp":{"type":["string","null"],"format":"date-time","description":"Unix timestamp of the data point"},"idempotency_key":{"type":["string","null"],"description":"Dedup key (route is idempotent:true)."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/models":{"get":{"tags":["ai (openai-compatible)"],"operationId":"models_list","summary":"List the models available for routing (OpenAI-compatible).","description":"List the models available for routing (OpenAI-compatible). OpenAI-compatible: point the official OpenAI SDK/client at base_url https://api.infrai.cc/v1 with your infrai key as the Bearer token. See https://platform.openai.com/docs/api-reference for the full request/response contract; infrai adds smart routing (model=\"auto\") and returns an extra `infrai` metadata block (cost_usd / vendor / latency / cache_hit) on every response.","x-infrai-openai-compatible":true,"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OpenAI-compatible JSON response with infrai metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIModelList"}}}},"400":{"description":"Bad request — INVALID_ARGUMENT and other client-input errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"401":{"description":"Unauthorized — missing/invalid/revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"402":{"description":"Payment required — INSUFFICIENT_CREDIT / wallet errors (carries checkout_url).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"409":{"description":"Conflict — idempotency-key conflict or resource-state conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"429":{"description":"Too many requests — rate limited (carries retry backoff).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"503":{"description":"Service unavailable — maintenance / no healthy vendor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"default":{"description":"OpenAI-compatible error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}}}}},"/models/{model}":{"parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["ai (openai-compatible)"],"operationId":"models_get","summary":"Retrieve a single model by id (OpenAI-compatible).","description":"Retrieve a single model by id (OpenAI-compatible). OpenAI-compatible: point the official OpenAI SDK/client at base_url https://api.infrai.cc/v1 with your infrai key as the Bearer token. See https://platform.openai.com/docs/api-reference for the full request/response contract; infrai adds smart routing (model=\"auto\") and returns an extra `infrai` metadata block (cost_usd / vendor / latency / cache_hit) on every response.","x-infrai-openai-compatible":true,"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OpenAI-compatible JSON response with infrai metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIModel"}}}},"400":{"description":"Bad request — INVALID_ARGUMENT and other client-input errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"401":{"description":"Unauthorized — missing/invalid/revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"402":{"description":"Payment required — INSUFFICIENT_CREDIT / wallet errors (carries checkout_url).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"409":{"description":"Conflict — idempotency-key conflict or resource-state conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"429":{"description":"Too many requests — rate limited (carries retry backoff).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"503":{"description":"Service unavailable — maintenance / no healthy vendor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"default":{"description":"OpenAI-compatible error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}}}}},"/moderations":{"post":{"tags":["ai (openai-compatible)"],"operationId":"moderations","summary":"Classify whether content violates usage policy (OpenAI-compatible).","description":"Classify whether content violates usage policy (OpenAI-compatible). OpenAI-compatible: point the official OpenAI SDK/client at base_url https://api.infrai.cc/v1 with your infrai key as the Bearer token. See https://platform.openai.com/docs/api-reference for the full request/response contract; infrai adds smart routing (model=\"auto\") and returns an extra `infrai` metadata block (cost_usd / vendor / latency / cache_hit) on every response.","x-infrai-openai-compatible":true,"x-infrai-capability":"ai.moderate","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"model":{"type":"string","description":"Model to use. \"auto\" (default) = infrai smart routing picks the best/cheapest healthy vendor; or pin a specific model as \"vendor/model\" (e.g. \"openai/gpt-4o-mini\", \"dashscope/qwen-plus\").","examples":["auto","openai/gpt-4o-mini"]},"input":{"description":"Text string or array of strings to moderate.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"additionalProperties":true}}}},"responses":{"200":{"description":"OpenAI-compatible JSON response with infrai metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIModeration"}}}},"400":{"description":"Bad request — INVALID_ARGUMENT and other client-input errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"401":{"description":"Unauthorized — missing/invalid/revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"402":{"description":"Payment required — INSUFFICIENT_CREDIT / wallet errors (carries checkout_url).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"409":{"description":"Conflict — idempotency-key conflict or resource-state conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"429":{"description":"Too many requests — rate limited (carries retry backoff).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"503":{"description":"Service unavailable — maintenance / no healthy vendor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"default":{"description":"OpenAI-compatible error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}}}}},"/pdf/compress":{"post":{"tags":["pdf"],"operationId":"pdf_compress","summary":"Compress a PDF to reduce file size, using the global fast/balanced/quality processing mode; idempotent write.","description":"Compress a PDF to reduce file size, using the global fast/balanced/quality processing mode; idempotent write.","x-infrai-capability":"pdf.compress","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfCompressRequest","description":"Request shape for pdf.compress — reduce PDF size. Idempotent write: idempotency_key dedups retries. `mode` reuses the global fast/balanced/quality processing axis (no new enum). Returns PdfDocument(source='compress').","type":"object","required":["pdf"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"mode":{"enum":["fast","balanced","quality"],"default":"balanced","description":"Compression effort vs fidelity; reuses the global processing mode axis."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/convert":{"post":{"tags":["pdf"],"operationId":"pdf_convert","summary":"Convert a PDF to another format; unsupported targets return PDF_CONVERT_UNSUPPORTED (422); idempotent write.","description":"Convert a PDF to another format; unsupported targets return PDF_CONVERT_UNSUPPORTED (422); idempotent write.","x-infrai-capability":"pdf.convert","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfConvertRequest","description":"Request shape for pdf.convert — convert a PDF to another format. Idempotent write: idempotency_key dedups retries. Unsupported `to` -> PDF_CONVERT_UNSUPPORTED(422). Returns PdfDocument (multi-page image targets return PdfDocumentListResult).","type":"object","required":["pdf","to"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"to":{"enum":["docx","xlsx","pptx","png","jpg","html"],"description":"Target format. (SSOT: enums/PdfConvertTarget)"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/decrypt":{"post":{"tags":["pdf"],"operationId":"pdf_decrypt","summary":"Remove password protection from a PDF; wrong password returns PDF_DECRYPT_FAILED (403); idempotent write.","description":"Remove password protection from a PDF; wrong password returns PDF_DECRYPT_FAILED (403); idempotent write.","x-infrai-capability":"pdf.decrypt","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfDecryptRequest","description":"Request shape for pdf.decrypt — remove password protection. Idempotent write: idempotency_key dedups retries. Missing password -> PDF_PARSE_PASSWORD_REQUIRED(401); wrong password -> PDF_DECRYPT_FAILED(403). Returns PdfDocument(source='mutate').","type":"object","required":["pdf","password"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"password":{"type":"string","description":"Password to decrypt the document."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/encrypt":{"post":{"tags":["pdf"],"operationId":"pdf_encrypt","summary":"Encrypt a PDF with a password and permission flags; idempotent write.","description":"Encrypt a PDF with a password and permission flags; idempotent write.","x-infrai-capability":"pdf.encrypt","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfEncryptRequest","description":"Request shape for pdf.encrypt — apply password / permission encryption. Idempotent write: idempotency_key dedups retries. Returns PdfDocument(source='encrypt').","type":"object","required":["pdf"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"user_password":{"type":["string","null"],"description":"Password required to open the document."},"owner_password":{"type":["string","null"],"description":"Password required to change permissions."},"permissions":{"type":["array","null"],"items":{"type":"string"},"description":"Allowed actions (e.g. print, copy, modify)."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/extract_images":{"post":{"tags":["pdf"],"operationId":"pdf_extract_images","summary":"Extract embedded images from a PDF, returned as data: URIs; read-only, no side effects.","description":"Extract embedded images from a PDF, returned as data: URIs; read-only, no side effects.","x-infrai-capability":"pdf.extract_images","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfExtractImagesRequest","description":"Request shape for pdf.extract_images — extract embedded XObject images as data: URIs. Non-idempotent read (no side effects).","type":"object","required":["pdf"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"pages":{"type":["array","null"],"items":{"type":"integer","minimum":1},"description":"1-indexed pages to scan; null = all pages."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/form/extract":{"post":{"tags":["pdf"],"operationId":"pdf_form_extract","summary":"Read AcroForm field names and values from a PDF; read-only, no side effects.","description":"Read AcroForm field names and values from a PDF; read-only, no side effects.","x-infrai-capability":"pdf.form.extract","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfFormExtractRequest","description":"Request shape for pdf.form.extract — read AcroForm field names + values. Non-idempotent read (no side effects). Returns PdfFormExtractResult.","type":"object","required":["pdf"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/form/fill":{"post":{"tags":["pdf"],"operationId":"pdf_form_fill","summary":"Fill AcroForm fields, optionally flattening to a non-editable PDF; idempotent write.","description":"Fill AcroForm fields, optionally flattening to a non-editable PDF; idempotent write.","x-infrai-capability":"pdf.form.fill","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfFormFillRequest","description":"Request shape for pdf.form.fill — populate AcroForm fields. Idempotent write: idempotency_key dedups retries. Returns PdfDocument(source='form').","type":"object","required":["pdf","fields"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"fields":{"type":"object","description":"Map of AcroForm field name -> value."},"flatten":{"type":"boolean","default":false,"description":"If true, flatten fields so they are no longer editable."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/generate":{"post":{"tags":["pdf"],"operationId":"pdf_generate","summary":"Generate a PDF from HTML, Markdown, inline template, or a stored template rendered with variables; idempotent write.","description":"Generate a PDF from HTML, Markdown, inline template, or a stored template rendered with variables; idempotent write.","x-infrai-capability":"pdf.generate","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfGenerateRequest","description":"Request shape for pdf.generate. Idempotent write: idempotency_key dedups retries. Exactly one source of html | markdown | template_html | template_id must be supplied (others null) else PDF_TEMPLATE_INVALID. With template_id (stored-template path), the server loads the template HTML and renders with `vars`; unknown template_id -> PDF_TEMPLATE_NOT_FOUND(404), missing required variable -> PDF_TEMPLATE_VAR_MISSING(400). Returns PdfDocument (source = html/markdown/template).","type":"object","additionalProperties":false,"properties":{"html":{"type":["string","null"],"description":"Inline HTML source."},"markdown":{"type":["string","null"],"description":"Inline Markdown source."},"template_html":{"type":["string","null"],"description":"Inline HTML template rendered with template_vars."},"template_id":{"type":["string","null"],"description":"Stored template id; server loads its HTML and renders with `vars` (source='template')."},"template_vars":{"type":["object","null"],"description":"Variables for template_html."},"vars":{"type":["object","null"],"description":"Variables for template_id rendering."},"page_size":{"description":"Page size (e.g. A4, Letter)","type":"string","enum":["A4","A3","A5","Letter","Legal","Tabloid"]},"orientation":{"enum":["portrait","landscape"],"default":"portrait","description":"Page orientation (portrait, landscape)"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/job/get/{job_id}":{"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["pdf"],"operationId":"pdf_job_get","summary":"Get the status and result of an asynchronous PDF job by job_id.","description":"Get the status and result of an asynchronous PDF job by job_id.","x-infrai-capability":"pdf.job.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/merge":{"post":{"tags":["pdf"],"operationId":"pdf_merge","summary":"Concatenate multiple PDFs in order into a single document; idempotent write.","description":"Concatenate multiple PDFs in order into a single document; idempotent write.","x-infrai-capability":"pdf.merge","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfMergeRequest","description":"Request shape for pdf.merge — concatenate inputs in order into one PdfDocument(source='mutate'). Idempotent write: idempotency_key dedups retries. Fewer than one input -> PDF_TEMPLATE_INVALID(param='inputs').","type":"object","required":["inputs"],"additionalProperties":false,"properties":{"inputs":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Ordered list of PDF inputs (URL, base64, or stored pdf_id)."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/ocr":{"post":{"tags":["pdf"],"operationId":"pdf_ocr","summary":"Run OCR on a scanned PDF; unsupported language returns PDF_OCR_LANG_UNSUPPORTED (400); idempotent write.","description":"Run OCR on a scanned PDF; unsupported language returns PDF_OCR_LANG_UNSUPPORTED (400); idempotent write.","x-infrai-capability":"pdf.ocr","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfOcrRequest","description":"Request shape for pdf.ocr — OCR a scanned PDF. Idempotent write: idempotency_key dedups retries. Unsupported lang -> PDF_OCR_LANG_UNSUPPORTED(400). Returns PdfOcrResult.","type":"object","required":["pdf"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"lang":{"type":"string","default":"eng","description":"OCR language code."},"quality":{"enum":["fast","balanced","quality"],"default":"fast","description":"OCR effort vs accuracy; reuses the global processing mode axis."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/parse":{"post":{"tags":["pdf"],"operationId":"pdf_parse","summary":"Extract text, outline, and metadata from a PDF for RAG ingestion; read-only, no side effects.","description":"Extract text, outline, and metadata from a PDF for RAG ingestion; read-only, no side effects.","x-infrai-capability":"pdf.parse","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfParseRequest","description":"Request shape for pdf.parse — extract text + outline + metadata for RAG ingestion. Non-idempotent read (no side effects, no idempotency_key). Encrypted PDF without password -> PDF_PARSE_PASSWORD_REQUIRED.","type":"object","required":["pdf"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"pages":{"type":["array","null"],"items":{"type":"integer","minimum":1},"description":"1-indexed pages to parse; null = all pages."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/redact":{"post":{"tags":["pdf"],"operationId":"pdf_redact","summary":"Irreversibly black out content by region or regex pattern; idempotent write.","description":"Irreversibly black out content by region or regex pattern; idempotent write.","x-infrai-capability":"pdf.redact","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfRedactRequest","description":"Request shape for pdf.redact — irreversibly black out content by region and/or pattern. Idempotent write: idempotency_key dedups retries. Returns PdfDocument(source='redact').","type":"object","required":["pdf"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"regions":{"type":["array","null"],"items":{"type":"object","additionalProperties":false,"required":["page","x","y","width","height"],"properties":{"page":{"type":"integer","minimum":1},"x":{"type":"number","minimum":0},"y":{"type":"number","minimum":0},"width":{"type":"number","minimum":0},"height":{"type":"number","minimum":0}}},"description":"Explicit rectangular regions to redact."},"patterns":{"type":["array","null"],"items":{"type":"string"},"description":"Regex patterns; matched text is redacted."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/rotate":{"post":{"tags":["pdf"],"operationId":"pdf_rotate","summary":"Rotate specified pages by 0, 90, 180, or 270 degrees; idempotent write.","description":"Rotate specified pages by 0, 90, 180, or 270 degrees; idempotent write.","x-infrai-capability":"pdf.rotate","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfRotateRequest","description":"Request shape for pdf.rotate — rotate selected pages. Idempotent write: idempotency_key dedups retries. degrees not in 0 and90 and180 and270 -> PDF_TEMPLATE_INVALID(param='degrees'); pages out of range (p<1 or p>page_count) -> PDF_TEMPLATE_INVALID(param='pages'). Returns PdfDocument(source='mutate').","type":"object","required":["pdf"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"degrees":{"enum":[0,90,180,270],"default":90,"description":"Rotation angle in degrees"},"pages":{"type":["array","null"],"items":{"type":"integer","minimum":1},"description":"1-indexed pages to rotate; null = all pages."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/sign":{"post":{"tags":["pdf"],"operationId":"pdf_sign","summary":"Apply a PKCS#7 / PAdES digital signature to a PDF; invalid certificate returns PDF_SIGN_CERT_INVALID; idempotent write.","description":"Apply a PKCS#7 / PAdES digital signature to a PDF; invalid certificate returns PDF_SIGN_CERT_INVALID; idempotent write.","x-infrai-capability":"pdf.sign","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfSignRequest","description":"Request shape for pdf.sign — apply a PKCS#7 / PAdES digital signature. Idempotent write: idempotency_key dedups retries. cert_pem/key_pem must carry valid PEM headers else PDF_SIGN_CERT_INVALID. Returns SignedPdfDocument.","type":"object","required":["pdf","cert_pem","key_pem"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"cert_pem":{"type":"string","description":"Signing certificate, PEM-encoded."},"key_pem":{"type":"string","description":"Private key, PEM-encoded."},"reason":{"type":["string","null"],"description":"Reason for the current state or action"},"location":{"type":["string","null"],"description":"Location where the PDF was signed"},"retention_days":{"type":["integer","null"],"minimum":0,"description":"Number of days to retain this resource"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/split":{"post":{"tags":["pdf"],"operationId":"pdf_split","summary":"Split a PDF into multiple documents by 1-indexed inclusive page ranges; idempotent write.","description":"Split a PDF into multiple documents by 1-indexed inclusive page ranges; idempotent write.","x-infrai-capability":"pdf.split","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfSplitRequest","description":"Request shape for pdf.split — slice into N documents by N page ranges. Idempotent write: idempotency_key dedups retries. Each range is a 2-element [start,end], 1-indexed inclusive, start>=1, end<=page_count, start<=end. Empty / non-binary / out-of-range ranges -> PDF_TEMPLATE_INVALID(param='ranges'). Returns list[PdfDocument](source='mutate').","type":"object","required":["pdf","ranges"],"additionalProperties":false,"properties":{"ranges":{"type":"array","minItems":1,"items":{"type":"array","items":{"type":"integer","minimum":1},"minItems":2,"maxItems":2},"description":"List of [start,end] page ranges, 1-indexed inclusive."},"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/template/create":{"post":{"tags":["pdf"],"operationId":"pdf_template_create","summary":"Create a reusable HTML PDF template; idempotent write.","description":"Create a reusable HTML PDF template; idempotent write.","x-infrai-capability":"pdf.template.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfTemplateCreateRequest","description":"Request shape for pdf.template.create — store a reusable HTML template. Idempotent write: idempotency_key dedups retries. Returns PdfTemplate.","type":"object","required":["name","html"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"Human-readable name for this resource"},"html":{"type":"string","description":"Template HTML with double-brace var placeholders."},"vars_schema":{"type":["object","null"],"description":"JSON-Schema describing required template variables."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/verify":{"post":{"tags":["pdf"],"operationId":"pdf_verify","summary":"Verify a signed PDF's signature validity against a certificate; read-only, no side effects.","description":"Verify a signed PDF's signature validity against a certificate; read-only, no side effects.","x-infrai-capability":"pdf.verify","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfVerifyRequest","description":"Request shape for pdf.verify — validate a signed PDF against a certificate. Non-idempotent read (no side effects). cert_pem required. Returns SignatureVerification.","type":"object","required":["signed_pdf","cert_pem"],"additionalProperties":false,"properties":{"signed_pdf":{"type":"string","description":"Signed PDF input: URL, base64 data, or stored pdf_id."},"cert_pem":{"type":"string","description":"Certificate to verify against, PEM-encoded."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/pdf/watermark":{"post":{"tags":["pdf"],"operationId":"pdf_watermark","summary":"Stamp a text and/or image watermark onto a PDF; idempotent write.","description":"Stamp a text and/or image watermark onto a PDF; idempotent write.","x-infrai-capability":"pdf.watermark","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PdfWatermarkRequest","description":"Request shape for pdf.watermark — stamp text and/or image watermark. Idempotent write: idempotency_key dedups retries. text and image both empty -> PDF_TEMPLATE_INVALID. Returns PdfDocument(source='mutate').","type":"object","required":["pdf"],"additionalProperties":false,"properties":{"pdf":{"type":"string","description":"PDF input: URL, base64 data, or stored pdf_id."},"text":{"type":["string","null"],"description":"Text watermark; one of text/image required."},"image":{"type":["string","null"],"description":"Image watermark input (URL/base64); one of text/image required."},"opacity":{"type":"number","minimum":0,"maximum":1,"default":0.3,"description":"Watermark opacity (0.0 to 1.0)"},"position":{"enum":["center","top-left","top-right","bottom-left","bottom-right"],"default":"center","description":"Position for the watermark (e.g. top-left, center)"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced PDF in Infrai's own store (default false = stateless passthrough: produce, return inline, keep nothing). When true, Infrai persists the document, bills a self-hosted storage line item and applies a retention TTL — and only then do pdf.list/get/delete see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/ack":{"post":{"tags":["queue"],"operationId":"queue_ack","summary":"Acknowledge (ack) a consumed message to remove it from the queue.","description":"Acknowledge (ack) a consumed message to remove it from the queue.","x-infrai-capability":"queue.ack","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"QueueAckRequest","description":"Request shape for queue.ack — confirm successful processing of a leased message (at-least-once delivery). See REVIEW Scheduling §3.B.","type":"object","required":["queue","message_id"],"additionalProperties":false,"properties":{"queue":{"type":"string","description":"Queue name this message or subscription belongs to"},"message_id":{"type":"string","pattern":"^qmsg_[A-Za-z0-9]{20,}$","description":"Unique identifier for this message"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/consume":{"post":{"tags":["queue"],"operationId":"queue_consume","summary":"Pull a batch of messages from a queue for processing.","description":"Pull a batch of messages from a queue for processing.","x-infrai-capability":"queue.consume","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"QueueConsumeRequest","description":"Request shape for queue.consume — lease-based pull (maps module poll). Non-idempotent: each call leases a different batch. See REVIEW Scheduling §3.B.","type":"object","required":["queue"],"additionalProperties":false,"properties":{"queue":{"type":"string","description":"Queue name this message or subscription belongs to"},"max_messages":{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"Maximum number of messages to consume in one batch"},"visibility_timeout":{"type":["integer","null"],"minimum":0,"maximum":43200,"description":"Lease seconds; defaults to queue's visibility_timeout_default."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/create":{"post":{"tags":["queue"],"operationId":"queue_create","summary":"Create a message queue (standard or FIFO, with optional dead-letter queue).","description":"Create a message queue (standard or FIFO, with optional dead-letter queue).","x-infrai-capability":"queue.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"QueueCreateRequest","description":"Request shape for queue.create — declarative queue provisioning (standard/fifo + DLQ). See REVIEW Scheduling §3.B. Returns a Queue.","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9._-]+$","description":"Human-readable name for this resource"},"type":{"default":"standard","description":"Type discriminator for this resource","type":"string","enum":["standard","fifo"]},"dead_letter_queue":{"type":["string","null"],"description":"Name of an existing queue to receive failed messages."},"max_retries":{"type":["integer","null"],"minimum":1,"description":"Nack count before moving to DLQ."},"message_retention_days":{"type":["integer","null"],"minimum":1,"maximum":30,"description":"Number of days to retain queue messages"},"visibility_timeout_default":{"type":["integer","null"],"minimum":0,"maximum":43200,"description":"Default visibility timeout in seconds"},"enable_priority":{"type":["boolean","null"],"description":"Whether priority-based delivery is enabled"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/delete/{queue}":{"parameters":[{"name":"queue","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["queue"],"operationId":"queue_delete","summary":"Delete a message queue and discard all of its pending messages (use queue.purge to keep the queue); idempotent.","description":"Delete a message queue and discard all of its pending messages (use queue.purge to keep the queue); idempotent.","x-infrai-capability":"queue.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/dlq/list/{queue}":{"parameters":[{"name":"queue","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["queue"],"operationId":"queue_dlq_list","summary":"List messages in a queue's dead-letter queue (DLQ) with pagination.","description":"List messages in a queue's dead-letter queue (DLQ) with pagination.","x-infrai-capability":"queue.dlq.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/dlq/redrive/{queue}":{"parameters":[{"name":"queue","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["queue"],"operationId":"queue_dlq_redrive","summary":"Redrive dead-letter messages back to the source queue, individually or in bulk.","description":"Redrive dead-letter messages back to the source queue, individually or in bulk.","x-infrai-capability":"queue.dlq.redrive","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"QueueDlqRedriveRequest","description":"Request shape for queue.dlq.redrive — re-deliver dead-lettered messages. Single message (message_id) or bulk (since). See REVIEW Scheduling §3.B.","type":"object","required":["queue"],"additionalProperties":false,"properties":{"queue":{"type":"string","description":"Queue name this message or subscription belongs to"},"message_id":{"type":["string","null"],"pattern":"^qmsg_[A-Za-z0-9]{20,}$","description":"Redrive a single message; omit for bulk."},"since":{"type":["string","null"],"format":"date-time","description":"Bulk redrive all DLQ messages dead-lettered at/after this time."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/get/{queue}":{"parameters":[{"name":"queue","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["queue"],"operationId":"queue_get","summary":"Retrieve a queue's configuration details.","description":"Retrieve a queue's configuration details.","x-infrai-capability":"queue.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/list":{"get":{"tags":["queue"],"operationId":"queue_list","summary":"List all message queues with pagination.","description":"List all message queues with pagination.","x-infrai-capability":"queue.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/nack":{"post":{"tags":["queue"],"operationId":"queue_nack","summary":"Negatively acknowledge (nack) a message to requeue it or route it to the DLQ.","description":"Negatively acknowledge (nack) a message to requeue it or route it to the DLQ.","x-infrai-capability":"queue.nack","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"QueueNackRequest","description":"Request shape for queue.nack — negative-acknowledge a leased message; requeue for retry or send to DLQ. See REVIEW Scheduling §3.B.","type":"object","required":["queue","message_id"],"additionalProperties":false,"properties":{"queue":{"type":"string","description":"Queue name this message or subscription belongs to"},"message_id":{"type":"string","pattern":"^qmsg_[A-Za-z0-9]{20,}$","description":"Unique identifier for this message"},"requeue":{"type":"boolean","default":true,"description":"false → straight to DLQ."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/publish":{"post":{"tags":["queue"],"operationId":"queue_publish","summary":"Publish a single message to a queue (idempotent).","description":"Publish a single message to a queue (idempotent).","x-infrai-capability":"queue.publish","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"QueuePublishRequest","description":"Request shape for queue.publish — preserves delay/priority/FIFO group/dedup/headers. See REVIEW Scheduling §3 modify_existing.","type":"object","required":["queue","payload"],"additionalProperties":false,"properties":{"queue":{"type":"string","description":"Queue name this message or subscription belongs to"},"payload":{"type":"object","description":"Payload data for the message or request body"},"delay_seconds":{"type":"integer","minimum":0,"maximum":604800,"default":0,"description":"0..604800 (7 days)."},"priority":{"type":"integer","minimum":0,"maximum":9,"default":0,"description":"Priority for MX or SRV records"},"message_group_id":{"type":["string","null"],"description":"FIFO only."},"deduplication_id":{"type":["string","null"],"description":"FIFO only; 5-min dedup window."},"headers":{"type":["object","null"],"description":"Custom HTTP headers to include in requests or responses"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/publish_batch":{"post":{"tags":["queue"],"operationId":"queue_publish_batch","summary":"Publish multiple messages to a queue in a single batch.","description":"Publish multiple messages to a queue in a single batch.","x-infrai-capability":"queue.publish_batch","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"QueuePublishBatchRequest","description":"Request shape for queue.publish_batch — enqueue up to 100 messages in one call (high-throughput fan-out). See REVIEW Scheduling §3.B.","type":"object","required":["queue","messages"],"additionalProperties":false,"properties":{"queue":{"type":"string","description":"Queue name this message or subscription belongs to"},"messages":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["payload"],"additionalProperties":false,"properties":{"payload":{"type":"object"},"delay_seconds":{"type":"integer","minimum":0,"maximum":604800,"default":0},"priority":{"type":"integer","minimum":0,"maximum":9,"default":0},"message_group_id":{"type":["string","null"]},"deduplication_id":{"type":["string","null"]},"headers":{"type":["object","null"]}}},"description":"List of messages to publish or process"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/purge/{queue}":{"parameters":[{"name":"queue","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["queue"],"operationId":"queue_purge","summary":"Purge all messages from a queue.","description":"Purge all messages from a queue.","x-infrai-capability":"queue.purge","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"QueuePurgeRequest","description":"Request shape for queue.purge — drop all pending messages from a queue. Returns queue + purged count.","type":"object","required":["queue"],"additionalProperties":false,"properties":{"queue":{"type":"string","description":"Name of the queue to purge."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/push_subscribe/{queue}":{"parameters":[{"name":"queue","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["queue"],"operationId":"queue_push_subscribe","summary":"Configure a push subscription to deliver queue messages to a callback URL.","description":"Configure a push subscription to deliver queue messages to a callback URL.","x-infrai-capability":"queue.push_subscribe","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"QueuePushSubscribeRequest","description":"Request shape for queue.push_subscribe — register a remote URL that the queue pushes messages to (serverless consume; maps module subscribe_webhook). Returns a Subscription. Distinct from the local in-proc queue.subscribe worker, which is SDK-local and not a gateway capability. See REVIEW Scheduling §3.B / §4.","type":"object","required":["queue","url"],"additionalProperties":false,"properties":{"queue":{"type":"string","description":"Queue name this message or subscription belongs to"},"url":{"type":"string","format":"uri","description":"https:// push target; SSRF-validated."},"secret":{"type":["string","null"],"description":"HMAC signing secret for pushed deliveries."},"max_retries":{"type":["integer","null"],"minimum":0,"description":"Maximum number of delivery retries"},"visibility_timeout":{"type":["integer","null"],"minimum":0,"maximum":43200,"description":"Visibility timeout in seconds"},"dead_letter_queue":{"type":["string","null"],"description":"Dead-letter queue name for failed messages"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/stats/{queue}":{"parameters":[{"name":"queue","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["queue"],"operationId":"queue_stats","summary":"Retrieve queue metrics: available, in-flight, and dead-lettered message counts.","description":"Retrieve queue metrics: available, in-flight, and dead-lettered message counts.","x-infrai-capability":"queue.stats","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/queue/update/{queue}":{"parameters":[{"name":"queue","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"tags":["queue"],"operationId":"queue_update","summary":"Update a queue's DLQ, retry, and retention settings.","description":"Update a queue's DLQ, retry, and retention settings.","x-infrai-capability":"queue.update","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"QueueUpdateRequest","description":"Request shape for queue.update — change max_retries / DLQ / retention. See REVIEW Scheduling §3.B. Returns a Queue.","type":"object","additionalProperties":false,"properties":{"dead_letter_queue":{"type":["string","null"],"description":"Dead-letter queue name for failed messages"},"max_retries":{"type":["integer","null"],"minimum":1,"description":"Maximum number of delivery retries"},"message_retention_days":{"type":["integer","null"],"minimum":1,"maximum":30,"description":"Number of days to retain queue messages"},"visibility_timeout_default":{"type":["integer","null"],"minimum":0,"maximum":43200,"description":"Default visibility timeout in seconds"},"enable_priority":{"type":["boolean","null"],"description":"Whether priority-based delivery is enabled"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/realtime/channel/create":{"post":{"tags":["realtime"],"operationId":"realtime_channel_create","summary":"Create a realtime pub/sub channel; idempotent.","description":"Create a realtime pub/sub channel; idempotent.","x-infrai-capability":"realtime.channel.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ChannelCreateRequest","description":"Request shape for realtime.channel.create — declare a realtime channel. Returns channel + channel_id + vendor.","type":"object","required":["channel"],"additionalProperties":false,"properties":{"channel":{"type":"string","description":"Channel name to create."},"type":{"type":"string","default":"public","description":"Channel type (e.g. public, private, presence)."},"vendor":{"type":["string","null"],"description":"Pin to a specific fan-out vendor; falls back to the registry default."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/realtime/channel/delete/{channel}":{"parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["realtime"],"operationId":"realtime_channel_delete","summary":"Delete a realtime channel and disconnect its subscribers.","description":"Delete a realtime channel and disconnect its subscribers.","x-infrai-capability":"realtime.channel.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/realtime/channel/get/{channel}":{"parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["realtime"],"operationId":"realtime_channel_get","summary":"Get a single realtime channel's details (type, vendor, online count, etc.).","description":"Get a single realtime channel's details (type, vendor, online count, etc.).","x-infrai-capability":"realtime.channel.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/realtime/channel/list":{"get":{"tags":["realtime"],"operationId":"realtime_channel_list","summary":"List the account's realtime channels with pagination.","description":"List the account's realtime channels with pagination.","x-infrai-capability":"realtime.channel.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/realtime/event/types":{"get":{"tags":["realtime"],"operationId":"realtime_event_types","summary":"List the closed set of subscribable realtime event types.","description":"List the closed set of subscribable realtime event types.","x-infrai-capability":"realtime.event.types","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/realtime/presence/get/{channel}":{"parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["realtime"],"operationId":"realtime_presence_get","summary":"Get the current presence state of members online in a channel.","description":"Get the current presence state of members online in a channel.","x-infrai-capability":"realtime.presence.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/realtime/publish":{"post":{"tags":["realtime"],"operationId":"realtime_publish","summary":"Publish an event message to a realtime pub/sub channel.","description":"Publish an event message to a realtime pub/sub channel.","x-infrai-capability":"realtime.publish","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PublishRequest","description":"Request shape for realtime.publish — fan out a single event to a channel via the configured realtime vendor. Returns the event_id. Fail-closed: no configured fan-out vendor yields VENDOR_DOWN.","type":"object","required":["channel"],"additionalProperties":false,"properties":{"channel":{"type":"string","description":"Channel to publish to."},"event":{"type":"string","default":"message","description":"Event name."},"data":{"description":"Event payload (any JSON value)."},"account_id":{"type":["string","null"],"description":"Account identifier that owns this resource"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/realtime/publish/batch":{"post":{"tags":["realtime"],"operationId":"realtime_publish_batch","summary":"Publish messages to multiple channels in a single batch call.","description":"Publish messages to multiple channels in a single batch call.","x-infrai-capability":"realtime.publish.batch","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"PublishBatchRequest","description":"Publish multiple messages in one call for realtime.publish.batch (POST /v1/realtime/publish/batch, idempotent:true). Returns PublishBatchResult. Maps to vendor batch endpoints (Ably /messages, Pusher /batch_events). Requires a configured fan-out vendor (none -> REALTIME_VENDOR_DOWN 503).","type":"object","required":["messages"],"additionalProperties":false,"properties":{"messages":{"type":"array","minItems":1,"items":{"type":"object","required":["channel","event","data"],"additionalProperties":false,"properties":{"channel":{"type":"string","minLength":1},"event":{"type":"string","minLength":1,"description":"Event name on the channel."},"data":{"description":"Message payload (any JSON)."}}},"description":"List of messages to publish or process"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/realtime/token/issue":{"post":{"tags":["realtime"],"operationId":"realtime_token_issue","summary":"Issue a short-lived infrai-HMAC client auth token for pub/sub realtime channels (NOT for AI voice sessions — see ai.voice.session).","description":"Issue a short-lived infrai-HMAC client auth token for pub/sub realtime channels (NOT for AI voice sessions — see ai.voice.session).","x-infrai-capability":"realtime.token.issue","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"TokenIssueRequest","description":"Issue a short-lived infrai-HMAC subscription token for realtime.token.issue (POST /v1/realtime/token, idempotent:true). Returns RealtimeToken (tok.to_dict()). CONVERGED: this route means infrai-HMAC signing verified by the Infrai gateway; when a fan-out vendor (Ably/Pusher) is configured it instead mints a vendor-native client token so the client can connect to the same vendor. A denied capability returns REALTIME_CAPABILITY_DENIED 403 (never silently downgraded); missing HMAC signing secret -> REALTIME_VENDOR_DOWN 503. See docs/Infrai_SDK_API.md realtime token.","type":"object","required":["client_id"],"additionalProperties":false,"properties":{"client_id":{"type":"string","minLength":1,"description":"Identity the issued token is bound to."},"channels":{"type":["array","null"],"items":{"type":"string"},"description":"Channels the token may attach to; omit for an account-scoped token."},"capabilities":{"type":["array","null"],"items":{"type":"string","enum":["subscribe","publish","presence","history"],"description":"Per-token capability bits for a client connection."},"description":"Capability bits; constrained to the RealtimeCapability closed set. Defaults to subscribe."},"ttl_seconds":{"type":["integer","null"],"minimum":1,"description":"Requested lifetime; clamped to MAX_TTL_SECONDS (<=0 or invalid -> REALTIME_TOKEN_TTL_INVALID 400)."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/realtime/token/revoke":{"post":{"tags":["realtime"],"operationId":"realtime_token_revoke","summary":"Revoke a previously issued subscription token (e.g., on logout or ban).","description":"Revoke a previously issued subscription token (e.g., on logout or ban).","x-infrai-capability":"realtime.token.revoke","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"TokenRevokeRequest","description":"Revoke a previously issued token for realtime.token.revoke (POST /v1/realtime/token/revoke, idempotent:true). Returns TokenRevokeResult. Used on logout/ban; the token jti is added to the revocation list (subsequent use -> REALTIME_TOKEN_REVOKED 401).","type":"object","required":["token_or_jti"],"additionalProperties":false,"properties":{"token_or_jti":{"type":"string","minLength":1,"description":"Either the full token or its jti."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/realtime/user/disconnect":{"post":{"tags":["realtime"],"operationId":"realtime_user_disconnect","summary":"Forcibly disconnect a client, optionally scoped to a single channel.","description":"Forcibly disconnect a client, optionally scoped to a single channel.","x-infrai-capability":"realtime.user.disconnect","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"UserDisconnectRequest","description":"Force a client offline for realtime.user.disconnect (POST /v1/realtime/users/disconnect, idempotent:true). Returns UserDisconnectResult. Optional channel scopes the disconnect to one channel; omit to disconnect everywhere.","type":"object","required":["client_id"],"additionalProperties":false,"properties":{"client_id":{"type":"string","minLength":1,"description":"Client identifier for the connected user"},"channel":{"type":["string","null"],"description":"Restrict the disconnect to this channel; omit for all."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/risk/device/fingerprint":{"post":{"tags":["risk"],"operationId":"risk_device_fingerprint","summary":"Resolve a stable device fingerprint / visitor id from a client-collected token plus IP and user-agent signals, for bot and incognito detection. Served by a vendor (sift).","description":"Resolve a stable device fingerprint / visitor id from a client-collected token plus IP and user-agent signals, for bot and incognito detection. Served by a vendor (sift).","x-infrai-capability":"risk.device.fingerprint","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"DeviceFingerprintRequest","description":"risk.device.fingerprint — device-fingerprint resolution request.","type":"object","properties":{"request_token":{"type":"string","description":"client-collected token / visitor id"},"ip":{"type":"string","description":"IP address from which the session was created"},"user_agent":{"type":"string","description":"User-Agent string of the client"},"properties":{"type":"object","additionalProperties":true,"description":"Additional properties for risk assessment"}},"additionalProperties":false}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/risk/event/report":{"post":{"tags":["risk"],"operationId":"risk_event_report","summary":"Report a risk-relevant event or label (chargeback, fraud, abuse) back to the vendor as feedback to improve future scoring.","description":"Report a risk-relevant event or label (chargeback, fraud, abuse) back to the vendor as feedback to improve future scoring.","x-infrai-capability":"risk.event.report","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"RiskEventReport","description":"risk.event.report — risk-event / label feedback to the vendor.","type":"object","required":["event_type"],"properties":{"subject_id":{"type":"string","description":"Identifier of the subject being risk-scored"},"event_type":{"type":"string","examples":["chargeback","fraud","abuse"],"description":"Type of risk event (e.g. login, payment, registration)"},"label":{"type":"string","enum":["fraud","not_fraud"],"description":"Risk label (e.g. low, medium, high)"},"reason":{"type":"string","description":"Reason for the current state or action"},"properties":{"type":"object","additionalProperties":true,"description":"Additional properties for risk assessment"}},"additionalProperties":false}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/risk/score":{"post":{"tags":["risk"],"operationId":"risk_score","summary":"Score a user/account event (login, payment, signup) for fraud and abuse risk, returning a normalized 0..1 score plus an accept / review / reject disposition. Billable work-action, ML high-margin (service_markup).","description":"Score a user/account event (login, payment, signup) for fraud and abuse risk, returning a normalized 0..1 score plus an accept / review / reject disposition. Billable work-action, ML high-margin (service_markup).","x-infrai-capability":"risk.score","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"RiskScoreRequest","description":"risk.score — fraud/abuse scoring request (BILLABLE work-action). served_by=vendor.","type":"object","properties":{"subject_id":{"type":"string","description":"user/account id under evaluation"},"event_type":{"type":"string","default":"login","examples":["login","payment","signup","loan"],"description":"Type of risk event (e.g. login, payment, registration)"},"ip":{"type":"string","format":"ipv4","description":"IP address from which the session was created"},"email":{"type":"string","format":"email","description":"Email address"},"device_fingerprint":{"type":"string","description":"Device fingerprint hash for identity tracking"},"amount":{"type":"number","minimum":0,"description":"Monetary amount in the specified currency"},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code (e.g. USD, CNY)"},"properties":{"type":"object","additionalProperties":true,"description":"Additional properties for risk assessment"},"vendor":{"type":"string","enum":["maxmind","sift","shumei","tongdun"],"description":"Vendor that handled or will handle this request"},"idempotency_key":{"type":"string","description":"Client-provided idempotency key; prevents duplicate execution on retry"}},"additionalProperties":false}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/rtc/participant/kick/{room}":{"parameters":[{"name":"room","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["rtc"],"operationId":"rtc_participant_kick","summary":"Forcibly remove (kick) a participant from a room.","description":"Forcibly remove (kick) a participant from a room.","x-infrai-capability":"rtc.participant.kick","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ParticipantKickRequest","description":"Request for rtc.participant.kick — remove a participant from a room (path room).","type":"object","required":["room","identity"],"additionalProperties":false,"properties":{"room":{"type":"string","minLength":1,"description":"Path param; the room name."},"identity":{"type":"string","minLength":1,"description":"Participant identity / uid to remove."},"vendor":{"type":["string","null"],"enum":["livekit","agora","tencent_rtc","zego",null],"description":"Vendor that handled or will handle this request"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/rtc/participant/list/{room}":{"parameters":[{"name":"room","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["rtc"],"operationId":"rtc_participant_list","summary":"List participants currently in a room.","description":"List participants currently in a room.","x-infrai-capability":"rtc.participant.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/rtc/room/create":{"post":{"tags":["rtc"],"operationId":"rtc_room_create","summary":"Create a live audio/video room on the selected RTC vendor. Some vendors (Agora/Zego) have no persistent room object — the room materializes on first join and the record is synthesized.","description":"Create a live audio/video room on the selected RTC vendor. Some vendors (Agora/Zego) have no persistent room object — the room materializes on first join and the record is synthesized.","x-infrai-capability":"rtc.room.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"RoomCreateRequest","description":"Request for rtc.room.create.","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"description":"Room name (unique per account)."},"max_participants":{"type":["integer","null"],"minimum":1,"description":"Maximum number of participants allowed in the room"},"empty_timeout_s":{"type":["integer","null"],"minimum":0,"description":"Auto-close after this many seconds empty."},"metadata":{"type":["object","null"],"description":"Arbitrary key-value metadata attached to this resource"},"region":{"type":["string","null"],"description":"Geographic region where this resource is located or processed"},"vendor":{"type":["string","null"],"enum":["livekit","agora","tencent_rtc","zego",null],"description":"Vendor that handled or will handle this request"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/rtc/room/delete/{room}":{"parameters":[{"name":"room","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["rtc"],"operationId":"rtc_room_delete","summary":"Close an RTC room (vendors without a delete API auto-close when empty).","description":"Close an RTC room (vendors without a delete API auto-close when empty).","x-infrai-capability":"rtc.room.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/rtc/room/get/{room}":{"parameters":[{"name":"room","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["rtc"],"operationId":"rtc_room_get","summary":"Fetch a single RTC room's state and live occupancy.","description":"Fetch a single RTC room's state and live occupancy.","x-infrai-capability":"rtc.room.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/rtc/room/list":{"get":{"tags":["rtc"],"operationId":"rtc_room_list","summary":"List active RTC rooms / channels for the account.","description":"List active RTC rooms / channels for the account.","x-infrai-capability":"rtc.room.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/rtc/token/issue":{"post":{"tags":["rtc"],"operationId":"rtc_token_issue","summary":"Mint a per-participant join token (vendor-native JWT/AccessToken2/token04, signed locally). Billed per participant-minute conceptually; bandwidth/egress floored at cost.","description":"Mint a per-participant join token (vendor-native JWT/AccessToken2/token04, signed locally). Billed per participant-minute conceptually; bandwidth/egress floored at cost.","x-infrai-capability":"rtc.token.issue","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"TokenIssueRequest","description":"Request for rtc.token.issue — mint a per-participant join token (billed per participant-minute conceptually).","type":"object","required":["room","identity"],"additionalProperties":false,"properties":{"room":{"type":"string","minLength":1,"description":"Room name or identifier"},"identity":{"type":"string","minLength":1,"description":"Unique per-participant identity / uid."},"display_name":{"type":["string","null"],"description":"Human-readable display name"},"ttl_s":{"type":"integer","minimum":1,"default":3600,"description":"Time-to-live in seconds for the token"},"can_publish":{"type":"boolean","default":true,"description":"Whether the token grants publish permission"},"can_subscribe":{"type":"boolean","default":true,"description":"Whether the token grants subscribe permission"},"can_publish_data":{"type":"boolean","default":true,"description":"Whether the token grants data channel publish permission"},"is_admin":{"type":"boolean","default":false,"description":"Whether the token grants admin privileges"},"vendor":{"type":["string","null"],"enum":["livekit","agora","tencent_rtc","zego",null],"description":"Vendor that handled or will handle this request"},"metadata":{"type":["object","null"],"description":"Arbitrary key-value metadata attached to this resource"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/batch/send":{"post":{"tags":["sms"],"operationId":"sms_batch_send","summary":"Send a heterogeneous batch of SMS (each a full request) under one idempotency key, billed per message.","description":"Send a heterogeneous batch of SMS (each a full request) under one idempotency key, billed per message.","x-infrai-capability":"sms.batch.send","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsBatchSendRequest","description":"Heterogeneous batch send: each item is a full SmsSendRequest (distinct body / recipients / template). One idempotency_key for the whole batch; per-message charges are not double-billed (batch passthrough).","type":"object","required":["messages"],"additionalProperties":false,"properties":{"messages":{"type":"array","minItems":1,"maxItems":100,"items":{"title":"SmsSendRequest","description":"Request shape for infra.sms.send. See docs/phase2/P2_03_New_Modules.md §1.2.","type":"object","required":["to"],"additionalProperties":false,"properties":{"to":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"E.164 phone number or array of."},"body":{"type":["string","null"],"description":"Plain text body of the message"},"from":{"type":["string","null"],"description":"Sender ID / phone number; required for verified_sender mode."},"template_id":{"type":["string","null"],"description":"Identifier of the template used for rendering"},"template_vars":{"type":["object","null"],"description":"Variables to substitute in the template"},"vendor":{"type":["string","null"],"description":"Pin to a specific vendor."},"mode":{"enum":["default_vendor","verified_sender"],"default":"default_vendor","description":"Delivery mode or operation mode"},"scheduled_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp when the resource is scheduled to activate"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for categorization and filtering"},"route_class":{"enum":["transactional","otp","marketing"],"default":"transactional","description":"SMS route class for delivery optimization"},"opt_in_proof_url":{"type":["string","null"],"description":"Required when route_class=marketing.","format":"uri"}}},"description":"Up to 100 SmsSendRequest items."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/cancel/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["sms"],"operationId":"sms_cancel","summary":"Cancel a scheduled or queued SMS that has not yet been dispatched.","description":"Cancel a scheduled or queued SMS that has not yet been dispatched.","x-infrai-capability":"sms.cancel","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsCancelRequest","description":"Request shape for sms.cancel — attempt to recall a queued SMS message. Returns SmsCancelResult (cancelled=false when the message had already left).","type":"object","required":["message_id"],"additionalProperties":false,"properties":{"message_id":{"type":"string","pattern":"^sms_[A-Za-z0-9]{20,}$","description":"Id of the SMS message to cancel."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/events/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["sms"],"operationId":"sms_events","summary":"Retrieve the delivery event timeline for a single SMS message.","description":"Retrieve the delivery event timeline for a single SMS message.","x-infrai-capability":"sms.events","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/inbound/list":{"get":{"tags":["sms"],"operationId":"sms_inbound_list","summary":"List inbound (reply) SMS received on registered sender numbers, with pagination.","description":"List inbound (reply) SMS received on registered sender numbers, with pagination.","x-infrai-capability":"sms.inbound.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/otp":{"post":{"tags":["sms"],"operationId":"sms_otp","summary":"Send a one-time passcode via SMS with gateway-managed OTP lifecycle.","description":"Send a one-time passcode via SMS with gateway-managed OTP lifecycle.","x-infrai-capability":"sms.otp","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsOtpRequest","description":"Request shape for sms.otp — issue a one-time code and deliver it via the real SMS vendor. The code itself is NEVER returned; only otp_id + expiry. No usable vendor yields VENDOR_DOWN.","type":"object","required":["to"],"additionalProperties":false,"properties":{"to":{"type":"string","description":"Destination phone number (E.164).","example":"+15555550100"},"phone":{"type":["string","null"],"description":"Legacy alias for to."},"template":{"type":["string","null"],"description":"Message template containing {code}; defaults to 'Your verification code is {code}'."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/resend/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["sms"],"operationId":"sms_resend","summary":"Resend an SMS, optionally retrying only the failed recipients.","description":"Resend an SMS, optionally retrying only the failed recipients.","x-infrai-capability":"sms.resend","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsResendRequest","description":"Resend a prior message. With only_failed=true (default) only recipients still in a failed state are re-dispatched. idempotency_key guards against duplicate resends. Returns SmsSendResult for the resend batch.","type":"object","required":["message_id"],"additionalProperties":false,"properties":{"message_id":{"type":"string","pattern":"^sms_[A-Za-z0-9]{20,}$","description":"Unique identifier for this message"},"only_failed":{"type":"boolean","default":true,"description":"Re-dispatch only failed recipients; false resends the whole original recipient set."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/send":{"post":{"tags":["sms"],"operationId":"sms_send","summary":"Send an SMS message to one or more recipients (idempotent).","description":"Send an SMS message to one or more recipients (idempotent).","x-infrai-capability":"sms.send","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsSendRequest","description":"Request shape for infra.sms.send. See docs/phase2/P2_03_New_Modules.md §1.2.","type":"object","required":["to"],"additionalProperties":false,"properties":{"to":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"E.164 phone number or array of."},"body":{"type":["string","null"],"description":"Plain text body of the message"},"from":{"type":["string","null"],"description":"Sender ID / phone number; required for verified_sender mode."},"template_id":{"type":["string","null"],"description":"Identifier of the template used for rendering"},"template_vars":{"type":["object","null"],"description":"Variables to substitute in the template"},"vendor":{"type":["string","null"],"description":"Pin to a specific vendor."},"mode":{"enum":["default_vendor","verified_sender"],"default":"default_vendor","description":"Delivery mode or operation mode"},"scheduled_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp when the resource is scheduled to activate"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for categorization and filtering"},"route_class":{"enum":["transactional","otp","marketing"],"default":"transactional","description":"SMS route class for delivery optimization"},"opt_in_proof_url":{"type":["string","null"],"description":"Required when route_class=marketing.","format":"uri"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/sender/delete/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["sms"],"operationId":"sms_sender_delete","summary":"Delete a registered sender number.","description":"Delete a registered sender number.","x-infrai-capability":"sms.sender.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/sender/get/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["sms"],"operationId":"sms_sender_get","summary":"Retrieve details of a single registered sender number.","description":"Retrieve details of a single registered sender number.","x-infrai-capability":"sms.sender.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/sender/list":{"get":{"tags":["sms"],"operationId":"sms_sender_list","summary":"List registered sender numbers with pagination.","description":"List registered sender numbers with pagination.","x-infrai-capability":"sms.sender.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/sender/register":{"post":{"tags":["sms"],"operationId":"sms_sender_register","summary":"Register a sender number for verification.","description":"Register a sender number for verification.","x-infrai-capability":"sms.sender.register","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsSenderRegisterRequest","description":"Register a sender phone-number / sender-ID (10DLC / DLT / 短信签名) for verification. Returns a SenderVerification (state=pending); vendor review is then polled via sms.sender.get until state=verified.","type":"object","required":["phone_number","region"],"additionalProperties":false,"properties":{"phone_number":{"type":"string","description":"E.164 phone number or alphanumeric sender ID."},"region":{"type":"string","description":"ISO-3166-1 alpha-2 (see SmsCountryCode)."},"methods":{"type":"array","items":{"enum":["otp","voice","dns"]},"description":"Verification methods to attempt; vendor/region picks default if omitted."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/signature/create":{"post":{"tags":["sms"],"operationId":"sms_signature_create","summary":"Create an SMS signature (required for China delivery) and submit it for review.","description":"Create an SMS signature (required for China delivery) and submit it for review.","x-infrai-capability":"sms.signature.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsSignatureCreateRequest","description":"Register an SMS signature (China 签名). China vendors require a vendor-reviewed signature that prefixes every message; brand signatures need an authorization/business-license proof. review_state is polled via sms.signature.get.","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"Signature text shown as the 【签名】 prefix, e.g. 'Acme'."},"type":{"enum":["company","app","website","public_account","store","other"],"default":"company","description":"Signature scene (China vendor 签名来源)."},"proof_url":{"type":["string","null"],"description":"URL to the authorization letter / business-license image required for brand review.","format":"uri"},"remark":{"type":["string","null"],"description":"Note shown to the vendor reviewer."},"vendor":{"type":["string","null"],"description":"Pin the vendor to register at; otherwise the gateway picks per region."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/signature/delete/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["sms"],"operationId":"sms_signature_delete","summary":"Delete a registered SMS signature (China-route vendor pre-config); sends referencing it will be rejected.","description":"Delete a registered SMS signature (China-route vendor pre-config); sends referencing it will be rejected.","x-infrai-capability":"sms.signature.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/signature/get/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["sms"],"operationId":"sms_signature_get","summary":"Retrieve a single SMS signature and its review status.","description":"Retrieve a single SMS signature and its review status.","x-infrai-capability":"sms.signature.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/signature/list":{"get":{"tags":["sms"],"operationId":"sms_signature_list","summary":"List SMS signatures with pagination.","description":"List SMS signatures with pagination.","x-infrai-capability":"sms.signature.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/status/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["sms"],"operationId":"sms_status","summary":"Query the delivery status of an SMS message by ID.","description":"Query the delivery status of an SMS message by ID.","x-infrai-capability":"sms.status","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/suppression/add":{"post":{"tags":["sms"],"operationId":"sms_suppression_add","summary":"Add a phone number to the suppression (do-not-contact) list.","description":"Add a phone number to the suppression (do-not-contact) list.","x-infrai-capability":"sms.suppression.add","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsSuppressRequest","description":"Add a phone number to the suppression list (sms.suppression.add). Mirrors email.suppression.add. Returns the created SuppressionRecord.","type":"object","required":["phone"],"additionalProperties":false,"properties":{"phone":{"type":"string","description":"E.164 phone."},"reason":{"enum":["user_request","stop_reply","carrier_block","invalid","manual"],"default":"manual","description":"Reason for the current state or action"},"scope":{"enum":["account","sender"],"default":"account","description":"Scope of applicability for this resource"},"sender_scope":{"type":["string","null"],"description":"Required when scope=sender: the sender_id the suppression is bound to."},"notes":{"type":["string","null"],"description":"Free-text notes about this suppression"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/suppression/check":{"post":{"tags":["sms"],"operationId":"sms_suppression_check","summary":"Check whether a phone number is suppressed before sending.","description":"Check whether a phone number is suppressed before sending.","x-infrai-capability":"sms.suppression.check","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsSuppressionCheckRequest","description":"Look up whether a phone is suppressed (sms.suppression.check). Located by phone+scope(+sender_scope), not by record id. Returns SmsSuppressionCheckResult.","type":"object","required":["phone"],"additionalProperties":false,"properties":{"phone":{"type":"string","description":"E.164 phone."},"scope":{"enum":["account","sender"],"default":"account","description":"Scope of applicability for this resource"},"sender_scope":{"type":["string","null"],"description":"Required when scope=sender."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/suppression/delete":{"post":{"tags":["sms"],"operationId":"sms_suppression_delete","summary":"Remove a number from the suppression list to resume sending.","description":"Remove a number from the suppression list to resume sending.","x-infrai-capability":"sms.suppression.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsSuppressionDeleteRequest","description":"Remove a suppression entry (sms.suppression.delete). Located by phone+scope(+sender_scope), not by record id. Returns SmsSuppressionRemoveResult { phone, removed }.","type":"object","required":["phone"],"additionalProperties":false,"properties":{"phone":{"type":"string","description":"E.164 phone."},"scope":{"enum":["account","sender"],"default":"account","description":"Scope of applicability for this resource"},"sender_scope":{"type":["string","null"],"description":"Required when scope=sender."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/suppression/list":{"get":{"tags":["sms"],"operationId":"sms_suppression_list","summary":"List suppressed phone numbers with pagination.","description":"List suppressed phone numbers with pagination.","x-infrai-capability":"sms.suppression.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/template/create":{"post":{"tags":["sms"],"operationId":"sms_template_create","summary":"Create a reusable SMS template with named variables.","description":"Create a reusable SMS template with named variables.","x-infrai-capability":"sms.template.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsTemplateCreateRequest","description":"Register an SMS template. China vendors (Tencent/Aliyun) require template review before a +86 send can reference it; the server submits it and review_state is polled via sms.template.get. Western vendors store it as a convenience.","type":"object","required":["name","body"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"Human label for the template."},"body":{"type":"string","description":"Template text with double-brace var placeholders (Mustache-subset)."},"locale":{"type":"string","default":"en","description":"zh/cn locales trigger China-vendor review."},"variables":{"type":"array","items":{"type":"string"},"description":"Declared placeholder names; inferred from body if omitted."},"vendor":{"type":["string","null"],"description":"Pin the vendor to register at; otherwise the gateway picks per region."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/template/delete/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["sms"],"operationId":"sms_template_delete","summary":"Delete a registered SMS message template (vendor pre-config); sends referencing it will be rejected.","description":"Delete a registered SMS message template (vendor pre-config); sends referencing it will be rejected.","x-infrai-capability":"sms.template.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/sms/verify":{"post":{"tags":["sms"],"operationId":"sms_verify","summary":"Verify a user-submitted SMS one-time passcode.","description":"Verify a user-submitted SMS one-time passcode.","x-infrai-capability":"sms.verify","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SmsVerifyRequest","description":"Request shape for sms.verify — check a one-time code against an issued OTP (local; no vendor). Returns verified + reason.","type":"object","required":["to","code"],"additionalProperties":false,"properties":{"to":{"type":"string","description":"Phone number the OTP was issued to (E.164)."},"phone":{"type":["string","null"],"description":"Legacy alias for to."},"code":{"type":"string","description":"The one-time code to verify."},"otp":{"type":["string","null"],"description":"Legacy alias for code."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/bucket/create":{"post":{"tags":["storage"],"operationId":"storage_bucket_create","summary":"Create an object storage bucket. Bucket names must be 3-63 lowercase letters, digits, dots, or hyphens and start/end with a letter or digit; `region` must be a canonical region code.","description":"Create an object storage bucket. Bucket names must be 3-63 lowercase letters, digits, dots, or hyphens and start/end with a letter or digit; `region` must be a canonical region code.","x-infrai-capability":"storage.bucket.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"BucketCreateRequest","description":"Request shape for storage.bucket.create — create an object-storage bucket. Bucket names must be 3-63 lowercase letters, digits, dots, or hyphens and must start/end with a letter or digit. Region must be a canonical region code. Returns the Bucket.","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"Bucket name. Length 3-63; lowercase letters, digits, dots, and hyphens only; must start and end with a letter or digit. Example: demo-files."},"bucket":{"type":["string","null"],"description":"Alias for name. Prefer name in new integrations."},"vendor":{"type":["string","null"],"description":"Pin to a specific storage vendor."},"region":{"type":["string","null"],"enum":["us-east-1","us-west-2","eu-west-1","eu-central-1","ap-southeast-1","ap-northeast-1","cn-hangzhou","cn-beijing","auto","ap-singapore","ap-hongkong","ap-tokyo","ap-bangkok","na-siliconvalley",null],"description":"Optional storage region code. Pass a canonical code such as cn-beijing for Beijing or ap-singapore for Singapore; localized names such as 北京 are rejected."},"acl":{"type":"string","default":"private","description":"Bucket access control. Defaults to private; currently only private and signed-only are supported. public and public-read are not supported."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/bucket/delete/{bucket}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["storage"],"operationId":"storage_bucket_delete","summary":"Delete an object storage bucket (idempotent). Empty buckets can be deleted directly; non-empty buckets require `force=true`, otherwise the API returns STORAGE_DELETE_NOT_FORCED.","description":"Delete an object storage bucket (idempotent). Empty buckets can be deleted directly; non-empty buckets require `force=true`, otherwise the API returns STORAGE_DELETE_NOT_FORCED.","x-infrai-capability":"storage.bucket.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/bucket/get/{bucket}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["storage"],"operationId":"storage_bucket_get","summary":"Retrieve a bucket's metadata (provider, region, ACL, CORS, and lifecycle rules).","description":"Retrieve a bucket's metadata (provider, region, ACL, CORS, and lifecycle rules).","x-infrai-capability":"storage.bucket.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/bucket/list":{"get":{"tags":["storage"],"operationId":"storage_bucket_list","summary":"List the account's object storage buckets.","description":"List the account's object storage buckets.","x-infrai-capability":"storage.bucket.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/bucket/set_lifecycle/{bucket}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["storage"],"operationId":"storage_bucket_set_lifecycle","summary":"Set bucket lifecycle rules by key prefix; expire_days is measured in days and must be at least 1.","description":"Set bucket lifecycle rules by key prefix; expire_days is measured in days and must be at least 1.","x-infrai-capability":"storage.bucket.set_lifecycle","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"BucketSetLifecycleRequest","description":"Set lifecycle rules on a bucket for storage.bucket.set_lifecycle (POST /v1/storage/buckets/{bucket}/lifecycle). A rule matches objects by key prefix, can expire matched objects after expire_days (minimum 1 day), and may request a colder storage transition. The submitted rules replace the bucket's existing lifecycle rule set. Returns the updated Bucket. bucket is a path param.","type":"object","required":["rules"],"additionalProperties":false,"properties":{"rules":{"type":"array","items":{"title":"LifecycleRule","description":"Lifecycle rule for a storage bucket. Rules match object keys by prefix. expire_days is the retention window in days and must be at least 1 when provided. Vendor-translated.","type":"object","required":["prefix"],"additionalProperties":false,"properties":{"prefix":{"type":"string","description":"Match objects whose key starts with this.","example":"tmp/"},"expire_days":{"type":["integer","null"],"minimum":1,"description":"Auto-delete matched objects after N days. Minimum is 1 day.","example":1},"transition_class":{"type":["string","null"],"description":"Transition matched objects to a colder storage class when supported by the backend (e.g. \"glacier\")."}}},"description":"Lifecycle rule set governing object expiration/transition. Each rule supports prefix, expire_days, and transition_class. The whole list replaces the existing rule set.","example":[{"prefix":"tmp/","expire_days":1}]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/bucket/set_notification/{bucket}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["storage"],"operationId":"storage_bucket_set_notification","summary":"Subscribe storage object events to a callback URL; Infrai sends JSON POST notifications with X-Infrai-Event.","description":"Subscribe storage object events to a callback URL; Infrai sends JSON POST notifications with X-Infrai-Event.","x-infrai-capability":"storage.bucket.set_notification","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"BucketSetNotificationRequest","description":"Subscribe storage object events to a callback URL for storage.bucket.set_notification (POST /v1/storage/buckets/{bucket}/notification). Pass target.url as a public HTTPS endpoint. When a subscribed event fires, Infrai sends a JSON POST with X-Infrai-Event and event/type fields. Returns BucketSetNotificationResult. bucket is a path param.","type":"object","required":["events","target"],"additionalProperties":false,"properties":{"events":{"type":"array","items":{"type":"string","enum":["object.created","object.deleted","multipart.completed"],"description":"Webhook event names emitted by infra.storage."},"minItems":1,"description":"Event types that trigger a notification. Supported values are object.created, object.deleted, and multipart.completed.","example":["object.created","object.deleted","multipart.completed"]},"target":{"type":"object","additionalProperties":false,"oneOf":[{"required":["webhook_id"]},{"required":["url"]}],"properties":{"webhook_id":{"type":"string","description":"Advanced webhook handle for account webhook integration."},"url":{"type":"string","format":"uri","description":"Public HTTPS callback URL that receives JSON POST notifications."}},"description":"Notification callback target. For public API usage, pass target.url.","example":{"url":"https://example.com/storage-events"}},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/bucket/usage/{bucket}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["storage"],"operationId":"storage_bucket_usage","summary":"Query a bucket's usage statistics: object count, bytes stored, and measurement timestamp.","description":"Query a bucket's usage statistics: object count, bytes stored, and measurement timestamp.","x-infrai-capability":"storage.bucket.usage","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/multipart/abort/{upload_id}":{"parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["storage"],"operationId":"storage_multipart_abort","summary":"Abort a multipart upload and invalidate the upload_id.","description":"Abort a multipart upload and invalidate the upload_id.","x-infrai-capability":"storage.multipart.abort","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/multipart/complete/{upload_id}":{"parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["storage"],"operationId":"storage_multipart_complete","summary":"Complete a multipart upload, assembling parts into the final StorageObject.","description":"Complete a multipart upload, assembling parts into the final StorageObject.","x-infrai-capability":"storage.multipart.complete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"MultipartCompleteRequest","description":"Finalize a multipart upload for storage.multipart.complete (POST /v1/storage/multipart/{upload_id}/complete). Returns StorageObject. upload_id is a path param. See docs/SDK_API_PM_REVIEW.md §Storage.","type":"object","required":["parts"],"additionalProperties":false,"properties":{"parts":{"type":"array","items":{"title":"MultipartPart","description":"One part of a multipart upload.","type":"object","required":["part_number","etag"],"additionalProperties":false,"properties":{"part_number":{"type":"integer","minimum":1,"maximum":10000,"description":"Part number in the multipart upload"},"etag":{"type":"string","description":"ETag hash of the object content"},"size_bytes":{"type":["integer","null"],"minimum":0,"description":"Size of the resource in bytes"}}},"minItems":1,"maxItems":10000,"description":"Uploaded parts (part number + ETag) to assemble into the final object, in order."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/multipart/create/{bucket}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["storage"],"operationId":"storage_multipart_create","summary":"Initiate a multipart upload, returning an upload_id and part size/count limits.","description":"Initiate a multipart upload, returning an upload_id and part size/count limits.","x-infrai-capability":"storage.multipart.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"MultipartCreateRequest","description":"Start a multipart upload for storage.multipart.create (POST /v1/storage/buckets/{bucket}/multipart). Returns MultipartUpload. bucket is a path param. See docs/SDK_API_PM_REVIEW.md §Storage.","type":"object","required":["key"],"additionalProperties":false,"properties":{"key":{"type":"string","description":"Destination object key (path) for the multipart upload."},"content_type":{"type":["string","null"],"description":"MIME type of the object"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/multipart/presign_part/{upload_id}/{part_number}":{"parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"part_number","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["storage"],"operationId":"storage_multipart_presign_part","summary":"Generate a presigned upload URL for a single part; upload the part binary with the returned method.","description":"Generate a presigned upload URL for a single part; upload the part binary with the returned method.","x-infrai-capability":"storage.multipart.presign_part","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"MultipartPresignPartRequest","description":"Request shape for storage.multipart.presign_part — mint a presigned URL for uploading one part of an in-progress multipart upload. Upload the part binary with the returned method and use the returned ETag in multipart.complete.","type":"object","required":["upload_id","part_number"],"additionalProperties":false,"properties":{"upload_id":{"type":"string","description":"Id of the multipart upload."},"part_number":{"type":"integer","minimum":1,"description":"1-based index of the part being uploaded. Except for the final part, S3-compatible multipart uploads usually require each part to be at least 5 MiB."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/multipart/upload_part/{upload_id}/{part_number}":{"parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"part_number","in":"path","required":true,"schema":{"type":"string"}}],"put":{"tags":["storage"],"operationId":"storage_multipart_upload_part","summary":"Upload the bytes of a single part, returning that part's etag.","description":"Upload the bytes of a single part, returning that part's etag.","x-infrai-capability":"storage.multipart.upload_part","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"MultipartUploadPartRequest","description":"Request shape for storage.multipart.upload_part — upload one part of an in-progress multipart upload. The bytes travel base64-encoded in the JSON envelope. Returns part_number + etag + size_bytes.","type":"object","required":["upload_id","part_number","data_base64"],"additionalProperties":false,"properties":{"upload_id":{"type":"string","description":"Id of the multipart upload."},"part_number":{"type":"integer","minimum":1,"description":"1-based index of this part."},"data_base64":{"type":"string","description":"Base64-encoded part bytes (the part payload — required). Aliases data/file_base64 are also accepted by the server."},"data":{"type":["string","null"],"description":"Base64-encoded part bytes (alias of data_base64/file_base64)."},"file_base64":{"type":["string","null"],"description":"Base64-encoded part bytes (alias)."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/object/copy":{"post":{"tags":["storage"],"operationId":"storage_object_copy","summary":"Copy an object within or across buckets, preserving content_type and metadata.","description":"Copy an object within or across buckets, preserving content_type and metadata.","x-infrai-capability":"storage.object.copy","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ObjectCopyRequest","description":"Copy an object same-bucket / cross-bucket / cross-vendor for storage.object.copy (POST /v1/storage/objects/copy). Cross-vendor copies are bridged server-side via read-then-write; a missing dst bucket returns honest not-found. Returns StorageObject. See docs/SDK_API_PM_REVIEW.md §Storage.","type":"object","required":["src_bucket","src_key","dst_bucket","dst_key"],"additionalProperties":false,"properties":{"src_bucket":{"type":"string","description":"Source bucket to copy from."},"src_key":{"type":"string","description":"Source object key (path) to copy from."},"dst_bucket":{"type":"string","description":"Destination bucket to copy into."},"dst_key":{"type":"string","description":"Destination object key (path) to write."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/object/delete_batch/{bucket}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["storage"],"operationId":"storage_object_delete_batch","summary":"Delete up to 1000 objects in one call, returning deleted keys plus per-key errors.","description":"Delete up to 1000 objects in one call, returning deleted keys plus per-key errors.","x-infrai-capability":"storage.object.delete_batch","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ObjectDeleteBatchRequest","description":"Batch-delete up to 1000 objects for storage.object.delete_batch (POST /v1/storage/object/delete_batch/{bucket}). Returns deleted keys plus per-key errors; missing keys are reported as STORAGE_OBJECT_NOT_FOUND. bucket is a path param.","type":"object","required":["keys"],"additionalProperties":false,"properties":{"keys":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000,"description":"Object keys to delete in one batch. Missing keys are returned in errors with code STORAGE_OBJECT_NOT_FOUND."},"idempotency_key":{"type":["string","null"],"description":"Optional; SDK auto-derives from the content_hash of the key set when omitted."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/object/delete/{bucket}/{key}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["storage"],"operationId":"storage_object_delete","summary":"Delete a storage object (idempotent).","description":"Delete a storage object (idempotent).","x-infrai-capability":"storage.object.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/object/get/{bucket}/{key}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["storage"],"operationId":"storage_object_get","summary":"Download an object's contents as JSON metadata plus base64-encoded data_base64.","description":"Download an object's contents as JSON metadata plus base64-encoded data_base64.","x-infrai-capability":"storage.object.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/object/head/{bucket}/{key}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["storage"],"operationId":"storage_object_head","summary":"Fetch an object's existence and metadata (size, etag, content_type, metadata) without the body.","description":"Fetch an object's existence and metadata (size, etag, content_type, metadata) without the body.","x-infrai-capability":"storage.object.head","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/object/list/{bucket}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["storage"],"operationId":"storage_object_list","summary":"List objects in a bucket, supporting prefix, delimiter, and cursor pagination.","description":"List objects in a bucket, supporting prefix, delimiter, and cursor pagination.","x-infrai-capability":"storage.object.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/object/presign/{bucket}/{key}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["storage"],"operationId":"storage_object_presign","summary":"Generate a presigned URL for direct client upload or download of an object (idempotent). For `op=put`, use the returned URL with its returned method (usually PUT) to upload raw binary bytes directly; do not send the Infrai API key to the presigned URL.","description":"Generate a presigned URL for direct client upload or download of an object (idempotent). For `op=put`, use the returned URL with its returned method (usually PUT) to upload raw binary bytes directly; do not send the Infrai API key to the presigned URL.","x-infrai-capability":"storage.object.presign","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ObjectPresignRequest","description":"Generate a presigned upload/download URL for storage.object.presign (POST /v1/storage/buckets/{bucket}/objects/{key}/presign). op selects direction. For op=put, call this API first, then send the file's raw binary bytes to the returned url using the returned method (usually PUT) and any returned headers; do not include the Infrai Authorization header on the presigned URL request. expires_seconds is the canonical outward TTL (edge stays compatible with legacy ttl_seconds). bucket and key are path params. See docs/SDK_API_PM_REVIEW.md §Storage (MODIFY).","type":"object","required":["op"],"additionalProperties":false,"properties":{"op":{"enum":["get","put"],"example":"put","description":"Operation type: get creates a download URL; put creates an upload URL for direct binary upload."},"expires_seconds":{"type":["integer","null"],"minimum":1,"description":"TTL of the presigned URL (defaults: get=3600, put=300)."},"content_type":{"type":["string","null"],"description":"For op=put: constrain the upload content type."},"max_bytes":{"type":["integer","null"],"minimum":0,"description":"For op=put: cap the upload size."},"response_disposition":{"type":["string","null"],"description":"For op=get: Content-Disposition for the download filename."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/object/put/{bucket}/{key}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"put":{"tags":["storage"],"operationId":"storage_object_put","summary":"Upload an object server-side with JSON `data_base64`. Base64 upload is intended for small files and is not recommended above 1 MB; use presigned or multipart direct upload for larger files.","description":"Upload an object server-side with JSON `data_base64`. Base64 upload is intended for small files and is not recommended above 1 MB; use presigned or multipart direct upload for larger files.","x-infrai-capability":"storage.object.put","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ObjectPutRequest","description":"Server-side direct write for storage.object.put (PUT /v1/storage/object/put/{bucket}/{key}). The object bytes travel base64-encoded in the JSON data_base64 field (aliases: data / file_base64). Base64 upload is intended for small files and is not recommended above 1 MB; use object.presign or multipart.presign_part for larger files. Persistent storage writes cannot be paid by trial-only credit; if the response is 402 INSUFFICIENT_CREDIT with code_detail=trial_restricted, add paid balance and retry.","type":"object","additionalProperties":false,"required":["data_base64"],"properties":{"data_base64":{"type":"string","description":"REQUIRED. The object bytes, base64-encoded as a bare base64 string or data: URL. Intended for small files; not recommended above 1 MB."},"data":{"type":["string","null"],"description":"Alias for data_base64 (base64-encoded object bytes)."},"file_base64":{"type":["string","null"],"description":"Alias for data_base64 (base64-encoded object bytes)."},"content_type":{"type":["string","null"],"description":"MIME type of the object"},"metadata":{"type":["object","null"],"description":"Arbitrary user metadata key/value pairs."},"cache_control":{"type":["string","null"],"description":"Cache-Control header value"},"storage_class":{"type":["string","null"],"default":"standard","description":"Storage class (e.g. standard, infrequent_access)"},"idempotency_key":{"type":["string","null"],"description":"Optional; SDK auto-derives a content-hash key (bucket_id+key+content) when omitted."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/object/set_acl/{bucket}/{key}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["storage"],"operationId":"storage_object_set_acl","summary":"Set object access policy. Current supported ACL values are private and signed-only; public/public-read are not supported.","description":"Set object access policy. Current supported ACL values are private and signed-only; public/public-read are not supported.","x-infrai-capability":"storage.object.set_acl","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ObjectSetAclRequest","description":"Set a single object access policy for storage.object.set_acl. Current supported values are private and signed-only; public/public-read are rejected. Returns ObjectSetAclResult. bucket and key are path params.","type":"object","required":["acl"],"additionalProperties":false,"properties":{"acl":{"description":"Access policy. Supported values: private, signed-only. public/public-read are not supported; public_url remains null.","type":"string","enum":["private","signed-only"]},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/storage/object/set_metadata/{bucket}/{key}":{"parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["storage"],"operationId":"storage_object_set_metadata","summary":"Update a stored object's content-type, cache-control, and custom metadata; metadata replaces previous metadata.","description":"Update a stored object's content-type, cache-control, and custom metadata; metadata replaces previous metadata.","x-infrai-capability":"storage.object.set_metadata","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ObjectSetMetadataRequest","description":"Change content-type, cache-control, or custom metadata of an already stored object for storage.object.set_metadata. metadata uses replacement semantics, not merge; omitted fields preserve their existing values. Implemented as copy-to-self on S3/OSS-compatible backends. Returns StorageObject.","type":"object","additionalProperties":false,"properties":{"content_type":{"type":["string","null"],"description":"MIME type of the object"},"cache_control":{"type":["string","null"],"description":"Cache-Control header value"},"metadata":{"type":["object","null"],"description":"Custom metadata key/value pairs. Passing metadata replaces the previous metadata instead of merging with it; omit metadata to preserve the old value."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"410":{"$ref":"#/components/responses/Error410"},"413":{"$ref":"#/components/responses/Error413"},"415":{"$ref":"#/components/responses/Error415"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/vector/collection/create":{"post":{"tags":["vector"],"operationId":"vector_collection_create","summary":"Create a vector collection (namespace) for an embedding dimension and distance metric — the container for RAG vectors. Self-hosted on pgvector by default; free management.","description":"Create a vector collection (namespace) for an embedding dimension and distance metric — the container for RAG vectors. Self-hosted on pgvector by default; free management.","x-infrai-capability":"vector.collection.create","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"CollectionCreateRequest","description":"Create a vector collection (vector.collection.create) — the namespace/container for RAG vectors, fixed to one embedding dimension and distance metric.","type":"object","required":["collection","dimension"],"additionalProperties":false,"properties":{"collection":{"type":"string","description":"Collection name (unique per account)."},"dimension":{"type":"integer","minimum":1,"description":"Embedding vector dimension (e.g. 1536 for text-embedding-3-small)."},"metric":{"enum":["cosine","euclidean","dotproduct"],"default":"cosine","description":"Distance metric used for similarity search."},"metadata":{"type":["object","null"],"description":"Optional free-form collection metadata."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/vector/collection/delete":{"delete":{"tags":["vector"],"operationId":"vector_collection_delete","summary":"Delete a vector collection and all its vectors. Free management (idempotent).","description":"Delete a vector collection and all its vectors. Free management (idempotent).","x-infrai-capability":"vector.collection.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/vector/collection/get":{"get":{"tags":["vector"],"operationId":"vector_collection_get","summary":"Fetch a vector collection's configuration (dimension, metric, vector count). Free management read.","description":"Fetch a vector collection's configuration (dimension, metric, vector count). Free management read.","x-infrai-capability":"vector.collection.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/vector/collection/list":{"get":{"tags":["vector"],"operationId":"vector_collection_list","summary":"List the account's vector collections. Free management read.","description":"List the account's vector collections. Free management read.","x-infrai-capability":"vector.collection.list","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/vector/delete":{"delete":{"tags":["vector"],"operationId":"vector_delete","summary":"Delete specific vectors by id from a collection. Free management.","description":"Delete specific vectors by id from a collection. Free management.","x-infrai-capability":"vector.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/vector/query":{"post":{"tags":["vector"],"operationId":"vector_query","summary":"Run an approximate nearest-neighbor (ANN) similarity search over a collection, returning the top-k closest vectors with scores and metadata. Billable work-action.","description":"Run an approximate nearest-neighbor (ANN) similarity search over a collection, returning the top-k closest vectors with scores and metadata. Billable work-action.","x-infrai-capability":"vector.query","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"QueryRequest","description":"Similarity-search a collection (vector.query): returns the top_k nearest vectors to the query embedding, optionally filtered by metadata.","type":"object","required":["collection","embedding"],"additionalProperties":false,"properties":{"collection":{"type":"string","description":"Collection to search."},"embedding":{"type":"array","items":{"type":"number"},"description":"Query embedding; length must equal the collection dimension."},"top_k":{"type":"integer","minimum":1,"default":10,"description":"Number of nearest neighbors to return."},"filter":{"type":["object","null"],"description":"Optional metadata filter (exact-match keys, e.g. source= \"docs\")."},"include_metadata":{"type":"boolean","default":true,"description":"Include each match's stored metadata in the result."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/vector/upsert":{"post":{"tags":["vector"],"operationId":"vector_upsert","summary":"Insert or update vectors (id + embedding + metadata) into a collection. Pair ai.embed → vector.upsert for one-stop RAG ingestion. Billable work-action.","description":"Insert or update vectors (id + embedding + metadata) into a collection. Pair ai.embed → vector.upsert for one-stop RAG ingestion. Billable work-action.","x-infrai-capability":"vector.upsert","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"UpsertRequest","description":"Insert or update vectors in a collection (vector.upsert). Each item carries an id, its embedding, and optional metadata for filtered retrieval.","type":"object","required":["collection","vectors"],"additionalProperties":false,"properties":{"collection":{"type":"string","description":"Target collection name."},"vectors":{"type":"array","minItems":1,"description":"Vectors to upsert (same id overwrites).","items":{"type":"object","required":["id","embedding"],"additionalProperties":false,"properties":{"id":{"type":"string","description":"Stable vector id (your document/chunk id)."},"embedding":{"type":"array","items":{"type":"number"},"description":"Embedding values; length must equal the collection dimension."},"metadata":{"type":["object","null"],"description":"Optional metadata for query-time filtering (e.g. source= \"docs\")."}}}}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/video/cancel/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["video"],"operationId":"video_cancel","summary":"Cancel an in-progress video generation job.","description":"Cancel an in-progress video generation job.","x-infrai-capability":"video.cancel","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"VideoCancelRequest","description":"Request shape for video.cancel — cancel a running video-generation job. Returns job_id + state.","type":"object","required":["job_id"],"additionalProperties":false,"properties":{"job_id":{"type":"string","description":"Id of the video job to cancel."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/video/capabilities":{"get":{"tags":["video"],"operationId":"video_capabilities","summary":"Query each video provider's supported models, resolutions, max duration, and extend/upscale capabilities.","description":"Query each video provider's supported models, resolutions, max duration, and extend/upscale capabilities.","x-infrai-capability":"video.capabilities","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/video/delete/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["video"],"operationId":"video_delete","summary":"Delete a video job and its artifacts (idempotent write).","description":"Delete a video job and its artifacts (idempotent write).","x-infrai-capability":"video.delete","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/video/download_url/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["video"],"operationId":"video_download_url","summary":"Issue a time-limited, expiring download URL for a video job's output.","description":"Issue a time-limited, expiring download URL for a video job's output.","x-infrai-capability":"video.download_url","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/video/generate":{"post":{"tags":["video"],"operationId":"video_generate","summary":"Generate a video from a text or image prompt asynchronously (idempotent).","description":"Generate a video from a text or image prompt asynchronously (idempotent).","x-infrai-capability":"video.generate","x-infrai-idempotent":true,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"VideoGenerateRequest","description":"Request shape for ai.video.generate (mirrors ImageGenerateRequest). See docs/phase2/P2_03_New_Modules.md §8.2.","type":"object","required":["prompt"],"additionalProperties":false,"properties":{"prompt":{"type":"string","description":"Text prompt for content generation"},"model":{"type":["string","null"],"description":"Model selector. A specific video model id (e.g. 'wan-t2v'), OR a routing MODE: 'auto' (default, balanced value), 'cheapest' (lowest USD/s), 'smartest' (flagship). Null = auto."},"resolution":{"enum":["720p","1080p","4k"],"default":"720p","description":"Output resolution spec axis. Gated per-vendor. (SSOT: enums/VideoResolution)"},"duration_seconds":{"type":"integer","minimum":1,"maximum":60,"default":5,"description":"Duration of generated video in seconds"},"aspect_ratio":{"default":"16:9","description":"Aspect ratio for generated images or video (e.g. 16:9)","type":"string","enum":["16:9","9:16","1:1","4:3","3:4","21:9"]},"seed":{"type":["integer","null"],"description":"Random seed for deterministic generation"},"negative_prompt":{"type":["string","null"],"description":"Negative prompt for excluding unwanted content"},"reference_image":{"type":["string","null"],"description":"URL or base64 for image-to-video."},"vendor":{"type":["string","null"],"description":"Vendor that handled or will handle this request"},"webhook_url":{"type":["string","null"],"format":"uri","description":"Optional callback URL; declares an async delivery target at submit time (events from VideoEventType). Equivalent to a video.webhook.subscribe for this job."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"store":{"type":"boolean","default":false,"description":"Opt in to RETAIN the produced asset/record in Infrai's own store (default false = stateless passthrough: process, return inline, keep nothing). When true, Infrai persists the asset, bills a self-hosted storage line item and applies a retention TTL — and only then do the *.list/get/delete read caps see it."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/video/get/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["video"],"operationId":"video_get","summary":"Retrieve a video job's full details (status, video URL, duration, resolution, provider, model).","description":"Retrieve a video job's full details (status, video URL, duration, resolution, provider, model).","x-infrai-capability":"video.get","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/video/status/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["video"],"operationId":"video_status","summary":"Query a video generation job's status and output URL.","description":"Query a video generation job's status and output URL.","x-infrai-capability":"video.status","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/web/scrape":{"post":{"tags":["web"],"operationId":"web_scrape","summary":"Fetch and read a single web page, returning clean text/markdown for an LLM to summarize. Read-only and honors robots.txt — no crawl, no paywall bypass. Vendor-backed (Firecrawl). Billable work-action.","description":"Fetch and read a single web page, returning clean text/markdown for an LLM to summarize. Read-only and honors robots.txt — no crawl, no paywall bypass. Vendor-backed (Firecrawl). Billable work-action.","x-infrai-capability":"web.scrape","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"ScrapeRequest","description":"Scrape a web page (web.scrape): fetch a URL and return its content as clean markdown or plain text. Read-only; honors robots.txt (a blocked page surfaces WEB_BLOCKED_BY_ROBOTS, never bypassed).","type":"object","required":["url"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","description":"Page URL to scrape (http/https)."},"format":{"enum":["markdown","text"],"default":"markdown","description":"Output content format."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}},"/web/search":{"post":{"tags":["web"],"operationId":"web_search","summary":"Search the live web and return ranked results (title, url, snippet) optimized for LLM grounding — adds real-time knowledge to an AI app. Vendor-backed (Tavily). Billable work-action.","description":"Search the live web and return ranked results (title, url, snippet) optimized for LLM grounding — adds real-time knowledge to an AI app. Vendor-backed (Tavily). Billable work-action.","x-infrai-capability":"web.search","x-infrai-idempotent":false,"x-infrai-regions":["western","china"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"SearchRequest","description":"Web search (web.search): query the live web and get ranked results with title, url, and snippet — the standard agent/RAG search tool call.","type":"object","required":["query"],"additionalProperties":false,"properties":{"query":{"type":"string","description":"Search query in natural language or keywords."},"max_results":{"type":"integer","minimum":1,"maximum":20,"default":5,"description":"Maximum number of results to return."},"include_domains":{"type":["array","null"],"items":{"type":"string"},"description":"Restrict results to these domains (e.g. [\"docs.python.org\"])."},"exclude_domains":{"type":["array","null"],"items":{"type":"string"},"description":"Exclude results from these domains."}}}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"},"504":{"$ref":"#/components/responses/Error504"},"default":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"ifr_*","description":"Project API key forwarded as Authorization: Bearer."}},"responses":{"Result":{"description":"Result envelope (ok=true).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error":{"description":"Result envelope (ok=false). Carries a SSOT error code, human_hint, and retryable flag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error400":{"description":"Bad request — INVALID_ARGUMENT and other client-input errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error401":{"description":"Unauthorized — missing/invalid/revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error402":{"description":"Payment required — INSUFFICIENT_CREDIT / wallet errors (carries checkout_url).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error403":{"description":"Forbidden — scope/KYC/account-state restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error404":{"description":"Not found — referenced resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error409":{"description":"Conflict — idempotency-key conflict or resource-state conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error410":{"description":"Gone — resource expired/retired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error413":{"description":"Payload too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error422":{"description":"Unprocessable entity — semantic validation failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error429":{"description":"Too many requests — rate limited (carries retry backoff).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error500":{"description":"Internal error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error502":{"description":"Bad gateway — upstream vendor error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error503":{"description":"Service unavailable — maintenance / no healthy vendor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"Error504":{"description":"Gateway timeout — upstream vendor timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}}},"schemas":{"Result":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"},"data":{"type":["object","array","null"],"description":"Business payload (module-specific)."},"error":{"$ref":"#/components/schemas/Error"},"metadata":{"$ref":"#/components/schemas/ResultMetadata"}}},"ResultMetadata":{"type":"object","description":"Agent decision metadata returned on every call.","properties":{"request_id":{"type":"string"},"cost_usd":{"type":"number"},"latency_ms":{"type":"integer"},"vendor":{"type":"string"},"cache_hit":{"type":"boolean"},"sla_tier":{"type":"string"}}},"Error":{"type":"object","required":["code","http_status","message"],"properties":{"code":{"type":"string","description":"SSOT error code from infrai-spec/errors/registry.yaml."},"http_status":{"type":"integer"},"message":{"type":"string"},"human_hint":{"type":"string"},"docs_url":{"type":"string","format":"uri"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}},"OpenAIInfraiMetadata":{"type":"object","description":"Infrai extension added to OpenAI-compatible JSON responses. Binary audio responses expose the same metadata through X-Infrai-* headers.","properties":{"cost_usd":{"type":"number"},"vendor":{"type":"string"},"region":{"type":"string"},"model":{"type":"string"},"markup_pct":{"type":"number"},"request_id":{"type":"string"},"trace_id":{"type":"string"},"cache":{"type":"boolean"},"idempotent_replay":{"type":"boolean"},"failover_info":{"type":"object","additionalProperties":true}},"additionalProperties":true},"OpenAIErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"additionalProperties":true}},"additionalProperties":true},"OpenAIObjectWithInfrai":{"type":"object","required":["infrai"],"properties":{"infrai":{"$ref":"#/components/schemas/OpenAIInfraiMetadata"}},"additionalProperties":true},"OpenAIChatCompletion":{"type":"object","required":["id","object","created","model","choices","usage","infrai"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"chat.completion"},"created":{"type":"integer"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","required":["index","message","finish_reason"],"properties":{"index":{"type":"integer"},"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":["string","null"]},"tool_calls":{"type":"array","items":{"type":"object","additionalProperties":true}}},"additionalProperties":true},"finish_reason":{"type":["string","null"]}},"additionalProperties":true}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}},"additionalProperties":true},"infrai":{"$ref":"#/components/schemas/OpenAIInfraiMetadata"}},"additionalProperties":true},"OpenAIEmbeddingList":{"type":"object","required":["object","data","model","usage","infrai"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","required":["object","index","embedding"],"properties":{"object":{"type":"string","const":"embedding"},"index":{"type":"integer"},"embedding":{"type":"array","items":{"type":"number"}}},"additionalProperties":true}},"model":{"type":"string"},"usage":{"type":"object","additionalProperties":true},"infrai":{"$ref":"#/components/schemas/OpenAIInfraiMetadata"}},"additionalProperties":true},"OpenAIImageGeneration":{"type":"object","required":["created","data","infrai"],"properties":{"created":{"type":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"b64_json":{"type":"string"},"revised_prompt":{"type":"string"}},"additionalProperties":true}},"infrai":{"$ref":"#/components/schemas/OpenAIInfraiMetadata"}},"additionalProperties":true},"OpenAIModeration":{"type":"object","required":["id","model","results","infrai"],"properties":{"id":{"type":"string"},"model":{"type":"string"},"results":{"type":"array","items":{"type":"object","required":["flagged","categories","category_scores"],"properties":{"flagged":{"type":"boolean"},"categories":{"type":"object","additionalProperties":{"type":"boolean"}},"category_scores":{"type":"object","additionalProperties":{"type":"number"}}},"additionalProperties":true}},"infrai":{"$ref":"#/components/schemas/OpenAIInfraiMetadata"}},"additionalProperties":true},"OpenAITranscription":{"oneOf":[{"type":"object","required":["text","infrai"],"properties":{"text":{"type":"string"},"infrai":{"$ref":"#/components/schemas/OpenAIInfraiMetadata"}},"additionalProperties":true},{"type":"string","description":"Plain text response when response_format=text."}]},"OpenAIModel":{"type":"object","required":["id","object","created","owned_by"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"model"},"created":{"type":"integer"},"owned_by":{"type":"string"},"infrai":{"type":"object","additionalProperties":true}},"additionalProperties":true},"OpenAIModelList":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/OpenAIModel"}}},"additionalProperties":true}}},"x-infrai":{"source":"infrai-spec/discovery/manifest.json","generator":"web/console/scripts/gen-openapi.mjs","manifest_version":"v1","ga_module_count":14,"capabilities_total":294,"capabilities_with_request_schema":179,"phase3_candidates":{"modules":["deploy","db","auth"],"status":"archived 2026-05-24 (R9); NOT in this spec"},"_note":"Generated from the public discovery manifest. Capabilities without a published request schema in infrai-spec document an honest free-form body — properties are NOT invented to fill the spec."}}
