Skip to main content
This walks the golden path with nothing but curl: point an agent at a workspace, give it a task, watch the run, and collect the files it produced.
Everything below runs against production with a fresh key. Prefer code? The same flow in TypeScript is a few lines with @arg-ai/sdk.
Use a user-owned API key for this quickstart. Creating a workspace with POST /api/workspaces requires a user principal and returns 403 for service-account keys — see Step 2 for the unattended alternative.

Prerequisites

Create a user-owned key at arg.ai/platform/api-keys, then export it. The plaintext key (arg_live_…) is shown only once.
1

Create a workspace

A workspace is the container an agent does work inside — its files persist across runs.
Save the id:
Service-account keys get 403 here (POST /api/workspaces requires a user principal). For unattended automation, create the workspace under an organization instead:
2

Upload an input file

Upload a file the agent can work on. The upload is multipart/form-data; the optional path query sets the destination folder.
3

Start an agent run

A run is a chat plus a turn. First create the chat, then send the task. Pass workspace_id so the agent can see your files.
A 200 means the turn started executing — keep call_id and job_id:
If a turn is already running on this chat, you get a 202 instead — the new turn was queued behind it:
4

Poll until the run finishes

Poll the status endpoint until status is completed or error. It reports pending while the run is in flight (it does not stream intermediate events).
The toolOutputs array names every file the agent wrote — a quick way to find your artifacts.
5

Collect the output artifacts

List the workspace tree, then download what the agent produced.
For text files you can read the content inline instead of downloading bytes:
6

(Optional) iterate, then clean up

Send another turn to the same chat to build on the work:
Release the finished job, and delete the chat when you’re done:

Error format

Every error is a JSON object with a detail string and the matching HTTP status:
Common statuses: 401 (bad/missing key), 403 (authenticated but not permitted — e.g. a service-account key creating a workspace), 404 (not found), 429 (rate limited).

Next steps

  • Skip the plumbing. @arg-ai/sdk wraps this exact flow (auth, retries, typed errors, the Run lifecycle, and resilient file uploads), so the golden path is a handful of typed calls instead of raw curl.
  • Go deeper on runs. Agent runs covers queueing a follow-up, steering a turn already in flight, and stopping one that has gone wrong.
  • Run code yourself. Execute shell commands and edit files directly with the tools API, no model in the loop.
  • Make it recurring. Unattended runs covers service accounts, schedules, and being told when something breaks.
  • Browse the full surface in the API Reference.