Phở Chat Runs API

The Runs API from Phở Chat — 5 operation(s) for runs.

GitHub OpenAPI

Operations 6

POST /runs Start an agent run #
GET /runs Your recent agent runs, newest first #
GET /runs/{runId} A run, with its artifacts #
GET /runs/{runId}/events Follow a run: Server-Sent Events, or a JSON page with format=json #
POST /runs/{runId}/cancel Stop a run on the server (credits refunded if no model call finished) #
POST /runs/{runId}/retry Re-run the step a run failed on (status needs_user_input), same run, no new… #

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/pho-chat:pho-chat-runs-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

pho-chat-runs-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Phở Agent Runs API
  version: 1.0.0
  description: 'Start a Phở research agent from any harness, follow it live, and take the report away. Authenticate with a key from https://pho.chat/settings (API keys): `Authorization: Bearer pho_sk_…`. Runs use your own provider key (BYOK, 0 credits) when you saved one for a provider the agent supports, otherwise Phở’s default model (charged in credits). Agent runs need a paid plan.'
servers:
- url: https://api.pho.chat/v1
security:
- bearer: []
tags:
- name: Runs
paths:
  /runs:
    post:
      operationId: createRun
      summary: Start an agent run
      description: 'Idempotent with the `Idempotency-Key` header: the same key returns the same run (200) instead of starting a second one (201). Runs always start in auto mode (no approval step).'
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
          pattern: ^[A-Za-z0-9_.:-]{1,200}$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRun'
      responses:
        '200':
          description: 'Same Idempotency-Key: the existing run'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
        '201':
          description: Run started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
        '400':
          description: Invalid request or webhook_url
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, unknown or revoked key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Not enough credits for a run on Phở’s key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Plan cannot start agent runs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Unknown agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: A provider key is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit or daily limit reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Runs
    get:
      operationId: listRuns
      summary: Your recent agent runs, newest first
      parameters:
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 50
          default: 20
      responses:
        '200':
          description: Runs
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    const: list
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Run'
      tags:
      - Runs
  /runs/{runId}:
    get:
      operationId: getRun
      summary: A run, with its artifacts
      parameters:
      - $ref: '#/components/parameters/RunId'
      responses:
        '200':
          description: Run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunDetail'
        '404':
          description: No such run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Runs
  /runs/{runId}/events:
    get:
      operationId: runEvents
      summary: 'Follow a run: Server-Sent Events, or a JSON page with format=json'
      description: 'SSE frames carry `id: `. The stream closes after ~110 s with `run.stream_window_closed`; reconnect with `Last-Event-ID` (or `?since=`). It ends with `run.finished` once the run is completed, failed or cancelled.'
      parameters:
      - $ref: '#/components/parameters/RunId'
      - name: since
        in: query
        schema:
          type: integer
          minimum: 0
      - name: format
        in: query
        schema:
          type: string
          enum:
          - sse
          - json
      - name: Last-Event-ID
        in: header
        schema:
          type: string
      responses:
        '200':
          description: Event stream or page
          content:
            text/event-stream:
              schema:
                type: string
            application/json:
              schema:
                $ref: '#/components/schemas/EventPage'
        '404':
          description: No such run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Runs
  /runs/{runId}/cancel:
    post:
      operationId: cancelRun
      summary: Stop a run on the server (credits refunded if no model call finished)
      parameters:
      - $ref: '#/components/parameters/RunId'
      responses:
        '200':
          description: Cancelled (or already finished)
        '404':
          description: No such run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Runs
  /runs/{runId}/retry:
    post:
      operationId: retryRun
      summary: Re-run the step a run failed on (status needs_user_input), same run, no new…
      parameters:
      - $ref: '#/components/parameters/RunId'
      responses:
        '200':
          description: Retry fired
        '404':
          description: No such run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Run is not parked on a failed step
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Runs
webhooks:
  runFinished:
    post:
      summary: Sent to webhook_url when a run completes, stops early, fails, or waits for you
      description: 'Header `Pho-Signature: t=,v1=` where v1 = HMAC-SHA256(your pho_sk_ key, `${t}.${raw body}`). Reject if the timestamp is older than 5 minutes. Dedupe on `id`. Respond 2xx; a 5xx or timeout is retried once.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEvent'
      responses:
        '200':
          description: Received
      tags:
      - Runs
components:
  schemas:
    Artifact:
      type: object
      properties:
        id:
          type: string
          format: uuid
        object:
          const: artifact
        run_id:
          type: string
          format: uuid
        type:
          type: string
        title:
          type: string
        status:
          type: string
        created_at:
          type: string
          format: date-time
    CreateRun:
      type: object
      required:
      - agent
      - input
      additionalProperties: false
      properties:
        agent:
          type: string
          examples:
          - research-writer
        input:
          type: string
          minLength: 8
          maxLength: 4000
          examples:
          - SGLT2 inhibitors and heart failure hospitalisation in type 2 diabetes
        locale:
          type: string
          enum:
          - vi
          - en
        inputs:
          type: object
          additionalProperties: false
          properties:
            goal_title:
              type: string
              maxLength: 200
            deliverable:
              type: string
              enum:
              - review
              - table
              - brief
            scope:
              type: array
              maxItems: 8
              items:
                type: string
                maxLength: 160
            year_from:
              type: integer
              minimum: 1900
              maximum: 2100
        model:
          type: object
          required:
          - provider
          - model
          properties:
            provider:
              type: string
            model:
              type: string
        webhook_url:
          type: string
          format: uri
          description: https, public host, default port
    Event:
      type: object
      properties:
        seq:
          type: integer
        type:
          type: string
          examples:
          - step.started
          - model.completed
          - run.completed
        phase:
          type:
          - string
          - 'null'
        message:
          type:
          - string
          - 'null'
          description: Human sentence (Vietnamese today). Key off `type`, not this.
        step:
          type:
          - string
          - 'null'
        data:
          type: object
        created_at:
          type: string
          format: date-time
    EventPage:
      type: object
      properties:
        object:
          const: list
        status:
          type: string
        last_seq:
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/Event'
    RunDetail:
      allOf:
      - $ref: '#/components/schemas/Run'
      - type: object
        properties:
          artifacts:
            type: array
            items:
              $ref: '#/components/schemas/Artifact'
          pending_approvals:
            type: integer
    Error:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - code
          - message
          properties:
            code:
              type: string
            message:
              type: string
            message_vi:
              type: string
            details:
              type: object
    Run:
      type: object
      properties:
        id:
          type: string
          format: uuid
        object:
          const: run
        agent:
          type:
          - string
          - 'null'
        status:
          type: string
          enum:
          - queued
          - planning
          - awaiting_plan_approval
          - running
          - awaiting_approval
          - paused
          - needs_user_input
          - completed
          - failed
          - cancelled
        mode:
          type: string
        model:
          type:
          - string
          - 'null'
        credential_source:
          type:
          - string
          - 'null'
          enum:
          - byok
          - platform
          - null
        goal:
          type:
          - string
          - 'null'
        usage: {}
        result: {}
        error:
          type:
          - string
          - 'null'
        last_seq:
          type: integer
        webhook_url:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
        started_at:
          type:
          - string
          - 'null'
          format: date-time
        finished_at:
          type:
          - string
          - 'null'
          format: date-time
    WebhookEvent:
      type: object
      properties:
        id:
          type: string
        object:
          const: event
        type:
          type: string
          enum:
          - run.completed
          - run.incomplete
          - run.failed
          - run.needs_input
        created_at:
          type: string
          format: date-time
        data:
          type: object
          properties:
            run:
              $ref: '#/components/schemas/Run'
  parameters:
    RunId:
      name: runId
      in: path
      required: true
      schema:
        type: string
        format: uuid
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: pho_sk_…