Skip to main content
By the end, you will have started the Retriever agent via API and read a real company list.
Prefer not to write an HTTP client? Connect Claude, ChatGPT, Cursor, or Codex to the hosted MCP server at $RETRIEVER_API_URL/mcp: sign in with your Retriever account, or use the same ret_live_… key. See Model Context Protocol (MCP).
Prerequisites
  • A Retriever account with some credits.
  • curl and jq (brew install jq, apt install jq), and uuidgen (on Linux without it, the snippet reads /proc/sys/kernel/random/uuid). Or Node 18+, or Python 3.9+: see full scripts.
1

Create an API key (1 min)

  1. Open the Retriever app.
  2. Go to Settings → API keys.
  3. Click Create API key, then confirm with Create key.
  4. Copy the ret_live_… key. It is shown only once.
2

Verify the key (15 s)

/credits has no /v1 prefix.
Expected result:
3

Start a run (15 s)

A small request for a quick result:Generate the key once and keep it: sending the same request again with this key never creates a second run.
Then send the request:
202 Accepted response (excerpt):
  • output asks the agent to publish its table under the key startups. You will know exactly what to read in the last step.
  • Retriever created a workspace and a conversation. You will see them in the app too.
  • If no RUN_ID is printed, read the error above. A 401 means a wrong key. For a network error, a 429 or a 5xx, run only the RUN_ID=$(curl …) command again, with the same IDEMPOTENCY_KEY: you get the same run back instead of a second, billed run. Do not generate a new key for the same request.
4

Wait for completion (1 to 3 min)

The loop works in bash and zsh. It stops on a terminal status, on the first failed read, or after 10 minutes of execution, and prints the command to resume. Time spent queued does not count: a queued run starts on its own, so never create it again. See Runs per organization.
  • A network error, a 429 or a 5xx says nothing about the run: run the loop again.
  • A 401 or 404 means a wrong key or run id: fix it first.
  • The loop does not retry. For retries with backoff, see the shared Node client and Make your integrations robust.
5

Read the result (15 s)

Column names depend on the agent. To enforce them, add a row_schema: see Get a guaranteed table format.
You made your first authenticated API call and got a prospect list.

Same flow in Node.js or Python

Run node quickstart.mjs (Node 18+) or python quickstart.py (pip install requests).
  • Each script prints IDEMPOTENCY_KEY before it creates the run, then RUN_ID as soon as it is known.
  • On any failure, the script stops and prints the command that resumes it: with the same IDEMPOTENCY_KEY while the run is not confirmed (the same key never creates a second run), with RUN_ID once it is.
  • A 401 or 404 means a wrong key or run id: fix it before resuming.
  • If you stop the script yourself (Ctrl-C), resume with RUN_ID=<the printed id> node quickstart.mjs (or python quickstart.py). If it stopped before printing RUN_ID, use IDEMPOTENCY_KEY=<the printed key>. Running it with neither creates a second run, which is billed.
  • The scripts do not retry. For retries with backoff on network errors, 429 and 5xx, see the shared Node client and Make your integrations robust.

Next steps