Submit Tasks via the CLI

The Pool Do CLI lets you submit tasks and check results from the command line — useful for scripting and batch workflows.

Authentication

Set your API key and server URL as environment variables:

export POOLDO_SERVER_URL="https://your-pooldo-instance.example.com"
export POOLDO_API_KEY="your-api-key"

Submit a Single Task

curl -X POST "$POOLDO_SERVER_URL/api/v1/tasks" \
  -H "Authorization: Bearer $POOLDO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "pool_id": "your-pool-id",
    "model": "llama3.2",
    "params": {
      "prompt": "Explain quantum computing in one paragraph.",
      "temperature": 0.7,
      "max_tokens": 256
    }
  }'

The response includes a task_id you can use to check the result.

Check Task Status

curl "$POOLDO_SERVER_URL/api/v1/tasks/{task_id}" \
  -H "Authorization: Bearer $POOLDO_API_KEY"

Submit a Batch

For bulk workloads, prepare a JSONL file where each line is a task:

{"model": "llama3.2", "params": {"prompt": "Summarize: ...", "max_tokens": 128}}
{"model": "llama3.2", "params": {"prompt": "Summarize: ...", "max_tokens": 128}}

Then submit it:

curl -X POST "$POOLDO_SERVER_URL/api/v1/batches" \
  -H "Authorization: Bearer $POOLDO_API_KEY" \
  -F "pool_id=your-pool-id" \
  -F "file=@tasks.jsonl"

Poll for Batch Completion

curl "$POOLDO_SERVER_URL/api/v1/batches/{batch_id}" \
  -H "Authorization: Bearer $POOLDO_API_KEY"

The response includes total, completed, failed, and remaining counts.

Tips