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

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# TikTok Shop 以图搜商品

> 通过公开 HTTPS 图片链接（JPEG 或 PNG，最大 2 MiB）在指定 TikTok Shop 站点以图找同款商品，返回匹配商品的 ID、标题、主图与图集、类目 ID、价格区间、销量和 GMV。按成功搜索固定计费，无结果不收费。

上方请求和响应面板使用此 API 发布的 Schema。条件必填和参数组合限制属于请求契约；组合筛选条件或账号身份前，请查看完整 Schema。

## 计费

| 输入 | 计价单位 | 价格 (USD) |
| - | - | - |
| 所有有效输入 | 每次成功请求 | 0.12 |

成功交付才收费；正常查空不收费。

发送相同请求并带上 `X-AISA-Cost-Mode: quote`，获取与输入对应的报价；报价不执行任务，也不预扣资金。实际执行时预扣预计请求费用，按上述规则结算。用 `X-AISA-Max-Price-USD` 设置价格上限。

执行任务时使用 `Idempotency-Key`。错误时查看 `error.code`、`error.request_id`、`error.retryable` 和 `error.retry_hint`。提示先核对结算时，应先查询原请求再决定是否重试；不能把待结算当作已退款。


## OpenAPI

````yaml zh/tasks/openapi.json POST /v1/tasks/commerce.tiktok-shop.search_by_image
openapi: 3.1.0
info:
  title: AIsa Tasks
  version: '1'
  x-aisa-runtime-release:
    artifact_revision: 5e4f53bffbed8b98ca7b4a4b3fa1750f8a86f20cd6531c75e93d2c4fc68ceee3
    compiler_revision: 7d86aa782a15dad647ad8cac3a24b1267d937e98
    source_digest: 290c96cf57eb4693f5c39eb8644e07430868b718ebdcea81dec3f17e4ffbfd67
    generation: 16733
servers:
  - url: https://api.aisa.one
security:
  - bearer: []
paths:
  /v1/tasks/commerce.tiktok-shop.search_by_image:
    post:
      tags:
        - 任务
      summary: TikTok Shop 以图搜商品
      description: >-
        通过公开 HTTPS 图片链接（JPEG 或 PNG，最大 2 MiB）在指定 TikTok Shop 站点以图找同款商品，返回匹配商品的
        ID、标题、主图与图集、类目 ID、价格区间、销量和 GMV。按成功搜索固定计费，无结果不收费。
      operationId: task_commerce.tiktok-shop.search_by_image
      parameters:
        - name: Idempotency-Key
          in: header
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/commerce.tiktok-shop.search_by_image_request
      responses:
        '200':
          description: 成功交付或正常查空
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/commerce.tiktok-shop.search_by_image_response
        default:
          description: 错误；以实际 HTTP 状态和重试指引为准
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/commerce.tiktok-shop.search_by_image_error
components:
  schemas:
    commerce.tiktok-shop.search_by_image_request:
      type: object
      required:
        - input
      properties:
        input:
          type: object
          properties:
            country:
              type: string
              enum:
                - BR
                - DE
                - ES
                - FR
                - GB
                - ID
                - IT
                - JP
                - MX
                - MY
                - PH
                - SG
                - TH
                - US
                - VN
              description: 站点两位国家码（ISO 3166-1 alpha-2 大写，支持 15 个 TikTok Shop 站点，见枚举值）。
            image_url:
              type: string
              maxLength: 2048
              description: 公开的 HTTPS 商品图片 URL（仅支持 JPEG 或 PNG，大小不超过 2 MiB）。
            limit:
              type: integer
              minimum: 1
              maximum: 20
              default: 10
              description: 最多返回的视觉匹配商品数（1-20，默认 10）。
          required:
            - country
            - image_url
    commerce.tiktok-shop.search_by_image_response:
      additionalProperties: false
      properties:
        meta:
          additionalProperties: false
          properties:
            approximate_fields:
              items:
                type: string
              type:
                - array
                - 'null'
            delivered:
              type: boolean
            missing_fields:
              additionalProperties:
                description: >-
                  A stable missing-field reason, or distinct reasons separated
                  by '; '. Unrecognized internal diagnostics are reported as
                  unspecified.
                pattern: >-
                  ^(not_returned|not_supported|unparseable|continuation_failed|reference_identity_unverifiable|page_limit_reached|report_part_failed|some_account_identities_unusable|some_creators_unanalyzed|insufficient_analyzable_creators|pagination_not_reported|page_or_item_limit_reached|some_distributions_unusable|quote_not_usable|quote_availability_not_returned|quote_price_not_returned|unspecified)(;
                  (not_returned|not_supported|unparseable|continuation_failed|reference_identity_unverifiable|page_limit_reached|report_part_failed|some_account_identities_unusable|some_creators_unanalyzed|insufficient_analyzable_creators|pagination_not_reported|page_or_item_limit_reached|some_distributions_unusable|quote_not_usable|quote_availability_not_returned|quote_price_not_returned|unspecified))*$
                type: string
              type:
                - object
                - 'null'
          required:
            - missing_fields
            - approximate_fields
            - delivered
          type: object
        result:
          anyOf:
            - anyOf:
                - properties:
                    items:
                      items:
                        properties:
                          category_id:
                            description: 一级类目 ID（来源提供时）。
                            type:
                              - string
                              - 'null'
                          country:
                            description: TikTok Shop 站点两位国家码（ISO 3166-1 alpha-2）。
                            type: string
                          cover_image_url:
                            description: 匹配商品的主图 URL。
                            type:
                              - string
                              - 'null'
                          gmv:
                            description: 预估商品成交额 GMV（含 ISO 4217 币种）。
                            properties:
                              amount:
                                description: 以货币主单位计的非负金额，采用精确十进制字符串表示。
                                type: string
                              currency:
                                description: 已确认的 ISO 4217 货币代码；不从货币符号猜测。
                                type: string
                            required:
                              - amount
                              - currency
                            type:
                              - object
                              - 'null'
                          images:
                            description: 视觉搜索匹配返回的商品图片 URL 列表。
                            items:
                              type: string
                            type:
                              - array
                              - 'null'
                          max_price:
                            description: 最高 SKU 价格（含 ISO 4217 币种）。
                            properties:
                              amount:
                                description: 以货币主单位计的非负金额，采用精确十进制字符串表示。
                                type: string
                              currency:
                                description: 已确认的 ISO 4217 货币代码；不从货币符号猜测。
                                type: string
                            required:
                              - amount
                              - currency
                            type:
                              - object
                              - 'null'
                          min_price:
                            description: 最低 SKU 价格（含 ISO 4217 币种）。
                            properties:
                              amount:
                                description: 以货币主单位计的非负金额，采用精确十进制字符串表示。
                                type: string
                              currency:
                                description: 已确认的 ISO 4217 货币代码；不从货币符号猜测。
                                type: string
                            required:
                              - amount
                              - currency
                            type:
                              - object
                              - 'null'
                          platform:
                            description: 电商平台标识（tiktok-shop）。
                            enum:
                              - tiktok-shop
                            type: string
                          product_id:
                            description: TikTok Shop 商品 ID（正整数字符串）。
                            type: string
                          sales_count:
                            description: 预估商品销量。
                            type:
                              - integer
                              - 'null'
                          title:
                            description: TikTok Shop 商品标题。
                            type:
                              - string
                              - 'null'
                        required:
                          - platform
                          - country
                          - product_id
                          - title
                          - cover_image_url
                          - images
                          - category_id
                          - min_price
                          - max_price
                          - sales_count
                          - gmv
                        type: object
                      type: array
                  required:
                    - items
                  type: object
                - additionalProperties: false
                  properties:
                    by_source:
                      items:
                        additionalProperties: false
                        properties:
                          result:
                            anyOf:
                              - properties:
                                  items:
                                    items:
                                      properties:
                                        category_id:
                                          description: 一级类目 ID（来源提供时）。
                                          type:
                                            - string
                                            - 'null'
                                        country:
                                          description: TikTok Shop 站点两位国家码（ISO 3166-1 alpha-2）。
                                          type: string
                                        cover_image_url:
                                          description: 匹配商品的主图 URL。
                                          type:
                                            - string
                                            - 'null'
                                        gmv:
                                          description: 预估商品成交额 GMV（含 ISO 4217 币种）。
                                          properties:
                                            amount:
                                              description: 以货币主单位计的非负金额，采用精确十进制字符串表示。
                                              type: string
                                            currency:
                                              description: 已确认的 ISO 4217 货币代码；不从货币符号猜测。
                                              type: string
                                          required:
                                            - amount
                                            - currency
                                          type:
                                            - object
                                            - 'null'
                                        images:
                                          description: 视觉搜索匹配返回的商品图片 URL 列表。
                                          items:
                                            type: string
                                          type:
                                            - array
                                            - 'null'
                                        max_price:
                                          description: 最高 SKU 价格（含 ISO 4217 币种）。
                                          properties:
                                            amount:
                                              description: 以货币主单位计的非负金额，采用精确十进制字符串表示。
                                              type: string
                                            currency:
                                              description: 已确认的 ISO 4217 货币代码；不从货币符号猜测。
                                              type: string
                                          required:
                                            - amount
                                            - currency
                                          type:
                                            - object
                                            - 'null'
                                        min_price:
                                          description: 最低 SKU 价格（含 ISO 4217 币种）。
                                          properties:
                                            amount:
                                              description: 以货币主单位计的非负金额，采用精确十进制字符串表示。
                                              type: string
                                            currency:
                                              description: 已确认的 ISO 4217 货币代码；不从货币符号猜测。
                                              type: string
                                          required:
                                            - amount
                                            - currency
                                          type:
                                            - object
                                            - 'null'
                                        platform:
                                          description: 电商平台标识（tiktok-shop）。
                                          enum:
                                            - tiktok-shop
                                          type: string
                                        product_id:
                                          description: TikTok Shop 商品 ID（正整数字符串）。
                                          type: string
                                        sales_count:
                                          description: 预估商品销量。
                                          type:
                                            - integer
                                            - 'null'
                                        title:
                                          description: TikTok Shop 商品标题。
                                          type:
                                            - string
                                            - 'null'
                                      required:
                                        - platform
                                        - country
                                        - product_id
                                        - title
                                        - cover_image_url
                                        - images
                                        - category_id
                                        - min_price
                                        - max_price
                                        - sales_count
                                        - gmv
                                      type: object
                                    type: array
                                required:
                                  - items
                                type: object
                              - type: 'null'
                          status:
                            enum:
                              - found
                              - partial
                              - not_found
                              - failed
                            type: string
                        required:
                          - status
                          - result
                        type: object
                      type: array
                  required:
                    - by_source
                  type: object
                - additionalProperties: false
                  properties:
                    checked_count:
                      minimum: 0
                      type: integer
                    failed_count:
                      minimum: 0
                      type: integer
                    hit:
                      type: boolean
                    matches:
                      items:
                        additionalProperties: false
                        properties:
                          result:
                            anyOf:
                              - properties:
                                  items:
                                    items:
                                      properties:
                                        category_id:
                                          description: 一级类目 ID（来源提供时）。
                                          type:
                                            - string
                                            - 'null'
                                        country:
                                          description: TikTok Shop 站点两位国家码（ISO 3166-1 alpha-2）。
                                          type: string
                                        cover_image_url:
                                          description: 匹配商品的主图 URL。
                                          type:
                                            - string
                                            - 'null'
                                        gmv:
                                          description: 预估商品成交额 GMV（含 ISO 4217 币种）。
                                          properties:
                                            amount:
                                              description: 以货币主单位计的非负金额，采用精确十进制字符串表示。
                                              type: string
                                            currency:
                                              description: 已确认的 ISO 4217 货币代码；不从货币符号猜测。
                                              type: string
                                          required:
                                            - amount
                                            - currency
                                          type:
                                            - object
                                            - 'null'
                                        images:
                                          description: 视觉搜索匹配返回的商品图片 URL 列表。
                                          items:
                                            type: string
                                          type:
                                            - array
                                            - 'null'
                                        max_price:
                                          description: 最高 SKU 价格（含 ISO 4217 币种）。
                                          properties:
                                            amount:
                                              description: 以货币主单位计的非负金额，采用精确十进制字符串表示。
                                              type: string
                                            currency:
                                              description: 已确认的 ISO 4217 货币代码；不从货币符号猜测。
                                              type: string
                                          required:
                                            - amount
                                            - currency
                                          type:
                                            - object
                                            - 'null'
                                        min_price:
                                          description: 最低 SKU 价格（含 ISO 4217 币种）。
                                          properties:
                                            amount:
                                              description: 以货币主单位计的非负金额，采用精确十进制字符串表示。
                                              type: string
                                            currency:
                                              description: 已确认的 ISO 4217 货币代码；不从货币符号猜测。
                                              type: string
                                          required:
                                            - amount
                                            - currency
                                          type:
                                            - object
                                            - 'null'
                                        platform:
                                          description: 电商平台标识（tiktok-shop）。
                                          enum:
                                            - tiktok-shop
                                          type: string
                                        product_id:
                                          description: TikTok Shop 商品 ID（正整数字符串）。
                                          type: string
                                        sales_count:
                                          description: 预估商品销量。
                                          type:
                                            - integer
                                            - 'null'
                                        title:
                                          description: TikTok Shop 商品标题。
                                          type:
                                            - string
                                            - 'null'
                                      required:
                                        - platform
                                        - country
                                        - product_id
                                        - title
                                        - cover_image_url
                                        - images
                                        - category_id
                                        - min_price
                                        - max_price
                                        - sales_count
                                        - gmv
                                      type: object
                                    type: array
                                required:
                                  - items
                                type: object
                              - type: 'null'
                          status:
                            enum:
                              - found
                              - partial
                              - not_found
                              - failed
                            type: string
                        required:
                          - status
                          - result
                        type: object
                      type: array
                  required:
                    - hit
                    - checked_count
                    - failed_count
                    - matches
                  type: object
            - type: 'null'
        status:
          enum:
            - found
            - partial
            - not_found
          type: string
        task:
          const: commerce.tiktok-shop.search_by_image
        version:
          const: 1
      required:
        - task
        - version
        - status
        - result
        - meta
      type: object
    commerce.tiktok-shop.search_by_image_error:
      $ref: '#/components/schemas/commerce.tiktok-shop.search_by_image_error.0_Error'
      $schema: https://json-schema.org/draft/2020-12/schema
    commerce.tiktok-shop.search_by_image_error.0_Error:
      additionalProperties: false
      properties:
        error:
          $ref: >-
            #/components/schemas/commerce.tiktok-shop.search_by_image_error.1_ErrorDetail
      required:
        - error
      type: object
    commerce.tiktok-shop.search_by_image_error.1_ErrorDetail:
      additionalProperties: false
      else:
        properties:
          retryable:
            const: false
      if:
        properties:
          retry_hint:
            const: after_delay
      properties:
        code:
          enum:
            - invalid_request
            - invalid_input
            - unsupported_route
            - unsupported_capability
            - unsupported_identity
            - provider_rejected_input
            - invalid_cost_mode
            - cost_quote_payment_unsupported
            - cost_quote_unsupported
            - unpriced_request_value
            - missing_api_key
            - invalid_api_key
            - api_key_disabled
            - expired_api_key
            - unauthorized
            - forbidden
            - user_disabled
            - ip_not_allowed
            - api_key_access_denied
            - estimated_price_exceeds_max_price
            - insufficient_api_key_balance
            - insufficient_wallet_balance
            - task_not_found
            - endpoint_not_found
            - request_in_progress
            - request_already_completed
            - idempotency_conflict
            - request_id_conflict
            - request_too_large
            - method_not_allowed
            - rate_limit_exceeded
            - internal_error
            - service_unavailable
          type: string
        message:
          type: string
        param:
          type: string
        problems:
          items:
            type: string
          type: array
        request_id:
          minLength: 1
          type: string
        retry_hint:
          enum:
            - never
            - after_delay
            - reconcile_first
          type: string
        retryable:
          type: boolean
        similar_tasks:
          items:
            type: string
          type: array
        task_id:
          type: string
      required:
        - code
        - message
        - request_id
        - retryable
        - retry_hint
      then:
        properties:
          retryable:
            const: true
      type: object
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

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