PyAI MCP API

The MCP API from PyAI — 10 operation(s) for mcp.

GitHub OpenAPI

Operations 10

GET /.well-known/oauth-protected-resource Discover PyAI MCP authorization #
GET /.well-known/oauth-protected-resource/mcp Discover authorization for the MCP endpoint #
GET /.well-known/oauth-protected-resource/mcp/transcription Discover transcription and call-records connector authorization #
GET /.well-known/oauth-authorization-server Discover OAuth endpoints and S256 PKCE support #
POST /auth/mcp/register Register an MCP OAuth public client #
GET /auth/mcp/authorize Start browser OAuth consent #
POST /auth/mcp/token Exchange an authorization code or rotate a refresh token #
POST /auth/mcp/revoke Revoke an MCP OAuth connection using a token #
POST /mcp/transcription Transcription and existing call-records MCP endpoint #
POST /mcp PyAI MCP Streamable HTTP endpoint #

Specifications

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/pyai-com:pyai-com-mcp-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

pyai-com-mcp-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PyAI MCP API
  version: 2.14.0
  description: 'Telephony-native Voice AI behind one bearer key:


    - **Hear**, speech-to-text · `POST /v1/audio/transcriptions` (streaming + batch)

    - **Speak**, text-to-speech · `POST /v1/audio/speech`, `GET /v1/voices`

    - **Clone**, custom voices from a short clip · `/v1/voice/clones`

    - **Cast**, auto-directed expressive voiceovers · `/v1/cast`

    - **Dub**, asynchronous audio and video dubbing · `POST /v1/dub` (guide)

    - **Cue configuration frames (reserved)**; Hear streams skip knowledge-base retrieval by default

    - **Omni**, full-duplex agentic voice (speech-to-speech, grounded in your knowledge bases + tools) · `/v1/omni`

    - **Knowledge Bases**, hosted grounding for Omni: create bases, add documents (file, URL, or text), crawl a public website, bind to agents or org defaults · `/v1/knowledgebases`

    - **AMD API**, answering-machine detection: know *who or what* answered a call (human, voicemail, IVR, iPhone/Google screening, dead number) with the reason it decided · `wss …/v1/amd/stream` (Twilio Media Streams drop-in), `POST /v1/amd/config`, `GET /v1/amd/calls/{id}`

    - **Agents Beta**, the live console feature to create, configure, test, and connect Omni voice agents without code. Beta features and limits may change. ## Identity, billing and authentication

    - Before any generation or transcription, call GET /v1/me (MCP: whoami). Verify org_id, project_id, environment, scopes, limits and billing/credit context against the intended project. Do not infer identity or free usage from a key prefix or tool name. Stop on a mismatch or unknown budget; never switch to a live project automatically. - Test usage has enforced limits; live usage is billed. Current meters and rates: https://pyai.com/pricing. Agree a bounded input/request count before generating, and do not retry uncertain billable submissions blindly. Create a key in the console (it is shown once) and send it as a bearer token:


    ```

    Authorization: Bearer pyai_live_... ```


    Keys are environment-scoped: `pyai_live_...` (production) and `pyai_test_...` (sandbox). `POST /v1/sandbox/keys` creates an instant, short-lived test key without login or billing. Account signup also creates a sandbox key. Live keys consume prepaid credit; phone verification may unlock promotional credit under graduated-signup rules, but credit is not guaranteed at signup. Keys are self-validating signed tokens: they work on every PyAI surface the instant they are created, no activation or propagation delay. Treat them as opaque strings (up to 512 chars) and never parse their contents. Keep long-lived keys on trusted servers. For Omni browsers, mint an origin-locked short-lived token on your backend with POST /v1/omni/sessions; never expose a live or test API key in browser code. Offer the protocol marker and session token:


    ```

    Sec-WebSocket-Protocol: pyai.v1, pyai-key. ```


    (server-side clients may instead append `?api_key=...` to the URL). Your key is authenticated on the upgrade and never reaches the model. ## Quickstart, Hear (speech-to-text)


    ```

    curl https://api.pyai.com/v1/audio/transcriptions \

    -H "Authorization: Bearer $PYAI_API_KEY" \

    -F file=@audio.wav -F model=pyai-hear

    # -> { "text": "..." }

    ```


    ## Quickstart, Speak (text-to-speech)


    ```

    curl https://api.pyai.com/v1/audio/speech \

    -H "Authorization: Bearer $PYAI_API_KEY" \

    -H "Content-Type: application/json" \

    -d ''{"model":"pyai-speak","input":"Hello from PyAI.","voice":"voice_abc"}'' \

    --output speech.wav

    ```


    `voice` is a stock voice id from `GET /v1/voices` (the curated prebuilt catalog with personas and avatars) or a cloned voice id from `/v1/voice/clones`. Omit it to use the platform default voice (`stock_dorit_en_us`).'
  contact:
    name: PyAI
    url: https://pyai.com
servers:
- url: https://api.pyai.com
  description: Production
security:
- apiKey: []
- xApiKey: []
tags:
- name: MCP
paths:
  /.well-known/oauth-protected-resource:
    get:
      tags:
      - MCP
      operationId: getMcpResourceMetadata
      summary: Discover PyAI MCP authorization
      security: []
      responses:
        '200':
          description: Canonical MCP audience, issuer and supported permissions.
          content:
            application/json:
              schema:
                type: object
  /.well-known/oauth-protected-resource/mcp:
    get:
      tags:
      - MCP
      operationId: getMcpPathResourceMetadata
      summary: Discover authorization for the MCP endpoint
      security: []
      responses:
        '200':
          description: MCP protected-resource metadata.
          content:
            application/json:
              schema:
                type: object
  /.well-known/oauth-protected-resource/mcp/transcription:
    get:
      tags:
      - MCP
      operationId: getTranscriptionMcpResourceMetadata
      summary: Discover transcription and call-records connector authorization
      security: []
      responses:
        '200':
          description: Separate resource audience with hear:transcribe, transcribe:jobs and omni:read permissions.
          content:
            application/json:
              schema:
                type: object
  /.well-known/oauth-authorization-server:
    get:
      tags:
      - MCP
      operationId: getMcpAuthorizationMetadata
      summary: Discover OAuth endpoints and S256 PKCE support
      security: []
      responses:
        '200':
          description: OAuth authorization server metadata.
          content:
            application/json:
              schema:
                type: object
  /auth/mcp/register:
    post:
      tags:
      - MCP
      operationId: registerMcpClient
      summary: Register an MCP OAuth public client
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - redirect_uris
              properties:
                client_name:
                  type: string
                  maxLength: 100
                redirect_uris:
                  type: array
                  description: Exact HTTPS or HTTP loopback callback URIs, or the supported fixed Cursor desktop return URIs. Custom schemes are not accepted generally. S256 PKCE and project consent are required for every client.
                  minItems: 1
                  maxItems: 10
                  items:
                    type: string
                    format: uri
                token_endpoint_auth_method:
                  const: none
      responses:
        '201':
          description: Registered public client. No client secret is issued.
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid client metadata.
          content:
            application/json:
              schema:
                type: object
  /auth/mcp/authorize:
    get:
      tags:
      - MCP
      operationId: authorizeMcpClient
      summary: Start browser OAuth consent
      security: []
      description: Authorization code with S256 PKCE, exact registered redirect URI and resource=https://api.pyai.com/mcp or https://api.pyai.com/mcp/transcription. Returns to the approved client with state and issuer identification.
      parameters:
      - name: client_id
        in: query
        required: true
        schema:
          type: string
      - name: redirect_uri
        in: query
        required: true
        schema:
          type: string
      - name: response_type
        in: query
        required: true
        schema:
          type: string
      - name: code_challenge
        in: query
        required: true
        schema:
          type: string
      - name: code_challenge_method
        in: query
        required: true
        schema:
          type: string
      - name: resource
        in: query
        required: true
        schema:
          type: string
      responses:
        '302':
          description: Continue in the PyAI console.
        '400':
          description: Invalid authorization request.
          content:
            application/json:
              schema:
                type: object
  /auth/mcp/token:
    post:
      tags:
      - MCP
      operationId: exchangeMcpToken
      summary: Exchange an authorization code or rotate a refresh token
      security: []
      description: Form-encoded OAuth code or refresh exchange. Tokens are restricted to the MCP resource. Access tokens expire after 15 minutes; connections last up to 30 days. Refresh reuse revokes the connection.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - client_id
              - grant_type
              - resource
              properties:
                client_id:
                  type: string
                grant_type:
                  enum:
                  - authorization_code
                  - refresh_token
                resource:
                  enum:
                  - https://api.pyai.com/mcp
                  - https://api.pyai.com/mcp/transcription
                code:
                  type: string
                redirect_uri:
                  type: string
                code_verifier:
                  type: string
                refresh_token:
                  type: string
      responses:
        '200':
          description: OAuth token response, never an API key.
          content:
            application/json:
              schema:
                type: object
        '400':
          description: OAuth error. Reconnect for invalid_grant.
          content:
            application/json:
              schema:
                type: object
  /auth/mcp/revoke:
    post:
      tags:
      - MCP
      operationId: revokeMcpToken
      summary: Revoke an MCP OAuth connection using a token
      security: []
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - token
              - client_id
              properties:
                token:
                  type: string
                client_id:
                  type: string
      responses:
        '200':
          description: Revoked or already unavailable.
          content:
            application/json:
              schema:
                type: object
  /mcp/transcription:
    post:
      tags:
      - MCP
      operationId: callTranscriptionMcp
      summary: Transcription and existing call-records MCP endpoint
      description: Public initialize and tools/list; every tool call requires OAuth. Separate OAuth audience and fixed tool allowlist. Transcribes authorized audio and reads existing call records. Cannot generate audio, configure agents, place calls or provision numbers.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: MCP JSON-RPC response.
          content:
            application/json:
              schema:
                type: object
        '202':
          description: Notification accepted.
        '401':
          description: OAuth required for this exact resource audience.
  /mcp:
    post:
      tags:
      - MCP
      operationId: callMcp
      summary: PyAI MCP Streamable HTTP endpoint
      description: Use a standards-compliant MCP client. Initialize, initialization notification, ping and tools/list are public without credentials by default. Cursor setup uses ?auth=required to require OAuth from initialization, so its normal login command obtains project consent before reporting ready. The OAuth resource remains https://api.pyai.com/mcp. Every tool call and other method requires OAuth authentication; ordinary API keys are not accepted here. Tools cover Speak, Hear, voice Agent profiles, Trace, Recap, Dub and Cast. Stateless transport returns JSON responses; notifications return 202.
      parameters:
      - name: auth
        in: query
        required: false
        schema:
          type: string
          enum:
          - required
        description: Require browser OAuth even for initialization and catalog reads. Use for hosts that otherwise mistake public discovery for completed login.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: MCP JSON-RPC response.
          content:
            application/json:
              schema:
                type: object
        '202':
          description: Notification accepted.
        '401':
          description: OAuth required; WWW-Authenticate points to protected-resource metadata.
components:
  securitySchemes:
    interpretationUpload:
      type: http
      scheme: bearer
      description: Short-lived write-only upload_capability returned by POST /v1/audio/interpretations/recordings. Never use it for reads.
    sessionCookie:
      type: apiKey
      in: cookie
      name: pyai_session
      description: Console session cookie. PyAI-admin routes also require the configured platform-admin email allowlist.
    apiKey:
      type: http
      scheme: bearer
      description: 'Use `Authorization: Bearer pyai_live_...` (or `pyai_test_...`).'
    xApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Header alias for bearer auth on HTTP endpoints. WebSocket auth uses the subprotocol pair `pyai.v1, pyai-key.<API_KEY>`.
x-pyai-agent-notes:
  guide: https://pyai.com/agents/speech-calling.md
  omni_frames: https://api.pyai.com/omni-frames.json
  discovery: Inspect live operation schemas; preserve IDs and required Idempotency-Key headers. SDK-first for realtime. Never infer a simulated PSTN call endpoint.