# Generated public contract; edit the source and localization catalog.
openapi: 3.1.0
jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema
info:
  title: OrbitSpace 模型与用量 API
  version: 1.0.0
  description: 模型与用量的公开 v1 应用接口契约。协议生命周期与能力可用状态见集成指南。
servers:
  - url: https://api.orbitspace.dev
security:
  - bearerAuth: []
paths:
  /api/v1/artifact-deliveries:report:
    post:
      tags:
        - UsageService
      operationId: UsageService_ReportExternalArtifactDeliveries
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReportExternalArtifactDeliveriesRequest"
        required: true
        description: 报告外部产物交付记录的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReportExternalArtifactDeliveriesResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 报告外部产物交付记录
      description: 报告外部产物交付记录。 请求字段应遵循下方的 Schema。
  /api/v1/model-allocations:
    get:
      tags:
        - ModelAllocationService
      operationId: ModelAllocationService_ListModelAllocations
      parameters:
        - name: tenant_id
          in: query
          description: 租户 API 根据已认证主体派生该字段；平台操作显式选择租户，并要求平台权限。
          schema:
            type: string
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
        - name: status
          in: query
          schema:
            type: string
          description: 状态。
        - name: search
          in: query
          schema:
            type: string
          description: 搜索。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListModelAllocationsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出模型配额分配
      description: 列出模型配额分配。 如需继续读取结果，请使用接口声明的分页参数。
  /api/v1/model-allocations/{id}:
    get:
      tags:
        - ModelAllocationService
      operationId: ModelAllocationService_GetModelAllocation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        - name: tenant_id
          in: query
          schema:
            type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ModelAllocation"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取模型配额分配
      description: 读取模型配额分配。
  /api/v1/model-allocations/{id}:mutate:
    post:
      tags:
        - ModelAllocationService
      operationId: ModelAllocationService_MutateModelAllocation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MutateModelAllocationRequest"
        required: true
        description: 变更模型配额分配的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ModelAllocation"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 变更模型配额分配
      description: 变更模型配额分配。 请求字段应遵循下方的 Schema。
  /api/v1/model-allocations:publish:
    post:
      tags:
        - ModelAllocationService
      operationId: ModelAllocationService_PublishModelAllocation
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PublishModelAllocationRequest"
        required: true
        description: 发布模型配额分配的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ModelAllocation"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 发布模型配额分配
      description: 发布模型配额分配。 请求字段应遵循下方的 Schema。
  /api/v1/usage/goals/{id}/model-financials:
    get:
      tags:
        - UsageService
      operationId: UsageService_GetGoalModelFinancials
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GoalModelFinancials"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取目标模型费用
      description: 读取目标模型费用。
  /api/v1/usage/invoice-exports:
    get:
      tags:
        - UsageService
      operationId: UsageService_ListInvoiceExports
      parameters:
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListInvoiceExportsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出账单导出
      description: 列出账单导出。 如需继续读取结果，请使用接口声明的分页参数。
    post:
      tags:
        - UsageService
      operationId: UsageService_CreateInvoiceExport
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateInvoiceExportRequest"
        required: true
        description: 创建账单导出的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvoiceExport"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 创建账单导出
      description: 创建账单导出。 请求字段应遵循下方的 Schema。
  /api/v1/usage/invoice-exports/{invoice_export_id}:
    get:
      tags:
        - UsageService
      operationId: UsageService_GetInvoiceExport
      parameters:
        - name: invoice_export_id
          in: path
          required: true
          schema:
            type: string
          description: 账单导出标识符。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvoiceExport"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取账单导出
      description: 读取账单导出。
  /api/v1/usage/invoice-exports/{invoice_export_id}/entries:
    get:
      tags:
        - UsageService
      operationId: UsageService_ListInvoiceExportEntries
      parameters:
        - name: invoice_export_id
          in: path
          required: true
          schema:
            type: string
          description: 账单导出标识符。
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListInvoiceExportEntriesResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出账单导出条目
      description: 列出账单导出条目。 如需继续读取结果，请使用接口声明的分页参数。
  /api/v1/usage/invoice-exports/{invoice_export_id}/model-financial-entries:
    get:
      tags:
        - UsageService
      operationId: UsageService_ListInvoiceFinancialEntries
      parameters:
        - name: invoice_export_id
          in: path
          required: true
          schema:
            type: string
          description: 账单导出标识符。
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListModelFinancialEntriesResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出账单财务条目
      description: 列出账单财务条目。 如需继续读取结果，请使用接口声明的分页参数。
  /api/v1/usage/invoice-exports/{invoice_export_id}:deliver:
    post:
      tags:
        - UsageService
      operationId: UsageService_DeliverInvoiceExport
      parameters:
        - name: invoice_export_id
          in: path
          required: true
          schema:
            type: string
          description: 账单导出标识符。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeliverInvoiceExportRequest"
        required: true
        description: 投递账单导出的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvoiceExport"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 投递账单导出
      description: 投递账单导出。 请求字段应遵循下方的 Schema。
  /api/v1/usage/invoice-exports/{invoice_export_id}:retry:
    post:
      tags:
        - UsageService
      operationId: UsageService_RetryInvoiceExportDelivery
      parameters:
        - name: invoice_export_id
          in: path
          required: true
          schema:
            type: string
          description: 账单导出标识符。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RetryInvoiceExportDeliveryRequest"
        required: true
        description: 重试账单导出投递的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvoiceExport"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 重试账单导出投递
      description: 重试账单导出投递。 请求字段应遵循下方的 Schema。
  /api/v1/usage/ledger:
    get:
      tags:
        - UsageService
      operationId: UsageService_ListUsageLedgerEntries
      parameters:
        - name: filter.run_id
          in: query
          schema:
            type: string
          description: 筛选运行标识符。
        - name: filter.task_id
          in: query
          schema:
            type: string
          description: 筛选任务标识符。
        - name: filter.agent_version_id
          in: query
          schema:
            type: string
          description: 筛选Agent版本标识符。
        - name: filter.provider_registry_version_id
          in: query
          schema:
            type: string
          description: 筛选服务商注册表版本标识符。
        - name: filter.reporter_identity_id
          in: query
          schema:
            type: string
          description: 筛选报告者身份标识符。
        - name: filter.start_time
          in: query
          schema:
            type: string
            format: date-time
          description: 筛选启动时间。
        - name: filter.end_time
          in: query
          schema:
            type: string
            format: date-time
          description: 筛选结束时间。
        - name: filter.source
          in: query
          schema:
            type: string
          description: 筛选来源。
        - name: filter.metering_point
          in: query
          schema:
            type: string
          description: 筛选计量位置。
        - name: filter.resource_type
          in: query
          schema:
            type: string
          description: 筛选资源类型。
        - name: filter.resource_id
          in: query
          schema:
            type: string
          description: 筛选资源标识符。
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListUsageLedgerEntriesResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出用量账本条目
      description: 列出用量账本条目。 如需继续读取结果，请使用接口声明的分页参数。
  /api/v1/usage/model-allocations/{id}/spending:
    get:
      tags:
        - UsageService
      operationId: UsageService_GetModelAllocationSpending
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ModelAllocationSpending"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取模型配额费用
      description: 读取模型配额费用。
  /api/v1/usage/model-financials/entries:
    get:
      tags:
        - UsageService
      operationId: UsageService_ListModelFinancialEntries
      parameters:
        - name: filter.start_time
          in: query
          schema:
            type: string
            format: date-time
          description: 筛选启动时间。
        - name: filter.end_time
          in: query
          schema:
            type: string
            format: date-time
          description: 筛选结束时间。
        - name: filter.run_id
          in: query
          schema:
            type: string
          description: 筛选运行标识符。
        - name: filter.task_id
          in: query
          schema:
            type: string
          description: 筛选任务标识符。
        - name: filter.model_allocation_id
          in: query
          schema:
            type: string
          description: 筛选模型配额分配标识符。
        - name: filter.currency
          in: query
          schema:
            type: string
          description: 筛选币种。
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListModelFinancialEntriesResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出模型财务条目
      description: 列出模型财务条目。 如需继续读取结果，请使用接口声明的分页参数。
  /api/v1/usage/model-financials/summary:
    get:
      tags:
        - UsageService
      operationId: UsageService_GetModelFinancialSummary
      parameters:
        - name: filter.start_time
          in: query
          schema:
            type: string
            format: date-time
          description: 筛选启动时间。
        - name: filter.end_time
          in: query
          schema:
            type: string
            format: date-time
          description: 筛选结束时间。
        - name: filter.run_id
          in: query
          schema:
            type: string
          description: 筛选运行标识符。
        - name: filter.task_id
          in: query
          schema:
            type: string
          description: 筛选任务标识符。
        - name: filter.model_allocation_id
          in: query
          schema:
            type: string
          description: 筛选模型配额分配标识符。
        - name: filter.currency
          in: query
          schema:
            type: string
          description: 筛选币种。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ModelFinancialSummary"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取模型财务摘要
      description: 读取模型财务摘要。
  /api/v1/usage/quota:
    get:
      tags:
        - UsageService
      operationId: UsageService_GetUsageQuota
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UsageQuota"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取用量配额
      description: 读取用量配额。
    put:
      tags:
        - UsageService
      operationId: UsageService_UpdateUsageQuota
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateUsageQuotaRequest"
        required: true
        description: 更新用量配额的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UsageQuota"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 更新用量配额
      description: 更新用量配额。 请求字段应遵循下方的 Schema。
  /api/v1/usage/quota/alerts:
    get:
      tags:
        - UsageService
      operationId: UsageService_ListUsageQuotaAlerts
      parameters:
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListUsageQuotaAlertsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出用量配额告警
      description: 列出用量配额告警。 如需继续读取结果，请使用接口声明的分页参数。
  /api/v1/usage/quota/status:
    get:
      tags:
        - UsageService
      operationId: UsageService_GetUsageQuotaStatus
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UsageQuotaStatus"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取用量配额状态
      description: 读取用量配额状态。
  /api/v1/usage/summary:
    get:
      tags:
        - UsageService
      operationId: UsageService_GetUsageSummary
      parameters:
        - name: filter.run_id
          in: query
          schema:
            type: string
          description: 筛选运行标识符。
        - name: filter.task_id
          in: query
          schema:
            type: string
          description: 筛选任务标识符。
        - name: filter.agent_version_id
          in: query
          schema:
            type: string
          description: 筛选Agent版本标识符。
        - name: filter.provider_registry_version_id
          in: query
          schema:
            type: string
          description: 筛选服务商注册表版本标识符。
        - name: filter.reporter_identity_id
          in: query
          schema:
            type: string
          description: 筛选报告者身份标识符。
        - name: filter.start_time
          in: query
          schema:
            type: string
            format: date-time
          description: 筛选启动时间。
        - name: filter.end_time
          in: query
          schema:
            type: string
            format: date-time
          description: 筛选结束时间。
        - name: filter.source
          in: query
          schema:
            type: string
          description: 筛选来源。
        - name: filter.metering_point
          in: query
          schema:
            type: string
          description: 筛选计量位置。
        - name: filter.resource_type
          in: query
          schema:
            type: string
          description: 筛选资源类型。
        - name: filter.resource_id
          in: query
          schema:
            type: string
          description: 筛选资源标识符。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UsageSummary"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取用量摘要
      description: 读取用量摘要。
  /api/v1/usage/task-model-financials:query:
    post:
      tags:
        - UsageService
      operationId: UsageService_ListTaskModelFinancials
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ListTaskModelFinancialsRequest"
        required: true
        description: 列出任务模型费用的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListTaskModelFinancialsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出任务模型费用
      description: 列出任务模型费用。 请求字段应遵循下方的 Schema。
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
  schemas:
    CreateInvoiceExportRequest:
      type: object
      properties:
        period_start:
          type: string
          format: date-time
          description: 周期启动，使用 RFC 3339 时间格式。
        period_end:
          type: string
          format: date-time
          description: 周期结束，使用 RFC 3339 时间格式。
        deliver:
          type: boolean
          description: 交付。
        idempotency_key:
          type: string
          description: 本次操作的幂等键，仅在重试同一次、同内容的提交时复用。
      description: 创建账单导出的请求结构。
    DeliverInvoiceExportRequest:
      type: object
      properties:
        invoice_export_id:
          type: string
          description: 账单导出标识符。
      description: 投递账单导出的请求结构。
    ExternalArtifactDelivery:
      type: object
      properties:
        source_event_id:
          type: string
          description: 来源事件标识符。
        artifact_id:
          type: string
          description: 产物标识符。
        delivery_path:
          type: string
          description: 投递路径。
        request_id:
          type: string
          description: 请求标识符。
        delivered_bytes:
          type: string
          description: 交付字节。
        started_at:
          type: string
          format: date-time
          description: 启动时间，使用 RFC 3339 时间格式。
        ended_at:
          type: string
          format: date-time
          description: 结束时间，使用 RFC 3339 时间格式。
        observed_at:
          type: string
          format: date-time
          description: 观测时间，使用 RFC 3339 时间格式。
        attributes:
          type: object
          additionalProperties:
            type: string
          description: 属性映射。
      description: ExternalArtifactDelivery 记录由运营方 CDN、对象代理或下载网关已经交付的字节数。delivery_path 是稳定的非敏感路径标识，不是 URL。
    GoalModelFinancials:
      type: object
      properties:
        goal_id:
          type: string
          description: 目标标识符。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        totals:
          type: array
          items:
            $ref: "#/components/schemas/ModelFinancialTaskTotal"
          description: 总计列表。
        budget_spending:
          $ref: "#/components/schemas/ModelChargeSpending"
          description: 预算费用。
      description: Goal 全部任务、阶段、后代任务及 Run 尝试的整个生命周期费用。
    InvoiceExport:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        created_by:
          type: string
          description: 创建操作者。
        period_start:
          type: string
          format: date-time
          description: 周期启动，使用 RFC 3339 时间格式。
        period_end:
          type: string
          format: date-time
          description: 周期结束，使用 RFC 3339 时间格式。
        ledger_cutoff:
          type: string
          format: date-time
          description: 账本截止，使用 RFC 3339 时间格式。
        provider:
          type: string
          description: 服务商。
        state:
          type: string
          description: 状态。
        ledger_entry_count:
          type: string
          description: 账本条目数量。
        ledger_manifest_digest:
          type: string
          description: 账本清单摘要。
        line_items:
          type: array
          items:
            $ref: "#/components/schemas/InvoiceLineItem"
          description: 明细条目列表。
        delivery_attempts:
          type: integer
          format: int32
          description: 投递尝试。
        available_at:
          type: string
          format: date-time
          description: 可用时间，使用 RFC 3339 时间格式。
        provider_invoice_id:
          type: string
          description: 服务商账单标识符。
        delivered_at:
          type: string
          format: date-time
          description: 交付时间，使用 RFC 3339 时间格式。
        delivery_failed_at:
          type: string
          format: date-time
          description: 投递失败时间，使用 RFC 3339 时间格式。
        last_error:
          type: string
          description: 最近错误。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
        updated_at:
          type: string
          format: date-time
          description: 更新时间，使用 RFC 3339 时间格式。
        model_financials:
          allOf:
            - $ref: "#/components/schemas/InvoiceModelFinancials"
          description: 已固定的租户费用，包含有符号调整及按币种精确汇总的金额。历史 v1 导出中可能缺失；新导出里的旧版模型成本条目仅供参考，不重复计入租户费用。
      description: 账单导出结构。
    InvoiceExportEntry:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        invoice_export_id:
          type: string
          description: 账单导出标识符。
        ledger_entry:
          $ref: "#/components/schemas/UsageLedgerEntry"
          description: 账本条目。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
      description: 账单导出条目结构。
    InvoiceLineItem:
      type: object
      properties:
        dimension:
          type: string
          description: 维度。
        unit:
          type: string
          description: 单位。
        quantity:
          type: string
          description: 计量数量。
        currency:
          type: string
          description: 币种。
      description: 账单明细条目结构。
    InvoiceModelFinancials:
      type: object
      properties:
        schema_version:
          type: string
          description: Schema版本。
        ledger_entry_count:
          type: string
          description: 账本条目数量。
        ledger_manifest_digest:
          type: string
          description: 账本清单摘要。
        totals:
          type: array
          items:
            $ref: "#/components/schemas/ModelFinancialCurrencyTotal"
          description: 总计列表。
        legacy_usage_entry_count:
          type: string
          description: 旧版用量条目数量。
        complete:
          type: boolean
          description: 完成。
      description: 账单模型财务数据结构。
    ListInvoiceExportEntriesResponse:
      type: object
      properties:
        entries:
          type: array
          items:
            $ref: "#/components/schemas/InvoiceExportEntry"
          description: 条目列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
      description: 列出账单导出条目的响应结构。
    ListInvoiceExportsResponse:
      type: object
      properties:
        exports:
          type: array
          items:
            $ref: "#/components/schemas/InvoiceExport"
          description: 导出列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
      description: 列出账单导出的响应结构。
    ListModelAllocationsResponse:
      type: object
      properties:
        allocations:
          type: array
          items:
            $ref: "#/components/schemas/ModelAllocation"
          description: 配额分配列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
        total_count:
          type: string
          description: 总计数量。
      description: 列出模型配额分配的响应结构。
    ListModelFinancialEntriesResponse:
      type: object
      properties:
        entries:
          type: array
          items:
            $ref: "#/components/schemas/ModelFinancialEntry"
          description: 条目列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
        start_time:
          type: string
          format: date-time
          description: 启动时间，使用 RFC 3339 时间格式。
        end_time:
          type: string
          format: date-time
          description: 结束时间，使用 RFC 3339 时间格式。
      description: 列出模型财务条目的响应结构。
    ListTaskModelFinancialsRequest:
      type: object
      properties:
        task_ids:
          type: array
          items:
            type: string
          description: 任务标识符列表列表。
      description: 最多接受当前已认证租户的 100 个不同任务。仅返回租户费用；供应商成本不进入租户侧 Task/Chat 展示数据。
    ListTaskModelFinancialsResponse:
      type: object
      properties:
        tasks:
          type: array
          items:
            $ref: "#/components/schemas/TaskModelFinancials"
          description: 任务列表。
      description: 列出任务模型费用的响应结构。
    ListUsageLedgerEntriesResponse:
      type: object
      properties:
        entries:
          type: array
          items:
            $ref: "#/components/schemas/UsageLedgerEntry"
          description: 条目列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
      description: 列出用量账本条目的响应结构。
    ListUsageQuotaAlertsResponse:
      type: object
      properties:
        alerts:
          type: array
          items:
            $ref: "#/components/schemas/UsageQuotaAlert"
          description: 告警列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
      description: 列出用量配额告警的响应结构。
    ModelAllocation:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        name:
          type: string
          description: 名称。
        credential_mode:
          type: string
          description: 凭据模式。
        status:
          type: string
          description: 状态。
        is_default:
          type: boolean
          description: 是否默认。
        state_version:
          type: string
          description: 用于乐观并发控制的状态版本，须保留精确的十进制表示。
        provider_registry_resource_id:
          type: string
          description: 服务商注册表资源标识符。
        current_version:
          $ref: "#/components/schemas/ModelAllocationVersion"
          description: 当前版本。
        model_policy_ref:
          type: string
          description: 模型策略引用。
        created_by:
          type: string
          description: 创建操作者。
        updated_by:
          type: string
          description: 更新操作者。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
        updated_at:
          type: string
          format: date-time
          description: 更新时间，使用 RFC 3339 时间格式。
      description: 模型配额分配结构。
    ModelAllocationBudget:
      type: object
      properties:
        max_input_tokens:
          type: string
          description: 最大输入Token。
        max_output_tokens:
          type: string
          description: 最大输出Token。
        max_total_tokens:
          type: string
          description: 最大总计Token。
        max_cost_microunits:
          type: string
          description: 最大成本微单位。
        max_compute_ms:
          type: string
          description: 最大计算毫秒。
        max_gpu_ms:
          type: string
          description: 最大GPU毫秒。
      description: 模型配额分配预算结构。
    ModelAllocationConfiguration:
      type: object
      properties:
        provider_version_id:
          type: string
          description: 服务商版本标识符。
        managed_secret_id:
          type: string
          description: 受管Secret标识符。
        enabled_models:
          type: array
          items:
            type: string
          description: 已启用模型列表。
        default_model:
          type: string
          description: 默认模型。
        rate_limits:
          $ref: "#/components/schemas/ModelAllocationRateLimits"
          description: 速率上限。
        budget:
          $ref: "#/components/schemas/ModelAllocationBudget"
          description: 预算。
        supplier_price_book_id:
          type: string
          description: 计费价格分配由平台管理，BYOK 配额同样适用；租户响应省略供应商价格簿引用。
        tenant_price_book_id:
          type: string
          description: 租户价格簿标识符。
        monthly_tenant_charge_limit_microunits:
          type: string
          description: 由平台管理。缺失表示不设限，零表示显式零额度；币种来自租户所分配的价格簿，不使用供应商成本币种。
      description: 模型配额分配配置结构。
    ModelAllocationRateLimits:
      type: object
      properties:
        requests_per_minute:
          type: string
          description: 请求每分钟。
        input_tokens_per_minute:
          type: string
          description: 输入Token每分钟。
        output_tokens_per_minute:
          type: string
          description: 输出Token每分钟。
        max_concurrency:
          type: string
          description: 最大并发。
      description: 模型配额分配速率上限结构。
    ModelAllocationSpending:
      type: object
      properties:
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        model_allocation_id:
          type: string
          description: 模型配额分配标识符。
        configuration_version_id:
          type: string
          description: 配置版本标识符。
        currency:
          type: string
          description: 币种。
        period_start:
          type: string
          format: date-time
          description: 周期启动，使用 RFC 3339 时间格式。
        period_end:
          type: string
          format: date-time
          description: 周期结束，使用 RFC 3339 时间格式。
        limit_microunits:
          type: string
          description: 上限微单位。
        posted_microunits:
          type: string
          description: 精确的十进制整数；尚未结算的风险敞口与已记账费用分别记录。
        reserved_microunits:
          type: string
          description: 已预留微单位。
        available_microunits:
          type: string
          description: 可用微单位。
        unknown_runs:
          type: string
          description: 未知运行。
        uncertain_requests:
          type: string
          description: 未确定请求。
        status:
          type: string
          description: 状态。
        next_change_at:
          type: string
          description: 已准备请求的最早到期时间，或 UTC 月份切换时间。客户端可以在该截止点安排一次刷新，无需持续轮询余额。
          format: date-time
      description: 模型配额费用结构。
    ModelAllocationVersion:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        version:
          type: string
          description: 版本。
        configuration:
          $ref: "#/components/schemas/ModelAllocationConfiguration"
          description: 配置。
        content_digest:
          type: string
          description: 内容摘要。
        reason:
          type: string
          description: 原因。
        created_by:
          type: string
          description: 创建操作者。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
      description: 模型配额分配版本结构。
    ModelChargeSpending:
      type: object
      properties:
        currency:
          type: string
          description: 币种。
        period_start:
          type: string
          format: date-time
          description: 周期启动，使用 RFC 3339 时间格式。
        period_end:
          type: string
          format: date-time
          description: 周期结束，使用 RFC 3339 时间格式。
        limit_microunits:
          type: string
          description: 上限微单位。
        posted_microunits:
          type: string
          description: 已记账微单位。
        reserved_microunits:
          type: string
          description: 已预留微单位。
        available_microunits:
          type: string
          description: 可用微单位。
        unknown_runs:
          type: string
          description: 未知运行。
        uncertain_requests:
          type: string
          description: 未确定请求。
        status:
          type: string
          description: 状态。
        next_change_at:
          type: string
          format: date-time
          description: 下一变更时间，使用 RFC 3339 时间格式。
      description: 租户和应用配额共用的精确金额及未结算敞口。旧版配额上限为空表示不设限；未知的可用金额不会被当成零余额。金额求和不受 int64 累计范围限制。
    ModelFinancialCurrencyTotal:
      type: object
      properties:
        purpose:
          type: string
          description: 用途。
        currency:
          type: string
          description: 币种。
        posted_microunits:
          type: string
          description: 精确的有符号十进制整数，不受 int64 累计范围或浮点数精度限制。这是账本求和值，不是待结算金额的估算。
        entry_count:
          type: string
          description: 条目数量。
        run_count:
          type: string
          description: 运行数量。
        priced_runs:
          type: string
          description: 已计价运行。
        free_runs:
          type: string
          description: 空闲运行。
        unpriced_runs:
          type: string
          description: 未计价运行。
        incomplete_runs:
          type: string
          description: 未完成运行。
      description: 模型财务币种总计结构。
    ModelFinancialEntry:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        run_id:
          type: string
          description: 关联任务的一次执行 Run 的标识。
        task_id:
          type: string
          description: 任务标识，不能用一次执行的 Run ID 替代。
        workspace_id:
          type: string
          description: 工作空间标识。工作空间是持续协作上下文，与按任务使用的工作树不同。
        usage_ledger_entry_id:
          type: string
          description: 用量账本条目标识符。
        model_allocation_id:
          type: string
          description: 模型配额分配标识符。
        price_book_id:
          type: string
          description: 价格簿标识符。
        price_version_id:
          type: string
          description: 价格版本标识符。
        purpose:
          type: string
          description: 用途。
        currency:
          type: string
          description: 币种。
        status:
          type: string
          description: 状态。
        reason:
          type: string
          description: 原因。
        amount_microunits_total:
          type: string
          description: 金额微单位总计。
        posted_microunits_total:
          type: string
          description: 已记账微单位总计。
        delta_microunits:
          type: string
          description: 负值表示明确的贷记调整，不修改此前已记账的借记。
        usage_sequence:
          type: string
          description: 用量序号。
        model_route_digest:
          type: string
          description: 模型路由摘要。
        source_event_digest:
          type: string
          description: 来源事件摘要。
        observed_at:
          type: string
          format: date-time
          description: 观测时间，使用 RFC 3339 时间格式。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
      description: 模型财务条目结构。
    ModelFinancialSummary:
      type: object
      properties:
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        start_time:
          type: string
          format: date-time
          description: 启动时间，使用 RFC 3339 时间格式。
        end_time:
          type: string
          format: date-time
          description: 结束时间，使用 RFC 3339 时间格式。
        totals:
          type: array
          items:
            $ref: "#/components/schemas/ModelFinancialCurrencyTotal"
          description: 总计列表。
      description: 模型财务摘要结构。
    ModelFinancialTaskTotal:
      type: object
      properties:
        purpose:
          type: string
          description: 用途。
        currency:
          type: string
          description: 币种。
        posted_microunits:
          type: string
          description: 已记账微单位。
        run_count:
          type: string
          description: 运行数量。
        priced_runs:
          type: string
          description: 已计价运行。
        free_runs:
          type: string
          description: 空闲运行。
        unpriced_runs:
          type: string
          description: 未计价运行。
        incomplete_runs:
          type: string
          description: 未完成运行。
      description: 覆盖任务整个生命周期及全部 Run 尝试的当前费用投影，不是按月观察窗口。十进制求和在超出 int64 累计范围后仍保持精确。
    MutateModelAllocationRequest:
      type: object
      properties:
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        action:
          type: string
          description: 操作。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
        reason:
          type: string
          description: 原因。
      description: 变更模型配额分配的请求结构。
    ProblemDetails:
      type: object
      description: RFC 9457 Problem Details 错误对象，包含 OrbitSpace 的关联标识扩展字段。
      required:
        - type
        - title
        - status
        - detail
        - request_id
      properties:
        type:
          type: string
          format: uri
          description: 类型。
        title:
          type: string
          description: 标题。
        status:
          type: integer
          minimum: 400
          maximum: 599
          description: 状态。
        detail:
          type: string
          description: 详情。
        instance:
          type: string
          format: uri-reference
          description: 实例。
        code:
          type: string
          pattern: ^[A-Z][A-Z0-9_]*$
          description: 代码。
        request_id:
          type: string
          format: uuid
          description: 请求标识符。
    PublishModelAllocationRequest:
      type: object
      properties:
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        id:
          type: string
          description: 创建时省略；发布对已有配额分配的修改时，必须提供当前版本。
        name:
          type: string
          description: 名称。
        credential_mode:
          type: string
          description: 凭据模式。
        is_default:
          type: boolean
          description: 是否默认。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
        configuration:
          $ref: "#/components/schemas/ModelAllocationConfiguration"
          description: 配置。
        reason:
          type: string
          description: 原因。
        idempotency_key:
          type: string
          description: 本次操作的幂等键，仅在重试同一次、同内容的提交时复用。
      description: 发布模型配额分配的请求结构。
    ReportExternalArtifactDeliveriesRequest:
      type: object
      properties:
        deliveries:
          type: array
          items:
            $ref: "#/components/schemas/ExternalArtifactDelivery"
          description: 投递列表。
      description: 报告外部产物交付记录的请求结构。
    ReportExternalArtifactDeliveriesResponse:
      type: object
      properties:
        accepted:
          type: integer
          format: int32
          description: 已接受。
        replayed:
          type: integer
          format: int32
          description: 已重放。
      description: 报告外部产物交付记录的响应结构。
    RetryInvoiceExportDeliveryRequest:
      type: object
      properties:
        invoice_export_id:
          type: string
          description: 账单导出标识符。
      description: 重试账单导出投递的请求结构。
    TaskModelFinancials:
      type: object
      properties:
        task_id:
          type: string
          description: 任务标识，不能用一次执行的 Run ID 替代。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        totals:
          type: array
          items:
            $ref: "#/components/schemas/ModelFinancialTaskTotal"
          description: 总计列表。
        budget_spending:
          allOf:
            - $ref: "#/components/schemas/ModelChargeSpending"
          description: 独立的生命周期额度，包含后代任务；上方的累计值仅描述本任务自己的执行尝试。已准入的 Delegation 上限同样约束其子任务树。两种上限均未设置时，该字段缺失。
      description: 任务模型费用结构。
    UpdateUsageQuotaRequest:
      type: object
      properties:
        expected_version:
          type: string
          description: 预期版本。
        currency:
          type: string
          description: 币种。
        limits:
          $ref: "#/components/schemas/UsageQuotaAmounts"
          description: 上限。
        alert_threshold_percent:
          type: integer
          format: int32
          description: 告警阈值百分比。
        idempotency_key:
          type: string
          description: 本次操作的幂等键，仅在重试同一次、同内容的提交时复用。
      description: 更新用量配额的请求结构。
    UsageCostTotal:
      type: object
      properties:
        currency:
          type: string
          description: 币种。
        microunits:
          type: string
          description: 微单位。
      description: 用量成本总计结构。
    UsageLedgerEntry:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        run_id:
          type: string
          description: 关联任务的一次执行 Run 的标识。
        task_id:
          type: string
          description: 任务标识，不能用一次执行的 Run ID 替代。
        workspace_id:
          type: string
          description: 工作空间标识。工作空间是持续协作上下文，与按任务使用的工作树不同。
        agent_version_id:
          type: string
          description: Agent版本标识符。
        reporter_identity_id:
          type: string
          description: 报告者身份标识符。
        provider_registry_version_id:
          type: string
          description: 服务商注册表版本标识符。
        sequence:
          type: string
          description: 用于排序和去重的事件序号。
        worker_id:
          type: string
          description: Worker标识符。
        provider:
          type: string
          description: 服务商。
        model:
          type: string
          description: 模型。
        model_route_digest:
          type: string
          description: 模型路由摘要。
        currency:
          type: string
          description: 币种。
        input_tokens_delta:
          type: string
          description: 输入Token增量。
        output_tokens_delta:
          type: string
          description: 输出Token增量。
        model_cost_microunits_delta:
          type: string
          description: 模型成本微单位增量。
        compute_ms_delta:
          type: string
          description: 计算毫秒增量。
        gpu_ms_delta:
          type: string
          description: GPU毫秒增量。
        input_tokens_total:
          type: string
          description: 输入Token总计。
        output_tokens_total:
          type: string
          description: 输出Token总计。
        model_cost_microunits_total:
          type: string
          description: 模型成本微单位总计。
        compute_ms_total:
          type: string
          description: 计算毫秒总计。
        gpu_ms_total:
          type: string
          description: GPU毫秒总计。
        observed_at:
          type: string
          format: date-time
          description: 观测时间，使用 RFC 3339 时间格式。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
        source:
          type: string
          description: 来源。
        source_event_id:
          type: string
          description: 来源事件标识符。
        resource_type:
          type: string
          description: 资源类型。
        resource_id:
          type: string
          description: 资源标识符。
        metering_point:
          type: string
          description: 计量位置。
        storage_byte_seconds_delta:
          type: string
          description: 存储字节秒增量。
        artifact_egress_bytes_delta:
          type: string
          description: 产物出站字节增量。
        network_ingress_bytes_delta:
          type: string
          description: 网络入站字节增量。
        network_egress_bytes_delta:
          type: string
          description: 网络出站字节增量。
        relay_bytes_delta:
          type: string
          description: 中继字节增量。
        period_start:
          type: string
          format: date-time
          description: 周期启动，使用 RFC 3339 时间格式。
        period_end:
          type: string
          format: date-time
          description: 周期结束，使用 RFC 3339 时间格式。
        attributes:
          type: object
          additionalProperties:
            type: string
          description: 属性映射。
        cache_read_input_tokens_delta:
          type: string
          description: 缓存读取输入Token增量。
        cache_write_input_tokens_delta:
          type: string
          description: 缓存写入输入Token增量。
        cache_read_input_tokens_total:
          type: string
          description: 缓存读取输入Token总计。
        cache_write_input_tokens_total:
          type: string
          description: 缓存写入输入Token总计。
        cache_usage_reported:
          type: boolean
          description: 缓存用量已报告。
        cache_read_reported:
          type: boolean
          description: 缓存读取已报告。
        cache_write_reported:
          type: boolean
          description: 缓存写入已报告。
      description: 用量账本条目结构。
    UsageQuota:
      type: object
      properties:
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        version:
          type: string
          description: 版本。
        currency:
          type: string
          description: 币种。
        limits:
          $ref: "#/components/schemas/UsageQuotaAmounts"
          description: 上限。
        alert_threshold_percent:
          type: integer
          format: int32
          description: 告警阈值百分比。
        created_by:
          type: string
          description: 创建操作者。
        updated_by:
          type: string
          description: 更新操作者。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
        updated_at:
          type: string
          format: date-time
          description: 更新时间，使用 RFC 3339 时间格式。
      description: 用量配额结构。
    UsageQuotaAlert:
      type: object
      properties:
        model_spending:
          allOf:
            - $ref: "#/components/schemas/ModelChargeSpending"
          description: 已固定的精确金额证据。旧整数金额字段属于兼容投影；历史物理计量告警中可能没有该字段。
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        usage_quota_id:
          type: string
          description: 用量配额标识符。
        quota_version:
          type: string
          description: 配额版本。
        period_start:
          type: string
          format: date-time
          description: 周期启动，使用 RFC 3339 时间格式。
        period_end:
          type: string
          format: date-time
          description: 周期结束，使用 RFC 3339 时间格式。
        dimension:
          type: string
          description: 维度。
        threshold_percent:
          type: integer
          format: int32
          description: 阈值百分比。
        threshold_value:
          type: string
          description: 阈值值。
        limit_value:
          type: string
          description: 上限值。
        used_value:
          type: string
          description: 已使用值。
        reserved_value:
          type: string
          description: 已预留值。
        event_id:
          type: string
          description: 事件标识符。
        published_at:
          type: string
          format: date-time
          description: 发布时间，使用 RFC 3339 时间格式。
        delivery_failed_at:
          type: string
          format: date-time
          description: 投递失败时间，使用 RFC 3339 时间格式。
        last_error:
          type: string
          description: 最近错误。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
        updated_at:
          type: string
          format: date-time
          description: 更新时间，使用 RFC 3339 时间格式。
      description: 用量配额告警结构。
    UsageQuotaAmounts:
      type: object
      properties:
        total_tokens:
          type: string
          description: 总计Token。
        model_cost_microunits:
          type: string
          description: 模型成本微单位。
        compute_ms:
          type: string
          description: 计算毫秒。
        gpu_ms:
          type: string
          description: GPU毫秒。
        storage_byte_seconds:
          type: string
          description: 存储字节秒。
        artifact_egress_bytes:
          type: string
          description: 产物出站字节。
        network_ingress_bytes:
          type: string
          description: 网络入站字节。
        network_egress_bytes:
          type: string
          description: 网络出站字节。
        relay_bytes:
          type: string
          description: 中继字节。
      description: 用量配额金额结构。
    UsageQuotaStatus:
      type: object
      properties:
        model_spending:
          $ref: "#/components/schemas/ModelChargeSpending"
          description: 模型费用。
        quota:
          $ref: "#/components/schemas/UsageQuota"
          description: 配额。
        period_start:
          type: string
          format: date-time
          description: 周期启动，使用 RFC 3339 时间格式。
        period_end:
          type: string
          format: date-time
          description: 周期结束，使用 RFC 3339 时间格式。
        used:
          $ref: "#/components/schemas/UsageQuotaAmounts"
          description: 已使用。
        reserved:
          $ref: "#/components/schemas/UsageQuotaAmounts"
          description: 已预留。
        remaining:
          $ref: "#/components/schemas/UsageQuotaAmounts"
          description: 剩余。
        exhausted_dimensions:
          type: array
          items:
            type: string
          description: 已耗尽维度列表。
        unlimited_dimensions:
          type: array
          items:
            type: string
          description: 不限维度列表。
        alerting_dimensions:
          type: array
          items:
            type: string
          description: 告警维度列表。
      description: 用量配额状态结构。
    UsageSummary:
      type: object
      properties:
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        start_time:
          type: string
          format: date-time
          description: 启动时间，使用 RFC 3339 时间格式。
        end_time:
          type: string
          format: date-time
          description: 结束时间，使用 RFC 3339 时间格式。
        entry_count:
          type: string
          description: 条目数量。
        input_tokens:
          type: string
          description: 输入Token。
        output_tokens:
          type: string
          description: 输出Token。
        compute_ms:
          type: string
          description: 计算毫秒。
        gpu_ms:
          type: string
          description: GPU毫秒。
        model_costs_by_currency:
          type: array
          items:
            $ref: "#/components/schemas/UsageCostTotal"
          description: 模型成本操作者币种列表。
        storage_byte_seconds:
          type: string
          description: 存储字节秒。
        artifact_egress_bytes:
          type: string
          description: 产物出站字节。
        network_ingress_bytes:
          type: string
          description: 网络入站字节。
        network_egress_bytes:
          type: string
          description: 网络出站字节。
        relay_bytes:
          type: string
          description: 中继字节。
        cache_read_input_tokens:
          type: string
          description: 缓存读取输入Token。
        cache_write_input_tokens:
          type: string
          description: 缓存写入输入Token。
        cache_usage_reported:
          type: boolean
          description: 缓存用量已报告。
        cache_read_reported:
          type: boolean
          description: 缓存读取已报告。
        cache_write_reported:
          type: boolean
          description: 缓存写入已报告。
      description: 用量摘要结构。
tags:
  - name: UsageService
    x-displayName: 用量与计费
    description: 用量与计费相关操作。
  - name: ModelAllocationService
    x-displayName: 模型配额分配
    description: 模型配额分配相关操作。
