curl --request POST \
--url https://api.woodwide.ai/models/{model_id}/infer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form output_type=jsonimport requests
url = "https://api.woodwide.ai/models/{model_id}/infer"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "output_type": "json" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', 'test.csv');
form.append('output_type', 'json');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.woodwide.ai/models/{model_id}/infer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.woodwide.ai/models/{model_id}/infer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\ntest.csv\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_type\"\r\n\r\njson\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.woodwide.ai/models/{model_id}/infer"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\ntest.csv\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_type\"\r\n\r\njson\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.woodwide.ai/models/{model_id}/infer")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\ntest.csv\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_type\"\r\n\r\njson\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.woodwide.ai/models/{model_id}/infer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\ntest.csv\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_type\"\r\n\r\njson\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"job_id": "c3d4e5f6-0000-0000-0000-000000000001",
"status": "succeeded",
"latency_ms": 29567,
"model_id": "b2c3d4e5-0000-0000-0000-000000000001",
"model_version_id": "b2c3d4e5-0000-0000-0000-000000000002",
"model_type": "prediction",
"data": {
"id": [
0
],
"prediction": [
"competitor"
],
"prediction_probs": [
0.9999940395355225
]
},
"prediction_descriptions": {
"competitor": {
"summary": "Service Recovery and Support Volume",
"description": "These active accounts are flagged for retention efforts due to elevated support volumes."
}
}
}{
"detail": "Not authenticated"
}{
"detail": "Forbidden"
}{
"detail": "Not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "Rate limit exceeded. Retry after a short delay."
}Infer (File Upload)
Upload a CSV file and get results back immediately.
curl --request POST \
--url https://api.woodwide.ai/models/{model_id}/infer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form output_type=jsonimport requests
url = "https://api.woodwide.ai/models/{model_id}/infer"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "output_type": "json" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', 'test.csv');
form.append('output_type', 'json');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.woodwide.ai/models/{model_id}/infer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.woodwide.ai/models/{model_id}/infer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\ntest.csv\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_type\"\r\n\r\njson\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.woodwide.ai/models/{model_id}/infer"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\ntest.csv\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_type\"\r\n\r\njson\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.woodwide.ai/models/{model_id}/infer")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\ntest.csv\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_type\"\r\n\r\njson\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.woodwide.ai/models/{model_id}/infer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\ntest.csv\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_type\"\r\n\r\njson\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"job_id": "c3d4e5f6-0000-0000-0000-000000000001",
"status": "succeeded",
"latency_ms": 29567,
"model_id": "b2c3d4e5-0000-0000-0000-000000000001",
"model_version_id": "b2c3d4e5-0000-0000-0000-000000000002",
"model_type": "prediction",
"data": {
"id": [
0
],
"prediction": [
"competitor"
],
"prediction_probs": [
0.9999940395355225
]
},
"prediction_descriptions": {
"competitor": {
"summary": "Service Recovery and Support Volume",
"description": "These active accounts are flagged for retention efforts due to elevated support volumes."
}
}
}{
"detail": "Not authenticated"
}{
"detail": "Forbidden"
}{
"detail": "Not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "Rate limit exceeded. Retry after a short delay."
}model_version_id is specified. Maximum file size is 30 MB.
Set output_type to control the response format (json, csv, or parquet). For anomaly models, set anomaly_format to ids_only (default) or per_row.
See Output Formats for output columns by model type.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
The file to upload. Maximum file size: 30 MB.
Supported inference output formats.
json, csv, parquet "json"
Controls anomaly detection output shape. 'ids_only' returns a list of anomalous row indices. 'per_row' returns id, is_anomaly, and anomaly_score for every input row. Ignored for non-anomaly model types.
ids_only, per_row Response
Successful Response Output format depends on the output_type parameter (json, csv, or parquet). See Output Formats for output columns by model type.
When output_type is json, the response is a JSON object. When output_type is csv or parquet, the response is a file download.
Unique ID for the inference job.
Job status (e.g. succeeded).
Inference latency in milliseconds.
ID of the model used.
ID of the model version used.
Type of the model (e.g. prediction, clustering).
Inference results. Structure varies by model type.
Human-readable descriptions keyed by prediction value (prediction models only).
Was this page helpful?