> ## 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.

# 搜索可运行接口

> 查找任务所需的接口，比较数据提供商与价格。搜索只返回获取数据的方法，不会获取数据本身。

选择候选接口后，先[检查接口](https://glasser.ai/docs/zh/api-reference/endpoints/inspect.md)再运行。结果不合适时请更换关键词；低分或已到末页，不能证明没有相应能力。


## OpenAPI

````yaml /openapi.zh.json post /v1/endpoints/search
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/search:
    post:
      tags:
        - Endpoints
      summary: 搜索可运行接口
      description: >-
        按关键词查找可运行接口，返回候选接口，不返回业务数据。结果按相关性排序，并按当前 API Key Policy
        筛选，包含数据提供商、接口版本、价格和运行方式。比较候选并检查后再运行。


        使用 next_cursor 获取更多结果。低分或最后一页均不能证明没有对应能力，可尝试其他关键词。同一任务的后续调用复用返回的
        task_id。
      operationId: endpoints-search
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  anyOf:
                    - type: string
                      description: 描述所需数据的关键词。省略或留空时，浏览当前 API Key Policy 允许的全部接口。
                    - type: 'null'
                limit:
                  anyOf:
                    - type: integer
                      minimum: 1
                      maximum: 20
                      description: 每页最多结果数，默认为 5，最大为 20。
                    - type: 'null'
                cursor:
                  anyOf:
                    - type: string
                      description: 上次响应中的 next_cursor。查询词必须保持相同；使用其他查询的游标会返回 400。
                    - type: 'null'
                task_id:
                  anyOf:
                    - type: string
                      description: >-
                        本次搜索所属 Task。不带 task_id 的搜索会新建 Task，响应返回其
                        task_id。同一项工作的后续搜索、检查和运行均应传入，接受任意稳定字符串。
                    - 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'
                use_case:
                  type: string
                  minLength: 1
                  description: >-
                    每次搜索必填。保留用户原话及研究对象，说明本次搜索背后的需求，例如公司、域名、股票代码、地点或主题。请求较长时可缩短，不要改写含义。
              required:
                - use_case
              additionalProperties: false
        required: true
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      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'
                        score:
                          anyOf:
                            - anyOf:
                                - type: number
                                - type: string
                                  enum:
                                    - Infinity
                                    - '-Infinity'
                                    - NaN
                            - type: 'null'
                          description: >-
                            查询词与接口可搜索文本的余弦相似度，范围为 [-1, 1]；未执行语义评分时为
                            null。仅用于比较候选，不是能力判断。排序融合两路结果，低分或已到末页均不能证明没有相应能力。
                      required:
                        - provider
                        - provider_label
                        - endpoint
                        - endpoint_version
                        - name
                        - description
                        - tags
                        - price
                        - run_mode
                        - score
                      additionalProperties: false
                    description: 按相关性排序，并按当前 API Key Policy 筛选的接口摘要。价格不影响排序。
                  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
                  next_cursor:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: 将此值作为 cursor 读取下一页。null 表示没有更多结果。
                  total:
                    type: integer
                    minimum: 0
                    description: 所有页中已排序候选的总数。
                  task_id:
                    type: string
                    description: 本次搜索关联的 Task，即传入的值；未传入时新建。对于同一项工作，后续每次搜索、检查和运行都应传回此值。
                required:
                  - data
                  - next_cursor
                  - total
                  - task_id
                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'
        '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
    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.