Download OpenAPI specification:
{- "code": 0,
- "message": "success",
- "data": {
- "registration_enabled": true,
- "email_verify_enabled": true,
- "force_email_on_third_party_signup": true,
- "registration_email_suffix_whitelist": [
- "string"
], - "promo_code_enabled": true,
- "password_reset_enabled": true,
- "invitation_code_enabled": true,
- "turnstile_enabled": true,
- "passkey_enabled": true,
- "turnstile_site_key": "string",
- "site_name": "string",
- "site_logo": "string",
- "site_subtitle": "string",
- "api_base_url": "string",
- "contact_info": "string",
- "doc_url": "string",
- "home_content": "string",
- "compact_home_enabled": true,
- "hide_ccs_import_button": true,
- "payment_enabled": true,
- "risk_control_enabled": true,
- "table_default_page_size": 1,
- "table_page_size_options": [
- 1
], - "custom_menu_items": [
- { }
], - "custom_endpoints": [
- { }
], - "linuxdo_oauth_enabled": true,
- "wechat_oauth_enabled": true,
- "oidc_oauth_enabled": true,
- "oidc_oauth_provider_name": "string",
- "github_oauth_enabled": true,
- "google_oauth_enabled": true,
- "dingtalk_oauth_enabled": true,
- "backend_mode_enabled": true,
- "version": "string",
- "server_timezone": "string",
- "server_utc_offset": "string",
- "balance_low_notify_enabled": true,
- "account_quota_notify_enabled": true,
- "balance_low_notify_threshold": 0,
- "channel_monitor_enabled": true,
- "channel_monitor_default_interval_seconds": 1,
- "available_channels_enabled": true,
- "model_plaza_enabled": true,
- "model_plaza_require_auth": true,
- "service_quota_enabled": true,
- "affiliate_enabled": true
}
}{- "code": 0,
- "message": "success",
- "data": {
- "site_name": "string",
- "logo_url": "string",
- "docs_base_url": "string",
- "support_email": "user@example.com",
- "default_locale": "zh-CN",
- "locales": [
- "zh-CN"
], - "registration_enabled": true,
- "invitation_code_required": true,
- "password_reset_enabled": true,
- "passkey_enabled": true,
- "turnstile_enabled": true,
- "turnstile_site_key": "string",
- "oauth_providers": [
- {
- "id": "google",
- "display_name": "string"
}
], - "legal": {
- "terms_version": "string",
- "privacy_version": "string"
}, - "consent_required": true,
- "trial_enabled": true
}
}{- "code": 0,
- "message": "success",
- "data": {
- "items": [
- {
- "id": "123",
- "code": "string",
- "name": "string",
- "kind": "subscription",
- "plan_versions": [
- {
- "id": "123",
- "period": "one_time",
- "price": "9.99",
- "currency": "string",
- "tax_display_rule": "string",
- "credits_grant": "123.45678900",
- "allowed_models": [
- "string"
], - "context_limit": 0,
- "rpm_limit": 0,
- "tpm_limit": 0,
- "concurrency": 0,
- "allows_top_up": true,
- "overage_behavior": "reject",
- "credits_rollover": true,
- "credits_expire_days": 1
}
]
}
], - "as_of": "2026-08-28T09:30:00Z"
}
}{- "code": 0,
- "message": "success",
- "data": {
- "credit_face_value_usd": "20.0000000000",
- "rates_effective_at": "2026-08-28T09:30:00Z",
- "items": [
- {
- "id": "string",
- "display_name": "string",
- "family": "string",
- "description": "string",
- "capabilities": [
- "chat"
], - "input_modalities": [
- "text"
], - "output_modalities": [
- "text"
], - "context_window": 1,
- "max_output_tokens": 1,
- "protocols": [
- "openai_chat_completions"
], - "supports_streaming": true,
- "status": "available",
- "sunset_at": "2026-08-28T09:30:00Z",
- "replacement_model_id": "string",
- "rates": {
- "tokens_per_1m": "20.0000000000",
- "per_image": "20.0000000000",
- "per_video_second": "20.0000000000",
- "per_request": "20.0000000000"
}
}
]
}
}| page | integer >= 1 Default: 1 |
| page_size | integer [ 1 .. 50 ] Default: 20 |
| category | string (AnnouncementCategory) Enum: "incident" "maintenance" "product" "models_pricing" "policy" "security" |
{- "code": 0,
- "message": "success",
- "data": {
- "items": [
- {
- "id": "123",
- "title": "string",
- "body": "string",
- "category": "incident",
- "severity": "info",
- "impact_summary": "string",
- "incident_status": "investigating",
- "published_at": "2026-08-28T09:30:00Z",
- "effective_from": "2026-08-28T09:30:00Z",
- "effective_until": "2026-08-28T09:30:00Z",
- "updated_at": "2026-08-28T09:30:00Z",
- "updates": [
- {
- "at": "2026-08-28T09:30:00Z",
- "incident_status": "investigating",
- "body": "string"
}
]
}
], - "page": 1,
- "page_size": 1,
- "total": 0
}
}{- "code": 0,
- "message": "success",
- "data": {
- "id": "123",
- "title": "string",
- "body": "string",
- "category": "incident",
- "severity": "info",
- "impact_summary": "string",
- "incident_status": "investigating",
- "published_at": "2026-08-28T09:30:00Z",
- "effective_from": "2026-08-28T09:30:00Z",
- "effective_until": "2026-08-28T09:30:00Z",
- "updated_at": "2026-08-28T09:30:00Z",
- "updates": [
- {
- "at": "2026-08-28T09:30:00Z",
- "incident_status": "investigating",
- "body": "string"
}
]
}
}Accepts at most twenty first-party events; a valid optional Portal bearer may be associated server-side.
| anonymous_id required | string <uuid> |
required | Array of objects (AnalyticsEvent) [ 1 .. 20 ] items |
{- "anonymous_id": "78bfd8f4-0835-4508-bd6f-f3c3f9338522",
- "events": [
- {
- "name": "page_view",
- "occurred_at": "2026-08-28T09:30:00Z",
- "path_template": "string",
- "locale": "string",
- "props": { }
}
]
}{- "code": 10001,
- "message": "string",
- "data": {
- "code": 0,
- "message": "string",
- "detail": { },
- "field_errors": {
- "property1": "string",
- "property2": "string"
}
}, - "detail": { }
}Authenticates an App server and issues a short-lived opaque token for a pseudonymous external user.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| external_user_id required | string^[A-Za-z0-9_\-:.]{1,128}$ |
| requested_capabilities | Array of strings |
{- "external_user_id": "string",
- "requested_capabilities": [
- "string"
]
}{- "code": 0,
- "message": "success",
- "data": {
- "access_token": "string",
- "token_type": "bearer",
- "expires_in": 300,
- "app_user_id": "123",
- "store_account_token": "3e49f902-87c8-4ca1-938e-68f925f988c7"
}
}Idempotently revokes all Embedded access tokens for one pseudonymous user in the authenticated App.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| external_user_id required | string^[A-Za-z0-9_\-:.]{1,128}$ |
{- "external_user_id": "string"
}{- "code": 0,
- "message": "success",
- "data": null
}Returns active products for the authenticated Application with currently visible published immutable PlanVersion snapshots.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
{- "code": 0,
- "message": "success",
- "data": {
- "items": [
- {
- "id": "123",
- "code": "string",
- "name": "string",
- "kind": "subscription",
- "plan_versions": [
- {
- "id": "123",
- "period": "one_time",
- "price": "9.99",
- "currency": "string",
- "tax_display_rule": "string",
- "credits_grant": "123.45678900",
- "allowed_models": [
- "string"
], - "context_limit": 0,
- "rpm_limit": 0,
- "tpm_limit": 0,
- "concurrency": 0,
- "allows_top_up": true,
- "overage_behavior": "reject",
- "credits_rollover": true,
- "credits_expire_days": 1
}
]
}
], - "page": 1,
- "page_size": 1,
- "total": 0
}
}Returns entitlement snapshots effective for the authenticated AppUser at request time.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
{- "code": 0,
- "message": "success",
- "data": {
- "items": [
- {
- "id": "123",
- "subject_scope": "embedded_app",
- "subject_id": "123",
- "application_id": "123",
- "effective_from": "2026-08-28T09:30:00Z",
- "effective_until": "2026-08-28T09:30:00Z",
- "allowed_models": [
- "string"
], - "capabilities": [
- "string"
], - "rpm_limit": 0,
- "tpm_limit": 0,
- "concurrency": 0,
- "period_credits_grant": "123.45678900",
- "grant_cadence": "one_time",
- "source_subscription_id": "123",
- "source_order_no": "string",
- "plan_version_id": "123"
}
]
}
}Returns the authenticated AppUser's customer-safe ledger-derived wallet and expiry totals from one tenant-scoped database snapshot.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
{- "code": 0,
- "message": "success",
- "data": {
- "currency_unit": "credits",
- "balance": "123.45678900",
- "frozen": "123.45678900",
- "available": "123.45678900",
- "expiring_7d": "123.45678900",
- "expiring_30d": "123.45678900",
- "next_expiry_at": "2026-08-28T09:30:00Z",
- "amount_owed": "123.45678900",
- "as_of": "2026-08-28T09:30:00Z",
- "estimated": true
}
}Returns a signed-cursor page of customer-safe transactions for the authenticated AppUser in the account timezone.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| cursor | string |
| limit | integer [ 1 .. 100 ] Default: 50 |
| type | string (CustomerTransactionType) Enum: "purchase" "subscription_grant" "promotion" "usage" "refund_clawback" "chargeback" "expiration" "adjustment" "statement_correction" |
| from | string <date> (Date) Example: from=2026-08-28 Inclusive account-timezone date. |
| to | string <date> (Date) Example: to=2026-08-28 Inclusive account-timezone date. |
| order_no | string [ 1 .. 128 ] characters |
{- "code": 0,
- "message": "success",
- "data": {
- "items": [
- {
- "id": "string",
- "type": "purchase",
- "direction": "in",
- "amount_credits": "123.45678900",
- "balance_after": "123.45678900",
- "occurred_at": "2026-08-28T09:30:00Z",
- "started_at": "2026-08-28T09:30:00Z",
- "usage_date": "2026-08-28",
- "request_count": 1,
- "in_progress": true,
- "order_no": "string",
- "statement_id": "123",
- "plan_name": "string",
- "promotion_name": "string",
- "customer_note": "string"
}
], - "next_cursor": "string",
- "has_more": true,
- "timezone": "string"
}
}Returns final AI request facts owned by the authenticated AppUser within the token Application scope.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| cursor | string |
| limit | integer [ 1 .. 200 ] Default: 50 |
{- "code": 0,
- "message": "success",
- "data": {
- "items": [
- {
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "api_key_id": "123",
- "api_key_name": "string",
- "api_key_prefix": "string",
- "model": "string",
- "stream": true,
- "status": "succeeded",
- "started_at": "2026-08-28T09:30:00Z",
- "ended_at": "2026-08-28T09:30:00Z",
- "duration_ms": 0,
- "first_token_ms": 0,
- "input_tokens": 0,
- "output_tokens": 0,
- "cache_read_tokens": 0,
- "cache_write_tokens": 0,
- "image_count": 0,
- "video_seconds": 0,
- "credits_cost": "123.45678900",
- "error_code": "invalid_request_error"
}
], - "next_cursor": "string",
- "has_more": true
}
}Returns app_web orders owned by the authenticated AppUser within the token Application scope.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| page | integer >= 1 Default: 1 |
| page_size | integer [ 1 .. 100 ] Default: 20 |
{- "code": 0,
- "message": "success",
- "data": {
- "items": [
- {
- "order_no": "string",
- "sales_channel": "direct_web",
- "status": "created",
- "items": [
- {
- "plan_version_id": "123",
- "name": "string",
- "qty": 1,
- "unit_price": "9.99",
- "credits_grant": "123.45678900",
- "kind": "subscription"
}
], - "list_amount": "9.99",
- "discount_amount": "9.99",
- "tax_amount": "9.99",
- "payable_amount": "9.99",
- "paid_amount": "9.99",
- "currency": "string",
- "payment_provider": "string",
- "promo_code": "string",
- "grant": {
- "status": "pending",
- "credits_granted": "123.45678900",
- "plan_period_start": "2026-08-28T09:30:00Z",
- "plan_period_end": "2026-08-28T09:30:00Z"
}, - "refunds": [
- {
- "id": "123",
- "amount": "9.99",
- "credits_clawback": "123.45678900",
- "reason": "string",
- "status": "requested",
- "created_at": "2026-08-28T09:30:00Z"
}
], - "timeline": [
- {
- "event": "created",
- "at": "2026-08-28T09:30:00Z"
}
], - "can_cancel": true,
- "can_request_refund": true,
- "refund_block_reason": "not_paid",
- "created_at": "2026-08-28T09:30:00Z",
- "paid_at": "2026-08-28T09:30:00Z"
}
], - "page": 1,
- "page_size": 1,
- "total": 0
}
}Creates an idempotent AppUser Web checkout for one published Application plan; the returned provider intent is not proof of payment.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| Idempotency-Key required | string [ 1 .. 255 ] characters |
| plan_version_id required | string (ID) ^[0-9]+$ |
| quantity required | integer [ 1 .. 100 ] Default: 1 |
| promotion_code | string |
| payment_provider | string |
{- "plan_version_id": "123",
- "quantity": 1,
- "promotion_code": "string",
- "payment_provider": "string"
}{- "code": 0,
- "message": "success",
- "data": {
- "order_no": "string",
- "payment_provider": "string",
- "mode": "redirect",
- "qr_code": "string",
- "expires_at": "2026-08-28T09:30:00Z"
}
}Returns persisted personal statement snapshots owned by the authenticated AppUser within the token Application scope, newest period first.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| page | integer >= 1 Default: 1 |
| page_size | integer [ 1 .. 100 ] Default: 20 |
| status | string Enum: "draft" "reconciling" "finalized" "adjusted" |
{- "code": 0,
- "message": "success",
- "data": {
- "items": [
- {
- "id": "123",
- "subject_scope": "string",
- "subject_id": "123",
- "application_id": "123",
- "period_start": "2026-08-28T09:30:00Z",
- "period_end": "2026-08-28T09:30:00Z",
- "opening_balance": "123.45678900",
- "closing_balance": "123.45678900",
- "granted": "123.45678900",
- "consumed": "123.45678900",
- "released": "123.45678900",
- "refunded": "123.45678900",
- "expired": "123.45678900",
- "adjusted": "123.45678900",
- "status": "draft",
- "items": [
- {
- "kind": "string",
- "ref": "string",
- "amount_credits": "123.45678900",
- "amount_usd": "9.99",
- "is_opening_adjustment": true,
- "source_period": "string"
}
], - "as_of": "2026-08-28T09:30:00Z",
- "estimated": true,
- "staleness_reason": "string"
}
], - "page": 1,
- "page_size": 1,
- "total": 0
}
}Lists tickets owned by the authenticated AppUser in the token Application; message bodies are detail-only.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| page | integer >= 1 Default: 1 |
| page_size | integer [ 1 .. 100 ] Default: 20 |
| search | string <= 200 characters |
| status | string Enum: "new" "open" "pending_user" "pending_internal" "resolved" "closed" |
| category | string Enum: "account" "purchase" "billing" "api" "refund" "other" |
{- "code": 0,
- "message": "success",
- "data": {
- "items": [
- {
- "id": "123",
- "category": "account",
- "status": "new",
- "subject": "string",
- "refs": {
- "order_no": "string",
- "statement_id": "123",
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846"
}, - "created_at": "2026-08-28T09:30:00Z",
- "updated_at": "2026-08-28T09:30:00Z"
}
], - "page": 1,
- "page_size": 1,
- "total": 0
}
}Atomically creates an Application-scoped AppUser ticket and its initial customer-visible message.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| category required | string Enum: "account" "purchase" "billing" "api" "refund" "other" |
| subject required | string [ 1 .. 200 ] characters |
| message required | string [ 1 .. 10000 ] characters |
object (TicketRefs) |
{- "category": "account",
- "subject": "string",
- "message": "string",
- "refs": {
- "order_no": "string",
- "statement_id": "123",
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846"
}
}{- "code": 0,
- "message": "success",
- "data": {
- "id": "123",
- "category": "account",
- "status": "new",
- "subject": "string",
- "refs": {
- "order_no": "string",
- "statement_id": "123",
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846"
}, - "created_at": "2026-08-28T09:30:00Z",
- "updated_at": "2026-08-28T09:30:00Z",
- "messages": [
- {
- "id": "123",
- "author_type": "customer",
- "body": "string",
- "created_at": "2026-08-28T09:30:00Z"
}
], - "events": [
- {
- "type": "created",
- "status": "new",
- "at": "2026-08-28T09:30:00Z"
}
], - "can_reply": true,
- "can_reopen": true,
- "reopen_deadline": "2026-08-28T09:30:00Z"
}
}Returns one AppUser-owned ticket and only customer-visible messages from the token Application.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| id required | string (ID) ^[0-9]+$ Example: 123 |
{- "code": 0,
- "message": "success",
- "data": {
- "id": "123",
- "category": "account",
- "status": "new",
- "subject": "string",
- "refs": {
- "order_no": "string",
- "statement_id": "123",
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846"
}, - "created_at": "2026-08-28T09:30:00Z",
- "updated_at": "2026-08-28T09:30:00Z",
- "messages": [
- {
- "id": "123",
- "author_type": "customer",
- "body": "string",
- "created_at": "2026-08-28T09:30:00Z"
}
], - "events": [
- {
- "type": "created",
- "status": "new",
- "at": "2026-08-28T09:30:00Z"
}
], - "can_reply": true,
- "can_reopen": true,
- "reopen_deadline": "2026-08-28T09:30:00Z"
}
}Adds an AppUser-visible reply in the token Application; resolved and closed tickets are read-only.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| id required | string (ID) ^[0-9]+$ Example: 123 |
| message required | string [ 1 .. 10000 ] characters |
{- "message": "string"
}{- "code": 0,
- "message": "success",
- "data": {
- "id": "123",
- "category": "account",
- "status": "new",
- "subject": "string",
- "refs": {
- "order_no": "string",
- "statement_id": "123",
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846"
}, - "created_at": "2026-08-28T09:30:00Z",
- "updated_at": "2026-08-28T09:30:00Z",
- "messages": [
- {
- "id": "123",
- "author_type": "customer",
- "body": "string",
- "created_at": "2026-08-28T09:30:00Z"
}
], - "events": [
- {
- "type": "created",
- "status": "new",
- "at": "2026-08-28T09:30:00Z"
}
], - "can_reply": true,
- "can_reopen": true,
- "reopen_deadline": "2026-08-28T09:30:00Z"
}
}Reopens an AppUser-owned resolved ticket through seven days after its latest resolution.
| app required | string^[a-z0-9][a-z0-9_-]{1,63}$ |
| id required | string (ID) ^[0-9]+$ Example: 123 |
{- "code": 0,
- "message": "success",
- "data": {
- "id": "123",
- "category": "account",
- "status": "new",
- "subject": "string",
- "refs": {
- "order_no": "string",
- "statement_id": "123",
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846"
}, - "created_at": "2026-08-28T09:30:00Z",
- "updated_at": "2026-08-28T09:30:00Z",
- "messages": [
- {
- "id": "123",
- "author_type": "customer",
- "body": "string",
- "created_at": "2026-08-28T09:30:00Z"
}
], - "events": [
- {
- "type": "created",
- "status": "new",
- "at": "2026-08-28T09:30:00Z"
}
], - "can_reply": true,
- "can_reopen": true,
- "reopen_deadline": "2026-08-28T09:30:00Z"
}
}| X-Request-Id | string <uuid> |
| Idempotency-Key | string [ 1 .. 255 ] characters |
| property name* additional property | any |
{ }{ }OpenAI-compatible Responses API with Direct and Embedded Credits billing.
HTTP requests containing previous_response_id are rejected; durable
response chaining is reserved for the future WebSocket v2 transport.
| X-Request-Id | string <uuid> |
| Idempotency-Key | string [ 1 .. 255 ] characters |
| model required | string non-empty |
| stream | boolean Default: false |
| input | any |
| property name* additional property | any |
{- "model": "string",
- "stream": false,
- "input": null
}{ }| X-Request-Id | string <uuid> |
| Idempotency-Key | string [ 1 .. 255 ] characters |
| property name* additional property | any |
{ }{ }| model required | string |
| action required | string Enum: "generateContent" "streamGenerateContent" "countTokens" |
| X-Request-Id | string <uuid> |
| Idempotency-Key | string [ 1 .. 255 ] characters |
| property name* additional property | any |
{ }{ }JSON OpenAI-compatible image generation. Multipart edits and streaming image events are not supported by this operation.
| X-Request-Id | string <uuid> |
| Idempotency-Key | string [ 1 .. 255 ] characters |
| model required | string non-empty |
| prompt required | string non-empty |
| n | integer [ 1 .. 10 ] Default: 1 |
| size | string |
| quality | string |
| response_format | string Enum: "url" "b64_json" |
| stream | boolean Default: false Value: false |
| property name* additional property | any |
{- "model": "string",
- "prompt": "string",
- "n": 1,
- "size": "string",
- "quality": "string",
- "response_format": "url",
- "stream": false
}{ }| X-Request-Id | string <uuid> |
| Idempotency-Key | string [ 1 .. 255 ] characters |
| property name* additional property | any |
{ }{ }{- "object": "credit_usage",
- "application_id": "123",
- "subject_scope": "direct_api",
- "subject_id": "123",
- "aggregation_scope": "api_key",
- "today": {
- "requests": 0,
- "succeeded_requests": 0,
- "failed_requests": 0,
- "pending_requests": 0,
- "settled_requests": 0,
- "input_tokens": 0,
- "output_tokens": 0,
- "cache_read_tokens": 0,
- "cache_write_tokens": 0,
- "credits_cost": "123.45678900"
}, - "total": {
- "requests": 0,
- "succeeded_requests": 0,
- "failed_requests": 0,
- "pending_requests": 0,
- "settled_requests": 0,
- "input_tokens": 0,
- "output_tokens": 0,
- "cache_read_tokens": 0,
- "cache_write_tokens": 0,
- "credits_cost": "123.45678900"
}, - "currency_unit": "CREDITS",
- "as_of": "2026-08-28T09:30:00Z"
}{- "object": "credit_balance",
- "application_id": "123",
- "subject_scope": "direct_api",
- "subject_id": "123",
- "balance": "123.45678900",
- "frozen": "123.45678900",
- "available": "123.45678900",
- "currency_unit": "CREDITS",
- "as_of": "2026-08-28T09:30:00Z"
}