> ## Documentation Index
> Fetch the complete documentation index at: https://glasser.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 检查接口

> 获取接口 Schema、当前价格和示例输入，为 Run 准备请求。

按 `input_schema` 构造请求，并在运行前检查价格。将 `endpoint_version` 用于 Run；版本不会锁定价格。同步接口的客户端超时应高于 `timeout_ms`。


## OpenAPI

````yaml /openapi.zh.json post /v1/endpoints/inspect
openapi: 3.1.0
info:
  title: Glasser
  version: 0.0.1
  description: 一个 API Key，无需合同，按次付费，即可调用批量采购的付费 API。每个响应包含 x-request-id；所有错误正文采用统一结构。
servers:
  - url: https://api.glasser.ai
security: []
tags:
  - name: Solutions
  - name: Endpoints
  - name: Runs
  - name: Balance
paths:
  /v1/endpoints/inspect:
    post:
      tags:
        - Endpoints
      summary: 检查接口
      description: >-
        获取接口的输入 Schema、可用输出 Schema、价格、示例输入、版本、运行方式及超时。首次 Run 前检查，并使用返回的
        input_schema 和 endpoint_version。


        output_schema 为 null 表示没有可靠 Schema。接口版本不锁定价格，新 Run 使用受理时价格。同步接口的 HTTP
        客户端超时应高于 timeout_ms。
      operationId: endpoints-inspect
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                provider:
                  type: string
                  pattern: ^[a-z0-9][a-z0-9-]*$
                endpoint:
                  type: string
                  pattern: ^\/.+$
                endpoint_version:
                  anyOf:
                    - type: integer
                      exclusiveMinimum: 0
                      description: 选择受支持的接口版本，包括旧版本；省略则使用默认版本。版本不可用或已停用时返回 409。
                    - type: 'null'
                task_id:
                  anyOf:
                    - type: string
                      description: 本次检查所属 Task，来自数据源搜索响应，接受任意稳定字符串。
                    - type: 'null'
                metadata:
                  anyOf:
                    - anyOf:
                        - type: object
                          additionalProperties:
                            type: string
                            minLength: 1
                            maxLength: 500
                          maxProperties: 20
                          propertyNames:
                            type: string
                            pattern: ^[a-z][a-z0-9_]{0,39}$
                        - {}
                      description: |-
                        可选追踪字段，随 Run 返回，也可用于筛选。不会发送给数据提供商，也不影响路由、价格或幂等。

                        - 最多 20 个键：小写字母、数字和下划线，以字母开头，最长 40 个字符。
                        - 值：长度为 1–500 的字符串。
                        - user_id：终端用户的不透明 ID，不得使用邮箱或姓名。

                        无效条目整体丢弃，不截断。请求继续执行，Run 返回实际保存的字段。
                    - type: 'null'
              required:
                - provider
                - endpoint
              additionalProperties: false
        required: true
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  provider:
                    type: string
                    pattern: ^[a-z0-9][a-z0-9-]*$
                  provider_label:
                    type: string
                    description: >-
                      数据提供商品牌名称，仅用于展示，例如 provider 为 pdl 时显示 People Data
                      Labs。身份仍由 provider 标识，运行和检查时使用 provider，不传回此展示名称。
                  endpoint:
                    type: string
                    pattern: ^\/.+$
                  endpoint_version:
                    type: integer
                    exclusiveMinimum: 0
                    description: 受支持的接口版本。兼容更新保持此版本号。
                  name:
                    type: string
                  description:
                    type: string
                  tags:
                    type: array
                    items:
                      type: string
                  price:
                    type: object
                    properties:
                      rule:
                        anyOf:
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - flat
                              amount_usd:
                                type: string
                                pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                description: >-
                                  精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以
                                  10^6 转为整数，不使用浮点数。
                            required:
                              - type
                              - amount_usd
                            additionalProperties: false
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - per_result
                              per_result_usd:
                                type: string
                                pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                description: >-
                                  精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以
                                  10^6 转为整数，不使用浮点数。
                              cap_usd:
                                anyOf:
                                  - type: string
                                    pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                    description: >-
                                      精确的美元十进制字符串，小数位数为
                                      2–6，采用唯一规范格式。求和时使用十进制运算或乘以 10^6
                                      转为整数，不使用浮点数。
                                  - type: 'null'
                              partial_usd:
                                type: string
                                pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                description: >-
                                  精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以
                                  10^6 转为整数，不使用浮点数。
                            required:
                              - type
                              - per_result_usd
                              - cap_usd
                            additionalProperties: false
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - per_token
                              per_million_input_tokens_usd:
                                type: string
                                pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                description: >-
                                  精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以
                                  10^6 转为整数，不使用浮点数。
                              cap_usd:
                                type: string
                                pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                description: >-
                                  精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以
                                  10^6 转为整数，不使用浮点数。
                            required:
                              - type
                              - per_million_input_tokens_usd
                              - cap_usd
                            additionalProperties: false
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - base_plus_per_result
                              base_usd:
                                type: string
                                pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                description: >-
                                  精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以
                                  10^6 转为整数，不使用浮点数。
                              included_results:
                                type: integer
                                minimum: 0
                              per_extra_result_usd:
                                type: string
                                pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                description: >-
                                  精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以
                                  10^6 转为整数，不使用浮点数。
                              cap_usd:
                                type: string
                                pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                description: >-
                                  精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以
                                  10^6 转为整数，不使用浮点数。
                              unit:
                                type: string
                            required:
                              - type
                              - base_usd
                              - included_results
                              - per_extra_result_usd
                              - cap_usd
                            additionalProperties: false
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - metered
                              base_usd:
                                type: string
                                pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                description: >-
                                  精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以
                                  10^6 转为整数，不使用浮点数。
                              cap_usd:
                                anyOf:
                                  - type: string
                                    pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                    description: >-
                                      精确的美元十进制字符串，小数位数为
                                      2–6，采用唯一规范格式。求和时使用十进制运算或乘以 10^6
                                      转为整数，不使用浮点数。
                                  - type: 'null'
                              base_kind:
                                type: string
                                enum:
                                  - starting
                            required:
                              - type
                              - base_usd
                              - cap_usd
                            additionalProperties: false
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - per_event
                              events:
                                type: object
                                additionalProperties:
                                  type: object
                                  properties:
                                    usd:
                                      type: string
                                      pattern: >-
                                        ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                      description: >-
                                        精确的美元十进制字符串，小数位数为
                                        2–6，采用唯一规范格式。求和时使用十进制运算或乘以 10^6
                                        转为整数，不使用浮点数。
                                    title:
                                      type: string
                                  required:
                                    - usd
                                    - title
                                  additionalProperties: false
                              base_usd:
                                type: string
                                pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                description: >-
                                  精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以
                                  10^6 转为整数，不使用浮点数。
                              cap_usd:
                                type: string
                                pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                description: >-
                                  精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以
                                  10^6 转为整数，不使用浮点数。
                            required:
                              - type
                              - events
                              - base_usd
                              - cap_usd
                            additionalProperties: false
                          - type: object
                            properties:
                              type:
                                type: string
                            required:
                              - type
                            allOf:
                              - type: object
                                additionalProperties: {}
                      display:
                        type: object
                        properties:
                          amount_usd:
                            type: string
                            pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                            description: >-
                              精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以 10^6
                              转为整数，不使用浮点数。
                          unit:
                            type: string
                          cap_usd:
                            type: string
                            pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                            description: >-
                              精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以 10^6
                              转为整数，不使用浮点数。
                        required:
                          - amount_usd
                          - unit
                        additionalProperties: false
                      charges:
                        type: object
                        properties:
                          NO_RESULT:
                            type: string
                            pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                            description: >-
                              精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以 10^6
                              转为整数，不使用浮点数。
                          PROVIDER_ERROR:
                            type: string
                            pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                            description: >-
                              精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以 10^6
                              转为整数，不使用浮点数。
                          TIMED_OUT:
                            type: string
                            pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                            description: >-
                              精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以 10^6
                              转为整数，不使用浮点数。
                          INTERNAL:
                            type: string
                            pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                            description: >-
                              精确的美元十进制字符串，小数位数为 2–6，采用唯一规范格式。求和时使用十进制运算或乘以 10^6
                              转为整数，不使用浮点数。
                        required:
                          - NO_RESULT
                          - PROVIDER_ERROR
                          - TIMED_OUT
                          - INTERNAL
                        additionalProperties: false
                    required:
                      - rule
                      - display
                      - charges
                    additionalProperties: false
                    description: 当前价格及计费规则。价格可在不更改接口版本的情况下变化。新 Run 使用受理时价格，已受理 Run 保留该价格。
                  run_mode:
                    type: string
                    enum:
                      - sync
                      - async
                  timeout_ms:
                    anyOf:
                      - type: integer
                        exclusiveMinimum: 0
                        description: 同步接口从 Run 请求到终态响应的最长毫秒数。HTTP 客户端超时应高于此值。
                      - type: 'null'
                  client:
                    type: object
                    properties:
                      client_version:
                        anyOf:
                          - type: string
                          - type: 'null'
                      minimum_version:
                        type: string
                      latest_version:
                        type: string
                      upgrade_command:
                        type: string
                      reason:
                        type: string
                    required:
                      - client_version
                      - minimum_version
                      - latest_version
                      - upgrade_command
                      - reason
                    additionalProperties: false
                  method:
                    type: string
                    enum:
                      - GET
                      - POST
                      - PUT
                      - PATCH
                      - DELETE
                      - HEAD
                  input_schema:
                    type: object
                    description: Run 输入的数据提供商原生 JSON Schema。
                  output_schema:
                    anyOf:
                      - type: object
                      - type: 'null'
                    description: 成功输出的 JSON Schema。没有可靠 Schema 时为 null，示例响应不构成 Schema。
                  output_schema_source:
                    anyOf:
                      - type: string
                        enum:
                          - provider
                          - glasser
                      - type: 'null'
                    description: >-
                      输出 Schema 的定义方：数据提供商或 Glasser。output_schema 为 null 时，此值也为
                      null。
                  sample_input:
                    type: object
                    description: 示例输入。根据请求调整，并按 input_schema 校验。
                  doc_url:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: 数据提供商文档链接，如有。
                required:
                  - provider
                  - provider_label
                  - endpoint
                  - endpoint_version
                  - name
                  - description
                  - tags
                  - price
                  - run_mode
                  - method
                  - input_schema
                  - output_schema
                  - output_schema_source
                  - sample_input
                  - doc_url
                additionalProperties: false
        '400':
          description: ValidationFailed
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ValidationFailedEncoded'
                  - $ref: '#/components/schemas/ValidationFailedEncoded'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedEncoded'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenEncoded'
        '404':
          description: NotFound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundEncoded'
        '409':
          description: EndpointVersionMismatch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndpointVersionMismatchEncoded'
        '429':
          description: RateLimited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitedEncoded'
      security:
        - bearer: []
components:
  schemas:
    ValidationFailedEncoded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_failed
            message:
              type: string
            reason:
              anyOf:
                - type: string
                - type: 'null'
            control:
              anyOf:
                - type: string
                - type: 'null'
            retry_after_ms:
              anyOf:
                - anyOf:
                    - type: integer
                    - type: 'null'
                - type: 'null'
            details:
              anyOf:
                - type: object
                - type: 'null'
          required:
            - code
            - message
          additionalProperties: false
        request_id:
          type: string
      required:
        - error
        - request_id
      additionalProperties: false
    UnauthorizedEncoded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
            message:
              type: string
            reason:
              anyOf:
                - type: string
                - type: 'null'
            control:
              anyOf:
                - type: string
                - type: 'null'
            retry_after_ms:
              anyOf:
                - anyOf:
                    - type: integer
                    - type: 'null'
                - type: 'null'
            details:
              anyOf:
                - type: object
                - type: 'null'
          required:
            - code
            - message
          additionalProperties: false
        request_id:
          type: string
      required:
        - error
        - request_id
      additionalProperties: false
    ForbiddenEncoded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - forbidden
            message:
              type: string
            reason:
              anyOf:
                - type: string
                - type: 'null'
            control:
              anyOf:
                - type: string
                - type: 'null'
            retry_after_ms:
              anyOf:
                - anyOf:
                    - type: integer
                    - type: 'null'
                - type: 'null'
            details:
              anyOf:
                - type: object
                - type: 'null'
          required:
            - code
            - message
          additionalProperties: false
        request_id:
          type: string
      required:
        - error
        - request_id
      additionalProperties: false
    NotFoundEncoded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - not_found
            message:
              type: string
            reason:
              anyOf:
                - type: string
                - type: 'null'
            control:
              anyOf:
                - type: string
                - type: 'null'
            retry_after_ms:
              anyOf:
                - anyOf:
                    - type: integer
                    - type: 'null'
                - type: 'null'
            details:
              anyOf:
                - type: object
                - type: 'null'
          required:
            - code
            - message
          additionalProperties: false
        request_id:
          type: string
      required:
        - error
        - request_id
      additionalProperties: false
    EndpointVersionMismatchEncoded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - endpoint_version_mismatch
            message:
              type: string
            reason:
              anyOf:
                - type: string
                - type: 'null'
            control:
              anyOf:
                - type: string
                - type: 'null'
            retry_after_ms:
              anyOf:
                - anyOf:
                    - type: integer
                    - type: 'null'
                - type: 'null'
            details:
              anyOf:
                - type: object
                - type: 'null'
          required:
            - code
            - message
          additionalProperties: false
        request_id:
          type: string
      required:
        - error
        - request_id
      additionalProperties: false
    RateLimitedEncoded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - rate_limited
            message:
              type: string
            reason:
              anyOf:
                - type: string
                - type: 'null'
            control:
              anyOf:
                - type: string
                - type: 'null'
            retry_after_ms:
              anyOf:
                - anyOf:
                    - type: integer
                    - type: 'null'
                - type: 'null'
            details:
              anyOf:
                - type: object
                - type: 'null'
          required:
            - code
            - message
          additionalProperties: false
        request_id:
          type: string
      required:
        - error
        - request_id
      additionalProperties: false
  securitySchemes:
    bearer:
      type: http
      scheme: Bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.