WritersLogic Verifiable AI Agent Hub Optimize Tariff API

The Optimize Tariff API from WritersLogic Verifiable AI Agent Hub — 1 operation(s) for optimize tariff.

GitHub OpenAPI

Operations 1

POST /api/v1/optimize-tariff Global Customs & Tariff Engineering Optimizer #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/writerslogic-com:writerslogic-com-optimize-tariff-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

writerslogic-com-optimize-tariff-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: WritersLogic Verifiable AI Agent Hub Optimize Tariff API
  version: 2.0.0
  description: Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.
  contact:
    name: WritersLogic
    url: https://writerslogic.com/agents
    email: agents@writerslogic.com
servers:
- url: https://agents.writerslogic.com
tags:
- name: Optimize Tariff
paths:
  /api/v1/optimize-tariff:
    post:
      operationId: tariff_engineer
      summary: Global Customs & Tariff Engineering Optimizer
      description: 'Classifies a product under the HTS with GRI reasoning and verifies the code and general (MFN) rate against the live USITC schedule, flags when a specific sibling subheading may outrank the chosen residual one, separates lower-duty options from reclassification risk with dollar exposure, lists lawful physical tariff-engineering changes, and drafts an accurate commercial invoice description. Leads with a decision, the dollars at stake and the next step. Section 301/232/IEEPA add-ons are model estimates and marked unverified. Not legal advice or a binding ruling.


        Price: 1.50 USDC on Base (x402).'
      x-x402-price-usdc: '1.50'
      x-x402-amount: '1500000'
      x-payment-info:
        protocols:
        - x402
        price:
          mode: fixed
          currency: USD
          amount: '1.50'
      x-audience: business
      x-sample-url: https://agents.writerslogic.com/api/v1/samples/tariff-engineer
      security:
      - x402: []
      - apiKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
              - productName
              - materialsBreakdown
              - intendedUse
              - originCountry
              - destinationCountry
              properties:
                productName:
                  type: string
                  minLength: 2
                  maxLength: 300
                materialsBreakdown:
                  type: array
                  minItems: 1
                  maxItems: 30
                  items:
                    type: object
                    additionalProperties: false
                    required:
                    - material
                    - percentByWeight
                    properties:
                      material:
                        type: string
                        minLength: 1
                        maxLength: 200
                      percentByWeight:
                        type: number
                        minimum: 0
                        maximum: 100
                      percentByValue:
                        type: number
                        minimum: 0
                        maximum: 100
                intendedUse:
                  type: string
                  minLength: 2
                  maxLength: 2000
                originCountry:
                  type: string
                  minLength: 2
                  maxLength: 60
                destinationCountry:
                  type: string
                  minLength: 2
                  maxLength: 60
                productDescription:
                  type: string
                  maxLength: 5000
                  description: Construction, dimensions, how it works, packaging.
                customsValueUsd:
                  type: number
                  minimum: 0
                  maximum: 10000000000
                  description: Entered value, used to estimate duty and savings.
                currentHtsCode:
                  type: string
                  pattern: ^\d{4}(\.?\d{2}){1,3}$
                importStateOfAssembly:
                  type: string
                  enum:
                  - fully_assembled
                  - unassembled_kit
                  - components
                  - bulk
                productUrl:
                  type: string
                  maxLength: 2048
                  description: Public product or spec-sheet page. Its text is read to supplement productDescription; if it cannot be read the request still succeeds and says so in warnings.
            example:
              productName: Women's waterproof ankle boot
              materialsBreakdown:
              - material: Rubber/plastics outer sole
                percentByWeight: 45
              - material: Polyurethane-coated textile upper
                percentByWeight: 40
              - material: Textile lining
                percentByWeight: 15
              intendedUse: Everyday wet-weather footwear
              originCountry: Vietnam
              destinationCountry: United States
              customsValueUsd: 85000
              importStateOfAssembly: fully_assembled
      responses:
        '200':
          description: Paid result with provenance
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      primaryClassification:
                        type: object
                        additionalProperties: false
                        required:
                        - htsCode
                        - description
                        - adValoremPct
                        - rateText
                        - reasoning
                        properties:
                          htsCode:
                            type: string
                            description: Destination tariff code, 6-10 digits (e.g. 6404.11.90).
                          description:
                            type: string
                            description: Heading/subheading text.
                          adValoremPct:
                            type: number
                            description: General ad valorem duty rate in percent; -1 if specific or compound.
                          rateText:
                            type: string
                            description: Rate as written, including specific components.
                          reasoning:
                            type: string
                            description: GRI analysis, section/chapter notes, and any relevant rulings.
                          rate_source:
                            type: string
                            enum:
                            - usitc_hts
                            - model
                            description: 'usitc_hts: description and rate come from the official HTS line; model: the model''s recollection.'
                          hts_status:
                            type: string
                            enum:
                            - found
                            - not_final
                            - not_found
                            - lookup_failed
                            - invalid_format
                            - not_checked
                          hts_note:
                            type: string
                          rate_kind:
                            type: string
                            enum:
                            - free
                            - ad_valorem
                            - specific
                            - compound
                            - other
                          units:
                            type: array
                            items:
                              type: string
                          origin_preference:
                            type: object
                            description: Special-column rate listing the origin country; informational, not applied to the estimate.
                          nearest_codes:
                            type: array
                            items:
                              type: object
                            description: Real HTS lines sharing the longest prefix with a code that does not exist.
                          candidates:
                            type: array
                            items:
                              type: object
                            description: Final 8-digit lines under a heading or subheading code.
                      additionalDuties:
                        type: array
                        items:
                          type: object
                          additionalProperties: false
                          required:
                          - program
                          - adValoremPct
                          - applies_because
                          - verify_at
                          properties:
                            program:
                              type: string
                              description: e.g. Section 301, Section 232, IEEPA, AD/CVD, or an FTA preference.
                            adValoremPct:
                              type: number
                              description: Additional percent; negative for a preference reduction.
                            applies_because:
                              type: string
                            verify_at:
                              type: string
                              description: Where to confirm the current rate.
                            verified:
                              type: boolean
                              description: 'Always false: add-on programs are model-recalled and not checked against Chapter 99, CSMS or AD/CVD orders.'
                            verification:
                              type: string
                      alternatives:
                        type: array
                        items:
                          type: object
                          properties:
                            classification:
                              type: object
                              additionalProperties: false
                              required:
                              - htsCode
                              - description
                              - adValoremPct
                              - rateText
                              - reasoning
                              properties:
                                htsCode:
                                  type: string
                                  description: Destination tariff code, 6-10 digits (e.g. 6404.11.90).
                                description:
                                  type: string
                                  description: Heading/subheading text.
                                adValoremPct:
                                  type: number
                                  description: General ad valorem duty rate in percent; -1 if specific or compound.
                                rateText:
                                  type: string
                                  description: Rate as written, including specific components.
                                reasoning:
                                  type: string
                                  description: GRI analysis, section/chapter notes, and any relevant rulings.
                                rate_source:
                                  type: string
                                  enum:
                                  - usitc_hts
                                  - model
                                  description: 'usitc_hts: description and rate come from the official HTS line; model: the model''s recollection.'
                                hts_status:
                                  type: string
                                  enum:
                                  - found
                                  - not_final
                                  - not_found
                                  - lookup_failed
                                  - invalid_format
                                  - not_checked
                                hts_note:
                                  type: string
                                rate_kind:
                                  type: string
                                  enum:
                                  - free
                                  - ad_valorem
                                  - specific
                                  - compound
                                  - other
                                units:
                                  type: array
                                  items:
                                    type: string
                                origin_preference:
                                  type: object
                                  description: Special-column rate listing the origin country; informational, not applied to the estimate.
                                nearest_codes:
                                  type: array
                                  items:
                                    type: object
                                  description: Real HTS lines sharing the longest prefix with a code that does not exist.
                                candidates:
                                  type: array
                                  items:
                                    type: object
                                  description: Final 8-digit lines under a heading or subheading code.
                            direction:
                              type: string
                              enum:
                              - lower_duty
                              - higher_duty
                              - same
                              - unknown
                              description: 'lower_duty: the MFN rate is below the primary''s. higher_duty: choosing it would cost more (rateDeltaPct and estimatedSavingsUsd are then negative).'
                      engineeringOptions:
                        type: array
                        items:
                          type: object
                          properties:
                            target:
                              type: object
                              additionalProperties: false
                              required:
                              - htsCode
                              - description
                              - adValoremPct
                              - rateText
                              - reasoning
                              properties:
                                htsCode:
                                  type: string
                                  description: Destination tariff code, 6-10 digits (e.g. 6404.11.90).
                                description:
                                  type: string
                                  description: Heading/subheading text.
                                adValoremPct:
                                  type: number
                                  description: General ad valorem duty rate in percent; -1 if specific or compound.
                                rateText:
                                  type: string
                                  description: Rate as written, including specific components.
                                reasoning:
                                  type: string
                                  description: GRI analysis, section/chapter notes, and any relevant rulings.
                                rate_source:
                                  type: string
                                  enum:
                                  - usitc_hts
                                  - model
                                  description: 'usitc_hts: description and rate come from the official HTS line; model: the model''s recollection.'
                                hts_status:
                                  type: string
                                  enum:
                                  - found
                                  - not_final
                                  - not_found
                                  - lookup_failed
                                  - invalid_format
                                  - not_checked
                                hts_note:
                                  type: string
                                rate_kind:
                                  type: string
                                  enum:
                                  - free
                                  - ad_valorem
                                  - specific
                                  - compound
                                  - other
                                units:
                                  type: array
                                  items:
                                    type: string
                                origin_preference:
                                  type: object
                                  description: Special-column rate listing the origin country; informational, not applied to the estimate.
                                nearest_codes:
                                  type: array
                                  items:
                                    type: object
                                  description: Real HTS lines sharing the longest prefix with a code that does not exist.
                                candidates:
                                  type: array
                                  items:
                                    type: object
                                  description: Final 8-digit lines under a heading or subheading code.
                            direction:
                              type: string
                              enum:
                              - lower_duty
                              - higher_duty
                              - same
                              - unknown
                            recommended:
                              type: boolean
                              description: False when the change would not lower the MFN duty.
                      commercialInvoiceDescription:
                        type: string
                        description: Accurate description of the goods as actually imported.
                      documentation:
                        type: array
                        items:
                          type: string
                      complianceWarnings:
                        type: array
                        items:
                          type: string
                      bindingRulingAdvice:
                        type: string
                      headline:
                        type: object
                        description: 'Decision first: the verdict, the dollars at stake, confidence and the exact next step.'
                        properties:
                          decision:
                            type: string
                            enum:
                            - KEEP_CURRENT_CODE
                            - LOWER_DUTY_OPTION_FOUND
                            - RECLASSIFICATION_RISK
                            - NEEDS_REVIEW
                          summary:
                            type: string
                          amountAtStakeUsd:
                            anyOf:
                            - type: number
                            - type: 'null'
                            description: Dollars saved or recoverable if the recommended action succeeds; null when it cannot be computed from the input.
                          amountBasis:
                            type: string
                          confidence:
                            type: string
                            enum:
                            - high
                            - medium
                            - low
                          nextStep:
                            type: string
                      lowerDutyOptions:
                        type: array
                        description: Alternatives and engineering options whose MFN rate is lower than the primary, best saving first.
                        items:
                          type: object
                      reclassificationRisk:
                        type: object
                        description: present is true when a strong or moderate alternative carries a higher MFN rate than the primary; exposureUsd is the extra duty on customsValueUsd.
                      classificationChecks:
                        type: array
                        description: Code-level checks against the official schedule, e.g. a specific sibling subheading matching your description of the goods.
                        items:
                          type: object
                      fees:
                        type: array
                        description: Merchandise processing and harbor maintenance fees, computed in code and kept out of the duty rate.
                        items:
                          type: object
                      warnings:
                        type: array
                        items:
                          type: string
                      disclaimer:
                        type: string
                      currentHtsCodeCheck:
                        type: object
                        additionalProperties: false
                        required:
                        - htsCode
                        - description
                        - adValoremPct
                        - rateText
                        - reasoning
                        properties:
                          htsCode:
                            type: string
                            description: Destination tariff code, 6-10 digits (e.g. 6404.11.90).
                          description:
                            type: string
                            description: Heading/subheading text.
                          adValoremPct:
                            type: number
                            description: General ad valorem duty rate in percent; -1 if specific or compound.
                          rateText:
                            type: string
                            description: Rate as written, including specific components.
                          reasoning:
                            type: string
                            description: GRI analysis, section/chapter notes, and any relevant rulings.
                          rate_source:
                            type: string
                            enum:
                            - usitc_hts
                            - model
                            description: 'usitc_hts: description and rate come from the official HTS line; model: the model''s recollection.'
                          hts_status:
                            type: string
                            enum:
                            - found
                            - not_final
                            - not_found
                            - lookup_failed
                            - invalid_format
                            - not_checked
                          hts_note:
                            type: string
                          rate_kind:
                            type: string
                            enum:
                            - free
                            - ad_valorem
                            - specific
                            - compound
                            - other
                          units:
                            type: array
                            items:
                              type: string
                          origin_preference:
                            type: object
                            description: Special-column rate listing the origin country; informational, not applied to the estimate.
                          nearest_codes:
                            type: array
                            items:
                              type: object
                            description: Real HTS lines sharing the longest prefix with a code that does not exist.
                          candidates:
                            type: array
                            items:
                              type: object
                            description: Final 8-digit lines under a heading or subheading code.
                      estimate:
                        type: object
                  _provenance:
                    type: object
                    description: C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance
                required:
                - data
                - _provenance
        '400':
          description: Invalid request (no payment consumed)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
        '401':
          description: Invalid X-API-KEY
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
        '402':
          description: Payment required or invalid
          content:
            application/json:
              schema:
                type: object
                description: x402 v2 PaymentRequired (also base64 in the PAYMENT-REQUIRED header)
                properties:
                  x402Version:
                    type: integer
                  error:
                    type: string
                  code:
                    type: string
                  resource:
                    type: object
                  accepts:
                    type: array
                    items:
                      type: object
                  extensions:
                    type: object
        '502':
          description: Upstream failure; the payment is released or not settled
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
      tags:
      - Optimize Tariff
components:
  securitySchemes:
    x402:
      type: apiKey
      in: header
      name: PAYMENT-SIGNATURE
      description: x402 v2 payment payload (base64) sent after a 402 challenge
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY