Skip to main content

Workflow Overview:

  1. Authentication
    • Establish a secure session by authenticating the user against the API.
    • Ensure all subsequent requests include the required security credentials.
  2. Dataset Upload
    • Upload the tabular training data by sending a POST request to /api/datasets.
    • Assign a unique and identifiable dataset_name in the payload to reference this file later.
  3. Model Training Initiation
    • Trigger the training job for your specific task (e.g., prediction, clustering) via a POST request to /api/models/{task_type}/train.
    • System Response: The API will immediately return a unique model_id and an initial status of PENDING.
  4. Training Status Monitoring
    • Monitor the job progress by polling the status endpoint via a GET request to /api/models/{model_id}.
    • Wait for the training_status to transition to COMPLETE before proceeding.
  5. Inference Execution
    • Generate predictions or embeddings by sending a POST request to /api/models/{task_type}/{model_id}/infer.
    • Required Inputs: Include the model_id (from Step 3) and the target dataset_id of an uploaded dataset (repeat Step 2 to upload a new dataset for inference).

Example requests:

With the following environment variables:
export WOODWIDE_API_KEY="sk_your_api_key_here"
export BASE_URL="https://wwai-representation-demo-dev.uw.r.appspot.com"

List datasets:

curl -X GET "$BASE_URL/api/datasets" \
  -H "accept: application/json" \
  -H "Authorization: Bearer $WOODWIDE_API_KEY"

Create a new dataset:

curl -X POST "$BASE_URL/api/datasets" \
  -H "accept: application/json" \
  -H "Authorization: Bearer $WOODWIDE_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F "[email protected];type=text/csv" \
  -F "name=mydata" \
  -F "overwrite=false"

Train a new model:

curl -X POST "$BASE_URL/api/models/prediction/train?dataset_name=my_dataset_name" \
  -H "accept: application/json" \
  -H "Authorization: Bearer $WOODWIDE_API_KEY" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "model_name=my_model_name" \
  -d "label_column=my_label_column_name" \
  -d "overwrite=false"

Check model training progress:

curl -X GET "$BASE_URL/api/models/{model_id}" \
  -H "accept: application/json" \
  -H "Authorization: Bearer $WOODWIDE_API_KEY"

Use model to make predictions on dataset:

curl -X POST "$BASE_URL/api/models/prediction/{model_id}/infer?dataset_id={dataset_id}" \
  -H "accept: application/json" \
  -H "Authorization: Bearer $WOODWIDE_API_KEY" \
  -H "Content-Type: application/x-www-form-urlencoded"