Skip to content

Developers

From a key to your first decision.

A key, a first call to Helm’s general model, then a model of your own. Every request is plain HTTP, so curl is enough.

  1. Get a key

    Keys are issued on request. Ask us for one. Your keys are listed and revocable on your API keys page.

    Authorization: Bearer pt_live_<16 hex>_<43 base64url>
    export BASE=https://your-engine.example
    export PT_KEY=pt_live_...

    BASE is the API’s address: the Playground in the app shows a request as code with it filled in.

  2. Check the key

    curl -s "$BASE/v1/me" -H "Authorization: Bearer $PT_KEY"

    What this key is, and what is left of its day. Any valid key reaches it.

  3. Ask Helm’s general model

    POST /v1/systemone with "model": "helm-default" answers at once, with no model of your own. The key needs the spend scope: sealing an answer is a write.

    curl -s -X POST "$BASE/v1/systemone" \
      -H "Authorization: Bearer $PT_KEY" -H 'content-type: application/json' \
      -d '{
      "model": "helm-default",
      "state": "I was charged twice for the same order last week and nobody has answered my emails. Please help.",
      "questions": {
        "billing": {
          "type": "noul",
          "instructions": "Is this about billing?"
        },
        "tone": {
          "type": "choice",
          "instructions": "What is the tone?",
          "criteria": {
            "calm": null,
            "frustrated": null,
            "angry": null
          }
        }
      }
    }'
    
    # 200: {"model": "helm-default",
    #  "answers": {"billing": {"type": "noul", "noul": …},
    #              "tone": {"type": "choice", "choice": "…", "confidence": …, "probabilities": {…}}},
    #  "usage": {"input_tokens": …, "output_tokens": …},
    #  "helm": {"forecast_ids": {…}, "sealed_at": "…", "chain_hash": "…", …}}

    Each answer is sealed, one forecast per question, in your workspace’s general log. helm-default draws on your daily allowance rather than a per-token price.

  4. Build a model from your past decisions

    • In the app, open Models, choose New model, then From your data. Choose or upload a CSV of past decisions: at least 1,000 rows, each with the facts known at the time and what happened.
    • Helm proposes the outcome, the question and the role of every column on one screen. Confirm it and press Train: Helm runs its checks on the file, then trains the model.
    • The model’s page shows its short name, which is what model takes from here on.

    From code, once its checks have run: POST /v1/models/{model}/train. Train the Baseline from the model's checks, as the model page's Train does.

  5. Forecast with your model

    POST /v1/models/{model}/forecasts: Forecast 1–100 records with one of your models, each sealed with its reasons before it is returned.

    export MODEL=your-model   # the model's short name
    
    # What a record carries: its fields, and how each is read.
    curl -s "$BASE/v1/models/$MODEL/schema" -H "Authorization: Bearer $PT_KEY"
    
    # Forecast one record. "fields" holds the model's own fields, as the schema lists them.
    curl -s -X POST "$BASE/v1/models/$MODEL/forecasts" \
      -H "Authorization: Bearer $PT_KEY" -H 'content-type: application/json' \
      -d '{
      "records": [
        {
          "ref": "r1",
          "fields": {
            "<field>": "<value>"
          }
        }
      ]
    }'
    
    # 200: {"model": "…", "version": "…", "arm": "…", "answers": [
    #   {"ref": "r1", "forecast_id": "…", "probs": {…}, "reasons": […],
    #    "sealed_at": "…", "chain_hash": "sha256:…", "input_tokens": …}]}
    # One bad field refuses the whole call, names every problem in "rejected", and saves nothing.

    The same model answers on POST /v1/systemone too, one record at a time: send the record as state and ask its own question.

  6. Record what happened

    POST /v1/models/{model}/outcomes: Record what happened, by outcome key, so forecasts can be scored.

    curl -s -X POST "$BASE/v1/models/$MODEL/outcomes" \
      -H "Authorization: Bearer $PT_KEY" -H 'content-type: application/json' \
      -d '{
      "outcomes": [
        {
          "outcome_key": "<the outcome key of the record>",
          "outcome": "<an answer id>"
        }
      ]
    }'
    
    # "outcome" is one of the model's answer ids; the schema lists them.
    # A changed outcome replaces the earlier one; the history is kept.

    A forecast counts toward the model’s track record only when its outcome is recorded after the forecast was sealed.

    GET /v1/models/{model}/track-record: A version's live record over your resolved forecasts, beside its card.

Next