treg.to Hub API

The Hub API from treg.to — 7 operation(s) for hub.

GitHub OpenAPI

Operations 10

POST /hub/tools Publish Hub Tool #
PUT /hub/tools/{tool_id} Update Hub Tool #
GET /hub/tools/{tool_id} Get Hub Tool #
DELETE /hub/tools/{tool_id} Retire Hub Tool #
PATCH /hub/tools/{tool_id} Set Hub Tool Price #
GET /hub/tools/mine My Hub Tools #
GET /hub/runs/{run_id} Hub Run #
POST /hub/run Run Hub Folder #
GET /hub/tools/{tool_id}/earnings Hub Tool Earnings #
GET /hub/tools/{tool_id}/health Hub Tool Health #

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/treg-to:treg-to-hub-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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

treg-to-hub-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: treg Hub API
  version: 0.0.1
tags:
- name: Hub
paths:
  /hub/tools:
    post:
      summary: Publish Hub Tool
      description: 'Create (or add a version to) a hub tool: validate the four files, store the version, run

        check.json once for real on the maker''s balance. Live on pass; `failed` with the reason on

        fail — the version is kept so the maker can read what happened.'
      operationId: publish_hub_tool_hub_tools_post
      parameters:
      - name: x-treg-token
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Token
      - name: x-treg-org
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Org
      - name: treg_session
        in: cookie
        required: false
        schema:
          type: string
          default: ''
          title: Treg Session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishIn'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Publish Hub Tool Hub Tools Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Hub
  /hub/tools/{tool_id}:
    put:
      summary: Update Hub Tool
      description: 'A new version of an existing tool of yours (the same body as POST). The newest live

        version serves by default; `@N` pins an older one for 30 days after a newer one lands.'
      operationId: update_hub_tool_hub_tools__tool_id__put
      parameters:
      - name: tool_id
        in: path
        required: true
        schema:
          type: string
          title: Tool Id
      - name: x-treg-token
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Token
      - name: x-treg-org
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Org
      - name: treg_session
        in: cookie
        required: false
        schema:
          type: string
          default: ''
          title: Treg Session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Update Hub Tool Hub Tools  Tool Id  Put
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Hub
    get:
      summary: Get Hub Tool
      description: 'One version, the newest unless the id carries `@N`. Any status: the maker sees their own

        unchecked and failed versions; other teams see only live ones (the public page is phase 7).'
      operationId: get_hub_tool_hub_tools__tool_id__get
      parameters:
      - name: tool_id
        in: path
        required: true
        schema:
          type: string
          title: Tool Id
      - name: x-treg-token
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Token
      - name: x-treg-org
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Org
      - name: treg_session
        in: cookie
        required: false
        schema:
          type: string
          default: ''
          title: Treg Session
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Get Hub Tool Hub Tools  Tool Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Hub
    delete:
      summary: Retire Hub Tool
      description: 'Retire every version of one of your team''s tools: off the call road at once, the rows kept

        (earnings and run history stay readable).'
      operationId: retire_hub_tool_hub_tools__tool_id__delete
      parameters:
      - name: tool_id
        in: path
        required: true
        schema:
          type: string
          title: Tool Id
      - name: x-treg-token
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Token
      - name: x-treg-org
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Org
      - name: treg_session
        in: cookie
        required: false
        schema:
          type: string
          default: ''
          title: Treg Session
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Retire Hub Tool Hub Tools  Tool Id  Delete
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Hub
    patch:
      summary: Set Hub Tool Price
      description: 'Change the seller''s price and/or the listing switches of the newest live version; applies

        to later runs, no version bump. The reply carries exactly the fields that were set.'
      operationId: set_hub_tool_price_hub_tools__tool_id__patch
      parameters:
      - name: tool_id
        in: path
        required: true
        schema:
          type: string
          title: Tool Id
      - name: x-treg-token
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Token
      - name: x-treg-org
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Org
      - name: treg_session
        in: cookie
        required: false
        schema:
          type: string
          default: ''
          title: Treg Session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PriceIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Set Hub Tool Price Hub Tools  Tool Id  Patch
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Hub
  /hub/tools/mine:
    get:
      summary: My Hub Tools
      description: 'Every version of the team''s tools, newest first, each with its derived health and the

        tool''s last-30-day numbers (runs by others, earned) so the dashboard list needs one call.'
      operationId: my_hub_tools_hub_tools_mine_get
      parameters:
      - name: x-treg-token
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Token
      - name: x-treg-org
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Org
      - name: treg_session
        in: cookie
        required: false
        schema:
          type: string
          default: ''
          title: Treg Session
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: true
                title: Response My Hub Tools Hub Tools Mine Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Hub
  /hub/runs/{run_id}:
    get:
      summary: Hub Run
      description: 'One finished run. The CALLER''s team sees what it paid, the inputs, the trace and the

        output. The MAKER''s team sees the run of its tool: inputs (secret inputs masked), the trace,

        the script''s log lines and the failure''s error body, never the caller''s identity or the

        output. Anyone else: 404.'
      operationId: hub_run_hub_runs__run_id__get
      parameters:
      - name: run_id
        in: path
        required: true
        schema:
          type: string
          title: Run Id
      - name: x-treg-token
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Token
      - name: x-treg-org
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Org
      - name: treg_session
        in: cookie
        required: false
        schema:
          type: string
          default: ''
          title: Treg Session
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Hub Run Hub Runs  Run Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Hub
  /hub/run:
    post:
      summary: Run Hub Folder
      operationId: run_hub_folder_hub_run_post
      parameters:
      - name: x-treg-token
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Token
      - name: x-treg-org
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Org
      - name: treg_session
        in: cookie
        required: false
        schema:
          type: string
          default: ''
          title: Treg Session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Hub
  /hub/tools/{tool_id}/earnings:
    get:
      summary: Hub Tool Earnings
      description: 'The seller''s view: per day, runs,

        successes, failures and what was earned, for one of the team''s tools. Counts and amounts only;

        never who called. `format=csv` for a download.'
      operationId: hub_tool_earnings_hub_tools__tool_id__earnings_get
      parameters:
      - name: tool_id
        in: path
        required: true
        schema:
          type: string
          title: Tool Id
      - name: days
        in: query
        required: false
        schema:
          type: integer
          default: 90
          title: Days
      - name: format
        in: query
        required: false
        schema:
          type: string
          default: json
          title: Format
      - name: x-treg-token
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Token
      - name: x-treg-org
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Org
      - name: treg_session
        in: cookie
        required: false
        schema:
          type: string
          default: ''
          title: Treg Session
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Hub
  /hub/tools/{tool_id}/health:
    get:
      summary: Hub Tool Health
      description: 'The maker''s health view: the derived state, the last check, and the last runs.'
      operationId: hub_tool_health_hub_tools__tool_id__health_get
      parameters:
      - name: tool_id
        in: path
        required: true
        schema:
          type: string
          title: Tool Id
      - name: x-treg-token
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Token
      - name: x-treg-org
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Treg-Org
      - name: treg_session
        in: cookie
        required: false
        schema:
          type: string
          default: ''
          title: Treg Session
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Hub Tool Health Hub Tools  Tool Id  Health Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Hub
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PriceIn:
      properties:
        price_usd:
          anyOf:
          - type: number
          - type: 'null'
          title: Price Usd
        listed:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Listed
        public_log:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Public Log
      additionalProperties: false
      type: object
      title: PriceIn
      description: 'One PATCH, three knobs of the newest live version, none bumps the version: the seller''s

        price, and the two distribution switches. At least one.'
    RunIn:
      properties:
        manifest:
          additionalProperties: true
          type: object
          title: Manifest
        script:
          anyOf:
          - type: string
            maxLength: 200000
          - type: 'null'
          title: Script
        check:
          additionalProperties: true
          type: object
          title: Check
        readme:
          type: string
          maxLength: 4000
          minLength: 1
          title: Readme
        data:
          anyOf:
          - type: string
            maxLength: 50000000
          - type: 'null'
          title: Data
        inputs:
          additionalProperties: true
          type: object
          title: Inputs
      additionalProperties: false
      type: object
      required:
      - manifest
      - check
      - readme
      title: RunIn
      description: 'A dry run of a folder: the four files plus the inputs. Nothing is stored; every step is

        real and charged to the maker (`treg hub run .`).'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    PublishIn:
      properties:
        manifest:
          additionalProperties: true
          type: object
          title: Manifest
        script:
          anyOf:
          - type: string
            maxLength: 200000
          - type: 'null'
          title: Script
        check:
          additionalProperties: true
          type: object
          title: Check
        readme:
          type: string
          maxLength: 4000
          minLength: 1
          title: Readme
        data:
          anyOf:
          - type: string
            maxLength: 50000000
          - type: 'null'
          title: Data
      additionalProperties: false
      type: object
      required:
      - manifest
      - check
      - readme
      title: PublishIn
      description: The four files a maker ships, as fields. Same shape as the folder, one request.