Nhà phát triển
Explore Wrongthinking models and the API for integrating predictions and simulations into your application.
API v1
Điểm cuối API
- GET
/v1/modelsXem danh mục mô hình để tích hợp.
- POST
/v1/predictionsGửi yêu cầu dự đoán kèm mô hình và đối tượng đầu vào.
- GET
/v1/predictions/:idKiểm tra trạng thái và lấy kết quả.
Bắt đầu nhanh
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.
POST /v1/predictionsGửi đầu vào và giữ khóa chống lặp nếu bạn định thử lại.202 AcceptedLưu ID và URL kết quả trong khi tác vụ đang chạy.GET /v1/predictions/:idKiểm tra trạng thái và đọc kết quả sau khi hoàn tất dự đoán.
Ví dụ trạng thái queued → running → completed / failed.
Nếu nhận mã 401, hãy kiểm tra khóa API. Nếu nhận mã 429, hãy chờ rồi thử lại bằng cùng khóa chống lặp.
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 }}Xác thực
Create a key in Studio → Developers → API keys. Store it on your server and send it in the Authorization header.
Authorization: Bearer <API_KEY>Tham chiếu API
Check each model guide for inputs, Studio limits, and output format.
- GET
/v1/modelsXem danh mục mô hình để tích hợp.
- POST
/v1/predictionsGửi yêu cầu dự đoán kèm mô hình và đối tượng đầu vào.
- GET
/v1/predictions/:idKiểm tra trạng thái và lấy kết quả.
- POST
/v1/batchesGửi nhiều đầu vào cho cùng một mô hình.
- GET
/v1/batches/:idKiểm tra trạng thái lô và kết quả của từng mục.
Lệnh gọi lại
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
- Dự đoán đã hoàn tất và có thể lấy kết quả.
- prediction.failed
- Dự đoán thất bại. Hãy kiểm tra trạng thái để biết lỗi.
- batch.completed
- Lô đã xử lý xong. Kiểm tra từng mục, kể cả khi lô chỉ thành công một phần.
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" }}Xử lý theo lô
Nhóm đầu vào của cùng một mô hình trong items. Gán custom_id riêng cho từng đầu vào để ghép đúng kết quả, kể cả khi thứ tự xử lý thay đổi.
POST /v1/batchesKiểm tra tính hợp lệ của từng đầu vào. Chia công việc thành nhiều lô nếu tổng kích thước hoặc số mục vượt giới hạn.GET /v1/batches/:idKiểm tra trạng thái của từng mục. Một lô có thể chứa cả mục thành công và mục gặp lỗi.custom_idLưu các kết quả thành công. Chỉ tạo lô mới từ những mục có thể thử lại.
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 } } ]}Mô hình
Find a model by analysis type. Each guide includes its ID, fields, and API examples.
Dự báo
Sự chú ý thị giác
Suy luận nhân quả
Giá API
Đang tải bảng giá…
Xem các gói StudioKhu vực nhà phát triển trong Studio
Đăng nhập để mở khu vực nhà phát triển trong tài khoản của bạn.
- Tổng quanTrang bắt đầu của khu vực nhà phát triển trong Studio.
- Mô hìnhDanh mục, hướng dẫn kỹ thuật và giá của từng mô hình.
- Khóa APICreate and revoke integration keys.
- Mức sử dụngDaily requests, errors, and accepted predictions.
- Chi phí APILịch sử riêng tư về chi phí ước tính của các lượt chạy trong Studio.
- Yêu cầuView request history and HTTP responses.
- Nhật kýReview job outcomes and callback deliveries.
- Tài liệuAuthentication and examples of the API.