StayCharted Predictions API

Ask a customer's published model, one record or a batch.

GitHub OpenAPI

Operations 5

POST /api/v1/customers/{customerId}/models/{modelId}/predict Ask the published model, one record or many #
POST /api/v1/customers/{customerId}/models/{modelId}/classify Ask the published model one record, flat answer #
POST /api/v1/customers/{customerId}/models/{modelId}/fills Start a batch fill #
GET /api/v1/customers/{customerId}/models/{modelId}/fills/{fillId} Fill progress, then the answers #
GET /api/v1/customers/{customerId}/models/{modelId}/fills/{fillId}/file Download the filled file #

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/staycharted-com:staycharted-com-predictions-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

staycharted-com-predictions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: StayCharted AI Model Trainer Partner Predictions API
  version: 1.0.0
  description: 'For **solution partners**: software companies that build StayCharted AI

    Model Trainer (AMT) into their own product under a Solution Partner

    Agreement. One partner key reaches every customer the partner manages,

    and nothing else.


    **What a partner can do by key**

    - Add customers. Each is its own StayCharted account with its own data

    area and one workspace on the plan you choose. **You pay first:** the

    card on your partner account is charged before the customer exists,

    and a declined card creates nothing.

    - Build, train, test and publish each customer''s models, send it rows to

    classify one at a time or as a batch fill, and work its Review Queue

    from inside your product.

    - Change a customer''s plan, add a workspace, hand the customer over so it

    deals with StayCharted directly, or cancel it.


    **Two kinds of customer.** `access: api` (the default) is a customer

    that uses AMT only through your product: no login, and your key does

    everything. `access: login` is a **resold** customer whose own people

    sign in to AMT: your key manages its plan and workspaces, and never its

    models or data (`partner.customer_signs_in`).


    **The key.** `Authorization: Bearer amt_partner_…`. StayCharted issues

    it; your account Owner receives a one-time link and sees it once. Up to

    two keys at a time, so you can replace one without downtime; either can

    be limited to IP addresses and revoked at once from your Partner page.

    Keep it in a secrets manager, on your servers only.


    **Limits.** 600 calls a minute per key, and 30 new customers a minute

    per partner, then `429` with `Retry-After`. Each customer also keeps its

    own plan''s allowances and rate limit, exactly as a direct customer has.


    **Errors.** JSON with a stable `code`. Branch on `code`, never on the

    `error` text, which is written for people and may be reworded. A

    customer, model or job that is not yours answers `404`, the same as one

    that does not exist.


    **Changes.** Additive changes (a new field, a new endpoint) can come at

    any time, so ignore fields you do not know. A breaking change to a

    documented endpoint or field comes with 60 days'' notice, as the

    Solution Partner Agreement says.


    **Activity.** Everything done by key appears in the customer''s Activity

    as "via (Partner API: )", and every prediction

    records it.


    Questions: partners@staycharted.com.'
  contact:
    name: StayCharted partner team
    email: partners@staycharted.com
    url: https://staycharted.com/partners
  termsOfService: https://staycharted.com/legal/terms
servers:
- url: https://amt.staycharted.com
  description: Production
security:
- partnerKey: []
tags:
- name: Predictions
  description: Ask a customer's published model, one record or a batch.
paths:
  /api/v1/customers/{customerId}/models/{modelId}/predict:
    parameters:
    - $ref: '#/components/parameters/customerId'
    - $ref: '#/components/parameters/modelId'
    post:
      tags:
      - Predictions
      operationId: predict
      summary: Ask the published model, one record or many
      description: 'As the Prediction API''s `predict` (openapi.yaml), under the customer''s

        path. `input` for one record, `inputs` for up to 100. Each record is

        a string, an object of the fields the model reads, or for a picture

        model a link or `{"imageBase64": "..."}`. Counted against the

        customer''s monthly predictions; the whole request is checked first,

        so it is refused whole rather than half served.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PredictRequest'
            example:
              inputs:
              - My card was charged twice for the same order
              - The parcel arrived damaged
      responses:
        '200':
          description: One prediction per record, in the order sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictResponse'
        '400':
          description: The records are missing or not the shape the model reads.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Send "input" with one string, or "inputs" with an array of them.
                code: api.input_required
        '402':
          $ref: '#/components/responses/PlanRefused'
        '409':
          description: The model is not published, or needs retraining.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: That model is not deployed yet.
                code: api.model_not_deployed
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/ModelNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/ModelUnavailable'
  /api/v1/customers/{customerId}/models/{modelId}/classify:
    parameters:
    - $ref: '#/components/parameters/customerId'
    - $ref: '#/components/parameters/modelId'
    post:
      tags:
      - Predictions
      operationId: classify
      summary: Ask the published model one record, flat answer
      description: One record, and every value of the answer a top-level key, for tools that bind fields from a list.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - input
              properties:
                input:
                  description: A string, an object of the fields the model reads, or for a picture model a link or {"imageBase64":"..."} (with "text" for a model that also reads text).
            example:
              input: My card was charged twice for the same order
      responses:
        '200':
          description: The answer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassifyResponse'
              example:
                label: Billing
                confidence: 0.94
                needsReview: false
                modelId: 8f14e45f-ceea-467a-9b2c-1d5c2b0e7a11
                modelName: Ticket routing
        '400':
          description: No input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Send "input" with the text to classify.
                code: api.input_missing
        '402':
          $ref: '#/components/responses/PlanRefused'
        '409':
          description: The model is not published, or needs retraining.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: That model is not deployed yet.
                code: api.model_not_deployed
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/ModelNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/ModelUnavailable'
  /api/v1/customers/{customerId}/models/{modelId}/fills:
    parameters:
    - $ref: '#/components/parameters/customerId'
    - $ref: '#/components/parameters/modelId'
    post:
      tags:
      - Predictions
      operationId: startFill
      summary: Start a batch fill
      description: 'For many records at once: `202` with a fill id, then poll

        `/fills/{fillId}`. Send JSON `rows` (each an object of the columns

        the model reads), or a file (`multipart/form-data`, field `file`): a

        CSV, a spreadsheet, or for a picture model a ZIP of pictures. A file

        can say which column to write the answer into with

        `?targetColumn=`; the default is "StayCharted category". Counted

        against the customer''s monthly predictions, like a fill in the app.'
      parameters:
      - name: targetColumn
        in: query
        required: false
        description: For a file, the name of the answer column. JSON rows always use "StayCharted category".
        schema:
          type: string
          maxLength: 120
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - rows
              properties:
                rows:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
            example:
              rows:
              - Subject: Charged twice
                Body: My card shows two payments for one order.
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '202':
          description: Queued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  fillId:
                    type:
                    - string
                    - 'null'
                    format: uuid
                  status:
                    type: string
                  rows:
                    type: integer
        '400':
          description: No rows, or rows that are not records.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 'Send rows: a list of records, each one the columns the model reads.'
                code: partner.fill_rows
        '402':
          $ref: '#/components/responses/PlanRefused'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/ModelNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
  /api/v1/customers/{customerId}/models/{modelId}/fills/{fillId}:
    parameters:
    - $ref: '#/components/parameters/customerId'
    - $ref: '#/components/parameters/modelId'
    - $ref: '#/components/parameters/fillId'
    get:
      tags:
      - Predictions
      operationId: getFill
      summary: Fill progress, then the answers
      description: When `status` is `completed`, `answers` holds one per row in the order sent, and `file` the path of the filled file.
      responses:
        '200':
          description: The fill.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Fill'
        '404':
          description: No such fill for this model.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: No such fill.
                code: partner.fill_not_found
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
  /api/v1/customers/{customerId}/models/{modelId}/fills/{fillId}/file:
    parameters:
    - $ref: '#/components/parameters/customerId'
    - $ref: '#/components/parameters/modelId'
    - $ref: '#/components/parameters/fillId'
    get:
      tags:
      - Predictions
      operationId: downloadFill
      summary: Download the filled file
      description: The rows as sent, with the answer, its confidence and whether it went for review in new columns, in the format sent.
      responses:
        '200':
          description: The filled file.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '404':
          description: No such fill, or it is not finished.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: No such fill.
                code: partner.fill_not_found
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Error:
      type: object
      required:
      - error
      - code
      properties:
        error:
          type: string
          description: For a person to read. May be reworded; do not match on it.
        code:
          type: string
          description: Stable. Branch on this.
        reasons:
          type: array
          items:
            type: object
            additionalProperties: true
          description: Present when the refusal has several causes.
    Prediction:
      type: object
      properties:
        input:
          description: The record, echoed back.
        label:
          type:
          - string
          - 'null'
        confidence:
          type:
          - number
          - 'null'
          description: 0 to 1.
        needsReview:
          type: boolean
          description: Below the model's review cutoff; the answer went to the Review Queue.
        labels:
          type: array
          items:
            type: string
          description: For a model whose answer is a list.
        fields:
          type: object
          additionalProperties:
            type: string
          description: For a model whose answer has several columns.
        error:
          type: string
          description: A picture that could not be used, as a code.
        message:
          type: string
    PlanError:
      type: object
      description: An Error caused by the customer's plan, with the limit that refused it.
      required:
      - error
      - code
      properties:
        error:
          type: string
        code:
          type: string
        entitlement:
          type:
          - string
          - 'null'
          description: Which plan limit refused this.
        limit:
          type:
          - integer
          - 'null'
        used:
          type:
          - integer
          - 'null'
        resetsAt:
          type:
          - string
          - 'null'
          format: date-time
          description: When a monthly allowance refills; null when waiting will not help.
    RateLimitError:
      type: object
      required:
      - error
      - code
      properties:
        error:
          type: string
        code:
          type: string
        retryAfter:
          type: integer
          description: Seconds to wait.
        retryAfterSeconds:
          type: integer
          description: The same, on a customer's own prediction limit.
    PredictResponse:
      type: object
      properties:
        model:
          type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
        predictions:
          type: array
          items:
            $ref: '#/components/schemas/Prediction'
        usage:
          type: object
          properties:
            predictions:
              type: integer
              description: Records counted by this request.
    Fill:
      type: object
      properties:
        fillId:
          type: string
          format: uuid
        status:
          type: string
          description: queued, running, completed, failed or cancelled.
        filled:
          type:
          - integer
          - 'null'
        total:
          type:
          - integer
          - 'null'
        failure:
          type:
          - string
          - 'null'
        answers:
          type: array
          description: Once completed, one per row, in the order sent.
          items:
            type: object
            properties:
              category:
                type:
                - string
                - 'null'
              confidence:
                type:
                - number
                - 'null'
        file:
          type: string
          description: Once completed, the path of the filled file.
    PredictRequest:
      type: object
      description: Exactly one of `input` or `inputs`; the server enforces it.
      properties:
        input:
          description: One record. A string, an object of the fields the model reads, or for a picture model a link or {"imageBase64":"..."}.
        inputs:
          type: array
          minItems: 1
          maxItems: 100
          description: Up to 100 records, each as `input` takes one (up to 20 pictures).
          items: {}
    ClassifyResponse:
      type: object
      properties:
        label:
          type:
          - string
          - 'null'
        confidence:
          type:
          - number
          - 'null'
        needsReview:
          type: boolean
        labels:
          type: array
          items:
            type: string
        fields:
          type: object
          additionalProperties:
            type: string
        modelId:
          type: string
          format: uuid
        modelName:
          type: string
        error:
          type: string
        message:
          type: string
  responses:
    RateLimited:
      description: Too many calls. Wait `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds to wait.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
          examples:
            key:
              value:
                error: A partner key may make 600 calls a minute. Slow down and retry.
                code: partner.rate_limited
                retryAfter: 12
            refusals:
              value:
                error: Too many requests with a missing or invalid partner key from this address. Wait a minute.
                code: partner.too_many_refusals
                retryAfter: 60
    Unauthorized:
      description: No partner key, or not a valid one. One answer for every kind of bad key; an address that keeps sending bad keys is told to wait (`429 partner.too_many_refusals`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              value:
                error: 'Send your partner key as: Authorization: Bearer amt_partner_….'
                code: partner.key_missing
            invalid:
              value:
                error: That partner key is not valid.
                code: partner.key_invalid
    ModelNotFound:
      description: No such customer of yours, or no such model of that customer.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: No such model for this customer.
            code: partner.model_not_found
    PlanRefused:
      description: The customer's plan does not allow this, or a monthly allowance is spent (`resetsAt` says when it refills).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlanError'
          example:
            error: This needs 40 predictions and 12 remain this billing period.
            code: plan.prediction_limit
            entitlement: predictionsPerMonth
            limit: 10000
            used: 9988
            resetsAt: '2026-11-26T00:00:00.000Z'
    Forbidden:
      description: The partner is suspended, the call came from an address the key does not allow, or the customer is resold and signs in itself.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            suspended:
              value:
                error: This partner’s access is suspended. Contact partners@staycharted.com.
                code: partner.suspended
            address:
              value:
                error: This key is not allowed from this address.
                code: partner.address_not_allowed
            signs_in:
              value:
                error: This customer’s own people sign in and use its models, so a partner key reaches its plan and workspaces only.
                code: partner.customer_signs_in
    ModelUnavailable:
      description: A service the model depends on is restarting. Nothing was counted; retry after a short wait.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: This model is temporarily unable to answer. Try again in a few minutes.
            code: api.model_unavailable
  parameters:
    modelId:
      name: modelId
      in: path
      required: true
      schema:
        type: string
        format: uuid
    fillId:
      name: fillId
      in: path
      required: true
      schema:
        type: string
        format: uuid
    customerId:
      name: customerId
      in: path
      required: true
      description: The customer's id, from `GET /api/v1/customers`.
      schema:
        type: string
        format: uuid
  securitySchemes:
    partnerKey:
      type: http
      scheme: bearer
      description: '`Authorization: Bearer amt_partner_…`. Issued by StayCharted; up to two live at once.'