Plan the calls for a task
A task in plain words becomes the chain of calls that does it, with links and handles from the task filled in and the total cost.
GET /v1/utility/planBeta0 credits per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/utility/plan?task=comments%20on%20https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 0 credits{ "task": "comments on https://www.youtube.com/watch?v=dQw4w9WgXcQ", "recipe": null, "understood": { "links": [ "https://www.youtube.com/watch?v=dQw4w9WgXcQ" ], "handles": [], "query": null }, "steps": [ { "step": 1, "endpoint": "youtube.video.comments", "tool": "youtube_video_comments", "method": "GET", "path": "/v1/youtube/videos/{id}/comments", "params": { "id": "dQw4w9WgXcQ" }, "credits": 1, "why": "Reads https://www.youtube.com/watch?v=dQw4w9WgXcQ the way the task asks." } ], "missing_inputs": [], "total_credits": 1, "keyless_usd": 0.01, "note": "Call the steps in order; a later step takes ids from the one before it. Costs are per call; failed calls are free."}Parameters
| Name | Type | Description |
|---|---|---|
taskquery | string | What you want, in plain words. Example: get the comments on https://www.youtube.com/watch?v=dQw4w9WgXcQ. |
queryquery | string | Same as task. |
Status codes
| Status | Meaning |
|---|---|
200 | The plan: steps, missing inputs, total cost. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No such endpoint, recipe or platform. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Utility is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
Does it cost anything?
No. Discovery endpoints are free and need no API key, so an agent can look around before it signs up.
Reddit, X and every other platform named here are trademarks of their owners. We are not affiliated with or endorsed by any of them.