Pieces QGPT API

Pieces Copilot generative engine (question, relevance, stream).

Operations 4

POST /qgpt/question Ask the Copilot a question grounded in relevant snippets. #
POST /qgpt/relevance Compute the snippets most relevant to a query. #
POST /qgpt/reprompt Reprompt the Copilot within an ongoing exchange. #
GET /qgpt/stream Streamed Copilot answers over a WebSocket connection. #

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/pieces-qgpt-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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

pieces-qgpt-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Pieces OS Local Applications QGPT API
  description: The Pieces OS local REST API. Pieces OS is an on-device process that runs on the developer's machine and serves this API over the loopback interface at http://localhost:1000. It backs the Pieces Copilot, saved snippets (assets), local and cloud model management, and workspace context, and is the source of the official OpenAPI-generated SDKs. This document captures the core documented resources (assets, formats, copilot/QGPT, conversations, models, applications, user, and well-known). For the complete machine-generated specification see the upstream pieces-os-client-openapi-spec repository.
  termsOfService: https://pieces.app/legal/terms
  contact:
    name: Pieces Support
    url: https://docs.pieces.app
  version: '1.0'
servers:
- url: http://localhost:1000
  description: Default on-device Pieces OS port (loopback only).
- url: http://localhost:5323
  description: Alternate on-device Pieces OS port.
tags:
- name: QGPT
  description: Pieces Copilot generative engine (question, relevance, stream).
paths:
  /qgpt/question:
    post:
      operationId: qgptQuestion
      tags:
      - QGPT
      summary: Ask the Copilot a question grounded in relevant snippets.
      description: Processes relevant code snippets or UUIDs (typically returned from /qgpt/relevance) along with a question query to produce scored answers.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QGPTQuestionInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QGPTQuestionOutput'
        '401':
          description: Invalid authentication.
        '429':
          description: Too many requests (rate limit or quota exceeded).
        '500':
          description: Internal server error.
        '503':
          description: Service unavailable (engine overloaded).
  /qgpt/relevance:
    post:
      operationId: qgptRelevance
      tags:
      - QGPT
      summary: Compute the snippets most relevant to a query.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QGPTRelevanceInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QGPTRelevanceOutput'
  /qgpt/reprompt:
    post:
      operationId: qgptReprompt
      tags:
      - QGPT
      summary: Reprompt the Copilot within an ongoing exchange.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
  /qgpt/stream:
    get:
      operationId: qgptStream
      tags:
      - QGPT
      summary: Streamed Copilot answers over a WebSocket connection.
      description: Provides a WebSocket connection (ws://localhost:1000/qgpt/stream) that streams inputs to the QGPT model and returns incremental answer chunks. Handles relevance and questions and manages multiple conversations. This is a WebSocket upgrade, not a plain HTTP request; the HTTP method is documented here for tooling completeness. See the AsyncAPI document for the message-oriented contract.
      responses:
        '101':
          description: Switching Protocols (WebSocket upgrade).
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QGPTStreamOutput'
components:
  schemas:
    QGPTQuestionInput:
      type: object
      properties:
        query:
          type: string
        relevant:
          $ref: '#/components/schemas/QGPTRelevanceOutput'
        model:
          type: string
        application:
          type: string
    QGPTQuestionOutput:
      type: object
      properties:
        answers:
          type: object
          properties:
            iterable:
              type: array
              items:
                type: object
                properties:
                  text:
                    type: string
                  score:
                    type: number
    QGPTRelevanceOutput:
      type: object
      properties:
        iterable:
          type: array
          items:
            type: object
            properties:
              seed:
                type: object
              score:
                type: number
    QGPTRelevanceInput:
      type: object
      properties:
        query:
          type: string
        seeds:
          type: object
    QGPTStreamOutput:
      type: object
      properties:
        question:
          type: object
        status:
          type: string
        conversation:
          type: string