開発者向け

Explore Wrongthinking models and the API for integrating predictions and simulations into your application.

API v1

API エンドポイント

  • GET/v1/models

    統合に利用できるモデルのカタログを取得します。

  • POST/v1/predictions

    モデルと入力オブジェクトを指定して予測をリクエストします。

  • GET/v1/predictions/:id

    ステータスを確認し、結果を取得します。

すべてのエンドポイントを見る

クイックスタート

Try a demand forecast with Chronos-2 using your credentials.

The API accepts one asynchronous job per request. The body includes the model ID and its input object. Send the key in Authorization from your server.

  1. POST /v1/predictions入力を送信します。再試行する可能性がある場合は、冪等性キーを保存してください。
  2. 202 Accepted処理中は ID と結果の URL を保存しておきます。
  3. GET /v1/predictions/:idステータスを確認し、予測の完了後に結果を取得します。

ステータスの例 queued → running → completed / failed.

401 が返ったら API キーを確認してください。429 が返ったら、時間をおいて同じ冪等性キーで再試行してください。

HTTP リクエスト
POST /v1/predictions HTTP/1.1Host: wrongthinking.comAuthorization: Bearer <API_KEY>Content-Type: application/jsonIdempotency-Key: <REQUEST_KEY> {  "model": "chronos2",  "input": {    "values": [12, 15, 17, 16, 19, 18, 20, 24, 22, 25, 26, 29],    "horizon": 2  }}

認証

Create a key in Studio → Developers → API keys. Store it on your server and send it in the Authorization header.

HTTP
Authorization: Bearer <API_KEY>

API リファレンス

Check each model guide for inputs, Studio limits, and output format.

  • GET/v1/models

    統合に利用できるモデルのカタログを取得します。

  • POST/v1/predictions

    モデルと入力オブジェクトを指定して予測をリクエストします。

  • GET/v1/predictions/:id

    ステータスを確認し、結果を取得します。

  • POST/v1/batches

    同じモデルに複数の入力を送信します。

  • GET/v1/batches/:id

    バッチのステータスと各項目の結果を確認します。

コールバック

callback_url is an optional HTTPS URL on your server. The event reports the terminal status and includes a reference for retrieving the response.

prediction.completed
予測が完了し、結果を取得できます。
prediction.failed
予測に失敗しました。エラーの内容はステータスを確認してください。
batch.completed
バッチが終了しました。一部成功の場合も、すべての項目を確認してください。

When integrating, verify the signature before accepting the event, deduplicate by ID, and return 2xx after recording it. Compute HMAC-SHA256 using your signing secret as text and Wrongthinking-Timestamp + a dot + the raw body. Compare the hex digest with Wrongthinking-Signature after v1=. Retries follow the previous failure after 1, 5 and 15 minutes.

予測イベント
{  "id": "evt_demo_001",  "type": "prediction.completed",  "data": {    "id": "pred_demo_001",    "model": "chronos2",    "status": "completed",    "result_url": "/v1/predictions/pred_demo_001"  }}
バッチ処理

同じモデルへの入力を items にまとめます。処理順が異なっても結果を対応づけられるよう、入力ごとに一意の custom_id を設定してください。

  1. POST /v1/batches入力を1件ずつ検証します。合計サイズや件数が上限を超える場合は、複数のバッチに分けます。
  2. GET /v1/batches/:id各項目のステータスを確認します。1つのバッチに成功と失敗が混在することがあります。
  3. custom_id成功した結果を保存し、再試行できる項目だけを新しいバッチにまとめます。

Each batch accepts 1–8 items, 512 KiB of JSON and 3 MiB of images combined. Up to two predictions run concurrently per account.

バッチリクエスト
POST /v1/batches HTTP/1.1Host: wrongthinking.comAuthorization: Bearer <API_KEY>Content-Type: application/jsonIdempotency-Key: <REQUEST_KEY> {  "model": "chronos2",  "items": [    {      "custom_id": "case-01",      "input": {        "values": [12, 15, 17, 16, 19, 18, 20, 24, 22, 25, 26, 29],        "horizon": 2      }    },    {      "custom_id": "case-02",      "input": {        "values": [12, 15, 17, 16, 19, 18, 20, 24, 22, 25, 26, 29],        "horizon": 2      }    }  ]}

モデル

Find a model by analysis type. Each guide includes its ID, fields, and API examples.

API 料金

料金を読み込み中…

Studio のプランを見る

Studio の開発者向けエリア

ログインしてアカウントの開発者向けエリアを開きます。