treg.to Calls API

The Calls API from treg.to — 3 operation(s) for calls.

GitHub OpenAPI

Operations 3

GET /calls List Calls #
GET /calls/{call_id}/result Get Call Result #
GET /calls/{call_ref} Get Call #

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-calls-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-calls-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: treg Calls API
  version: 0.0.1
tags:
- name: Calls
paths:
  /calls:
    get:
      summary: List Calls
      description: 'This team''s recent calls. `days` windows it and `before_id` pages backwards — a builder

        reconciling a month cannot do it through a newest-first limit alone.


        Analytics, NOT an invoice: these rows are written fire-and-forget and the queue sheds them under

        load. Money comes from `/orgs/{id}/usage/by-tag`, which reads the ledger.'
      operationId: list_calls_calls_get
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 50
          title: Limit
      - name: days
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          title: Days
      - name: before_id
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          title: Before Id
      - name: api_key_id
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          title: Api Key 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: array
                items:
                  type: object
                  additionalProperties: true
                title: Response List Calls Calls Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Calls
  /calls/{call_id}/result:
    get:
      summary: Get Call Result
      description: 'What one of this team''s calls asked and what came back — the archive''s copy.


        `call_id` is either the audit row''s numeric `id` or the `X-Treg-Call-Id` the call returned (a

        32-hex call ref; a short all-digit value is the row id).


        A 2xx answer the archive recorded has one (see docs/context/architecture/archive.md): a metered

        platform call, or an own-key call whose answer fit the size cap while recording was on. The

        audit row keeps the identities of the provider''s bytes; a metered answer is returned as its

        caller received it: where treg removes the provider''s reported charge, without it unless this

        request sends `X-Treg-Keep-Reported-Charge: true`. Own-tool calls are

        relayed without being stored, a failed call never is, and the redacted failure evidence stays admin-only — `stored` is false

        with a `note` saying which. A routed call''s answer is its children''s: its row lists them in

        `children`, each readable here by its call ref. The request shape is the vendor-facing one

        BEFORE credential injection, so no secret can appear in it.'
      operationId: get_call_result_calls__call_id__result_get
      parameters:
      - name: call_id
        in: path
        required: true
        schema:
          type: string
          title: Call 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 Call Result Calls  Call Id  Result Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Calls
  /calls/{call_ref}:
    get:
      summary: Get Call
      description: 'One call by the `X-Treg-Call-Id` it returned — the join key for a builder''s own records.


        Also reports the LEDGER''s view of the same reference, because that is the durable one: the audit

        row is fire-and-forget and may have been shed, while the money entries were written synchronously.

        A 404 here therefore means "no audit row", not "this call never happened" — check `ledger` in the

        body before concluding anything about money.'
      operationId: get_call_calls__call_ref__get
      parameters:
      - name: call_ref
        in: path
        required: true
        schema:
          type: string
          title: Call Ref
      - 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 Call Calls  Call Ref  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Calls
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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